CS 101 – Oct. 26 Operating Systems (Chapter 10) –Ultimate program –Intimate with the hardware –Responsibilities… –Examples
Operating Systems Computer is like a 3-story building OS manages the whole machine; interfaces with us. Applications Operating System Bare hardware
OS Manages… logins, logouts, passwords CPU memory files I/O user interface security
Passwords Login: username & password Password security –Many combinations –Penalties for mistake –Password file is encrypted
CPU mgmt. What does this entail? Process table: awareness of all currently running programs Synchronization: making sure 2 executing programs don’t interfere with each other Scheduling: deciding which process to execute
Process OS must keep track of all the work it’s doing, in case of interruption (e.g. hibernate mode). A process is an executing program. Possible states for process (p. 338) –Ready (could execute, but doesn’t have CPU) –Running (in CPU) –Waiting (doing I/O operation)
Synchronization Computer system has finite resources that must be shared Examples –2 machines want to print at same time –Copy a file that’s currently in use What to do? –Detect if available –Need to temporarily “lock” the resource
Multi-tasking Definition: doing multiple things at once Practical definition: make it appear as though… Time quantum (0.1 sec) Processes take turns using the CPU We’ll look at the general problem of scheduling later.
Memory mgmt. RAM is much faster than disk, but smaller OS determines what belongs in RAM When RAM gets crowded, less-used files sent back to disk. –Like a small kitchen counter that can’t hold all your recipe’s ingredients. Thrashing