41
Operating systems Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL, Thailand Computer System Organization & Operating System

Computer System Organization & Operating System Operating

  • Upload
    others

  • View
    14

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Computer System Organization & Operating System Operating

Operating systems

Asst.Prof.Dr. Supakit Nootyaskool

IT-KMITL, Thailand

Computer System Organization & Operating System

Page 2: Computer System Organization & Operating System Operating

Object

• Experience setup BIOS and check error in the computer hardware

• Understand concepts of process and thread.

• Known the space between user and kernel.

• Recognize history of operating system.

Page 3: Computer System Organization & Operating System Operating

Topics

• Boot process

• Functions of operating system

• Type of operating system

• Process and threads

• System call

• User/Kernel Space

• Computer virus

Page 4: Computer System Organization & Operating System Operating

Activity 9.1 Write the name of operating systems

Year Name Year Name

Page 5: Computer System Organization & Operating System Operating

Boot process

Beep code

MBR

Load OS (Kernel)

POSTBIOS

Page 6: Computer System Organization & Operating System Operating

Basic Input Output System (BIOS)

• The first program runs after turn on the computer system

• BIOS’s work is initiate all hardware in the system, doing the self-test called power-on-self-test (POST).

• Two BIOS types

– Legacy BIOS

– UEFI

Page 7: Computer System Organization & Operating System Operating

Basic Input Output System (BIOS)

• The first program runs after turn on the computer system

• BIOS’s work is initiate all hardware in the system, doing the self-test called power-on-self-test (POST).

• Two BIOS types

– Legacy BIOS

– UEFI

• Obsoleted• hardcode memory

management • Hardcode I/O access

Page 8: Computer System Organization & Operating System Operating

Basic Input Output System (BIOS)

• The first program runs after turn on the computer system

• BIOS’s work is initiate all hardware in the system, doing the self-test called power-on-self-test (POST).

• Two BIOS types

– Legacy BIOS

– UEFI

• Unified Extensible Firmware Interface

• First introduced 2005• Support

• HDD over 2TB• Difference CPU architecture

(x86, ARM)• Diagnosis and repair computer

without operating system installed

Page 9: Computer System Organization & Operating System Operating

Basic Input Output System (BIOS)

• The first program runs after turn on the computer system

• BIOS’s work is initiate all hardware in the system, doing the self-test called power-on-self-test (POST).

• When the BIOS founds a problem, it will stop boot process and show an error message in beep codes.

Page 10: Computer System Organization & Operating System Operating

Beep codes

• Pattern of beep code differences by the computer brand.

https://www.computerhope.com/beep.htm

Page 11: Computer System Organization & Operating System Operating

Activity 9.2 Test beep code on the computer system

Test conditions Beep code

No memory

Not connected VGA

Not connected keyboard/mouse

Page 12: Computer System Organization & Operating System Operating

Activity 9.3 Try to setup BIOS in the old computer system.

Page 13: Computer System Organization & Operating System Operating

Where is Master Boot Recorded in HDD

Page 14: Computer System Organization & Operating System Operating

Trusted Platform Module (TPM)

Main features• Make sure the boot process

is in security and no error.• Disk encryption by

hardware• Store of the user’s

passwords

Page 15: Computer System Organization & Operating System Operating

Boot-loader for Microcontroller

• Universal bootloader– Arduino

– PIC (Microchip)

• Boot Arduino chip

• Organize the serial port via USB port

www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader

Page 16: Computer System Organization & Operating System Operating

Type of operating system

Batch processing Multiprogramming

Multitasking Multithreading

Page 17: Computer System Organization & Operating System Operating

History of Operating System

1940 – 1950, The first generation of OS

• No operating system

• Input/output used switches/lamps

• A program called “Job”

Page 18: Computer System Organization & Operating System Operating

History of Operating System

1950 – 1965, The second generation of OS

• Batch Processing OS

• Input used paper or keyboard

• Output used lamps or print-out to paper

• Storage is magnetic tape

Page 19: Computer System Organization & Operating System Operating

History of Operating System

1965 – 1980, The third generation of OS

• Batch processing

• Multiprogramming

• Resource sharing

Page 20: Computer System Organization & Operating System Operating

History of Operating System

1980 – Present, The fourth generation of OS

• Multiple job run at the same time

• Batch processing

