Hello World! An Invitation to Computer Science
Lecture Slides
Operating Systems and Deadlock
Thursday April 24, 2008
- An operating system is a resource manager
- processes, files, memory, I/O, security
- context switches and multitasking
Memory management
- virtual memory hierarchy:
register, cache (L1, L2, ...), primary, secondary
- allocation, deallocation, swapping
- protection: separation between processes (in good OSs!)
- sharing allowed between processes/threads in controlled manner
(programmer doesn't have to know details)
File system
(What is a file?)
- persistence, scalability, concurrency
- abstraction (again!)
disparate entities (disk, cd, network drive, etc.) appear similar
- standard organizing principles: regular files, directories
- permissions and privileges
Input and output (I/O)
- extension of ideas from file system
- devices can be accessed as if they are files (or streams)
- buffers for efficiency
- polling and interrupts
Competition for resources
what if important operation halted because of context switch?
to avoid this problem, there is often hardware support for
locking out other process during critical regions
Deadlock!
- 2 or more processes blocked, waiting on each other
- necessary conditions:
- competition for resources that cannot be shared
- resources can be requested in parts
- allocated resource cannot be retrieved by force
- prevention, detection, recovery
- dining-philosophers problem
and related problem of starvation
Communication
- once again, abstraction
- interprocess communication: two programs on same computer
- network communication: two programs on different computers
- this is why OSs and networks are studied together
Security
- Internet/Web growth pressure OS-makers to take more seriously
- managing users: password, shadows, etc.
- permissions: file, memory, command execution
- superusers and daemons
- cryptography
5th generation OS?
- book: focus on improved UI (but we know that's really separate)
- more parallelism, more distributed
- finer-grained and stronger security
- abstraction to hide details of where something is
- will be crucial if "telecosm" comes to pass
- will it be open source?