Show Menu
Cheatography

os Cheat Sheet (DRAFT) by

for midterm exam in Operationg system

This is a draft cheat sheet. It is a work in progress and is not finished yet.

lecture 1

computer system (layered archit­ect­ure): consist of 4 components (user -> applic­atoin program -> Operating system -> computer hardware) Components commun­icate with their immediate neighbors only
Roles of OS 1) Resource manage­ment: os = software that manage a computer's hardware 2) Serivices: act as interface applic­ati­on/user program <-> computer hardware

computer system

Hardware Organi­zation

Processor: Controls the operation of the computer and performs its data processing functions. When there is only one processor, it is often referred to as the central processing unit (CPU).
Main memory: Stores data and programs, volatile (lost power lost data)
I/O modules (devices and contro­llers): Move data between the computer and its external enviro­nment.
System bus: for commun­ication

CPU core (1 CPU =1 calcul­ation)

A processor might consist of one core or many cores.
• Core: The basic component unit of the CPU to execute instru­ctions.
• One core is needed to execute an instru­ction per time.
If there are N cores, we can executes up to N instru­ctions at a time (called parall­elism).

Running a computer create Process

Process = abstra­ction of executing a program (by the CPU)
computer working because of a process

Storage Structure

Electr­ically erasable progra­mmable read-only memory (EEPROM) stores a bootstrap
program, which loads the operating system when the computer is turned on.

Memory (including registers, cache, main memory) stores the ongoing instru­ctions
(codes) and temporary data that the CPU is executing. store processes , [volatile]

Secondary storage : stores programs & data [nonvo­latile]
Tertiary storage : refers to any special proposed storages e.x., CD-ROM, magnetic tape [nonvo­latile]
 

Hardware Interr­upt­/Po­lling

Interrupts: I/O Devices will signal the CPU. The CPU is free to do other work until signaled.
-> increasing CPU Utiliz­ation
Pollin­g(w­ithout interrupt): The CPU repeatedly asks devices if they are done. The CPU is tied to the polling loop.
-> waste CPU cycles
in comparison with using Interrupts finished earlier

Multip­rog­ramming and Multit­asking

Multit­asking [time-­sha­ring]: CPU switches frequently from executing one process to executing another process,
Multip­rog­ramming: maximize CPU utiliz­ation, keep the CPU busy at all times.

Dual-mode

Kernel mode(0) -> run OS , can access to ALL hardware (compl­etely control the computer))
User mode(1) -> run applic­ati­on/user program, NOT allowed to access to hardware and system resources.  
trap AKA. software interrupts =exception where the computer system switches from user mode -> kernel mode [syste­mcall]
context switching= CPU will switch executing from one process to another process
timer interrupt= Prevents user program to run forever.

Dual-mode

OS structure

Simple: most basic structur, Everything runs in kernel mode. ex. MS-DOS (in its early versio­ns)­sup­porting a single task/p­rocess
Monolithic: all OS services into a single kernel space ex. Linux
pros; commun­icate between components is fast -> efficient
Cons: Large kernel size.
 

Q&A

How user program use hardware
the app make privileged jobs -> create system call to OS in kernel -> OS do that job

???

Tedious mechanism =
System call = when the CPU executes an instru­ction related to privileged job
previlegde = make change on I/O devices