• Multiprogramming

• Resource sharing

• Multithreads

Page 21: Computer System Organization & Operating System Operating

Example of batch processing OS today

• Applications

– Payroll System

– Bank Invoice System

– Transaction Processing

– Daily report

– Bill payment system

Page 22: Computer System Organization & Operating System Operating

Single vs Multi-programming

• The technique of utilizing several programs concurrently in a single computer (processor)

• Sharing CPU time to run various programs by switching each program in a short time.

• A program run on a computer.

• A program holds CPU time until finishes the execution.

• Supposed having two programs, the system finished executing one of a program then loading the next program.

Page 23: Computer System Organization & Operating System Operating

Activity 9.4

• Run windows95 and open QBASIC to write a program as below.

Page 24: Computer System Organization & Operating System Operating

Single programming

Multi-programming

Case of wait I/O responses

Page 25: Computer System Organization & Operating System Operating
Page 26: Computer System Organization & Operating System Operating

Activity: Why should not install an old operating system to a computer with a new processor version?

Answer: Compatibility between HW and OS

1. Unknow a new instruction set

2. Some hardware not supported (a geolocation service comes with Windows 10.)

Page 27: Computer System Organization & Operating System Operating
Page 28: Computer System Organization & Operating System Operating
Page 29: Computer System Organization & Operating System Operating
Page 30: Computer System Organization & Operating System Operating

Hardware Supported in OS

• Windows XP (2001) supports– Pentium 4– MMX, SSE – Multiprocessor– 32 bits computing

• Windows 3.1 (1990) supports

– 80286 to 80386

– 16/32 bits computing

• Windows 95 (1995) supports– 80486 to Pentium– Multitasking– MMX– 32 bits computing

• Windows 7 (2009) supports– Core 2 Duo, Quad

– MMX, SSE1-4,

– 64 bits computing

Page 31: Computer System Organization & Operating System Operating

Multiprocessing

• Using concept of CPU time sharing

• The hardware is multicore or multiple CPUs

• At the same time, it executes many processes (programs)

• Parallel processing

Page 32: Computer System Organization & Operating System Operating

Time-Sharing System

Hardware feature to control

• I/O Interrupt

• DMA

Page 33: Computer System Organization & Operating System Operating

Time-Sharing System

Page 34: Computer System Organization & Operating System Operating

Multitasking

• Using concept of CPU time sharing

• It is parallelism relating multiprocessor, but multitasking looks inside a program that consists processes, task, thread. – Thread is the smallest unit execution with in the

process. A process can have many threads running.

– A program during runs having a process number.

– OS look a process is running by called task.

Page 35: Computer System Organization & Operating System Operating

Example Multithread in MS-Word

During you typing Word, the spell-check thread is running.

Page 36: Computer System Organization & Operating System Operating

System Call

• It is service from OS providing to an application program.

• Example system call: file-open, read, write, exec, fork, kill

• Number of system call in OS,

– Linux OpenBSD has 300,

– FreeBSD has >500,

– Windows7 has 700.

Page 37: Computer System Organization & Operating System Operating

Activity 9.4 Test System Call with C

#include <stdio.h>#include <unistd.h>#include <sys/syscall.h>#include <sys/types.h>

int main() {

unsigned cpu, node;

// Get current CPU core and NUMA node via system call// Note this has no glibc wrapper so we must call it directlysyscall(SYS_getcpu, &cpu, &node, NULL);

// Display informationprintf("This program is running on CPU core %u and NUMA node %u.\n\n", cpu, node);

return 0;

}

https://linuxhint.com/linux_system_call_tutorial_c/

Page 38: Computer System Organization & Operating System Operating

User space / Kernel space

• User space is an area for

running applications.

• All installed program runs on the user space.

• Kernel is the core of the OS with control everything in the system.

• Kernel space is a restrict area for OS and OS-modules

Page 39: Computer System Organization & Operating System Operating

Structure of MS-DOS

Page 40: Computer System Organization & Operating System Operating

What does computer virus work?

• Crack computer hardware

• Attach data in hard drive

• Spread to other computer

Page 41: Computer System Organization & Operating System Operating

Function of operating system

• Resource management

– CPU time

– Memory space

– Network access time

– Data transferring

• Protect data from unallowed applications

• Provide File access and management

• Input / Output data management