computer system organization & operating system operating
TRANSCRIPT
Operating systems
Asst.Prof.Dr. Supakit Nootyaskool
IT-KMITL, Thailand
Computer System Organization & Operating System
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.
Topics
• Boot process
• Functions of operating system
• Type of operating system
• Process and threads
• System call
• User/Kernel Space
• Computer virus
Activity 9.1 Write the name of operating systems
Year Name Year Name
Boot process
Beep code
MBR
Load OS (Kernel)
POSTBIOS
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
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
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
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.
Beep codes
• Pattern of beep code differences by the computer brand.
https://www.computerhope.com/beep.htm
Activity 9.2 Test beep code on the computer system
Test conditions Beep code
No memory
Not connected VGA
Not connected keyboard/mouse
Activity 9.3 Try to setup BIOS in the old computer system.
Where is Master Boot Recorded in HDD
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
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
Type of operating system
Batch processing Multiprogramming
Multitasking Multithreading
History of Operating System
1940 – 1950, The first generation of OS
• No operating system
• Input/output used switches/lamps
• A program called “Job”
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
History of Operating System
1965 – 1980, The third generation of OS
• Batch processing
• Multiprogramming
• Resource sharing
History of Operating System
1980 – Present, The fourth generation of OS
• Multiple job run at the same time
• Batch processing
• Multiprogramming
• Resource sharing
• Multithreads
Example of batch processing OS today
• Applications
– Payroll System
– Bank Invoice System
– Transaction Processing
– Daily report
– Bill payment system
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.
Activity 9.4
• Run windows95 and open QBASIC to write a program as below.
Single programming
Multi-programming
Case of wait I/O responses
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.)
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
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
Time-Sharing System
Hardware feature to control
• I/O Interrupt
• DMA
Time-Sharing System
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.
Example Multithread in MS-Word
During you typing Word, the spell-check thread is running.
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.
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/
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
Structure of MS-DOS
What does computer virus work?
• Crack computer hardware
• Attach data in hard drive
• Spread to other computer
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