Tom Kelliher, CS42
Sept. 4, 1996
Why study, write operating systems?
Some things I hope you take with you:
- An understanding of what an OS does and how it does it.
- Concurrency (a new concept for you)
- The design & review process.
- Practical applications of algorithms and data structures.
- High level view: virtual machine abstraction --- convenient ``user''
interface. Abstractions: files, applications. I/O devices integrated into
- Low level: management of real resources: CPU cycles, memory, disk
space, device allocations.
- Secondary concerns: efficiency, fairness.
- Multiprogramming, protection and security.
- Virtual memory.
- File systems.
Understanding concurrency, pitfalls, mechanisms of control.
Can there really be two processes/threads executing simultaneously?
Example: Banking system where account updates can occur concurrently and
temp1 = balance;
temp1 += deposit;
balance = temp1;
temp2 = balance;
temp2 -= withdrawal;
balance = temp2;
- No concurrency, no problem.
- Consider interleaving.
- Hardware: CPU, memory, I/O.
- Operating system: kernel, file system, device handlers.
- Application programs: editors, compilers, workbench tools.
- Users: people, other programs, computers.
The ``Hello world'' program:
- Compiled into assembly code.
- Assembled in machine code.
- Written to a file.
- Loaded into memory.
- Linked against system libraries.
- Makes supervisor calls to access I/O devices through OS.
- Common device drivers:
- Reinventing the wheel.
- Abstract I/O device interface for software.
- Resident monitors:
- Keep expensive hardware utilized.
- Automatic job sequencing --- compile, run user program.
- Monitor is always resident in memory.
- System parallelism:
- Overlap processing of one job with I/O of another.
- Off-line processing (card to tape, vice versa).
- Multiprogramming (batch):
- Overlap processing yields multiple jobs in memory simultaneously
--- job pool.
- CPU idle when job does I/O.
- Automatically switch (CPU scheduling) to ``next'' job.
- Job runs until completion or I/O.
- Batch systems aren't productive for program development.
- Preemptive CPU scheduling.
- Brief quantum for each process.
- Response time important.
- Realtime systems:
- Hard deadlines for process completion.
- Example: flight surface control on the Space Shuttle.
- Essentially, a single-user computer.
- Mainframe features trickle down
- Why multiprogram a workstation?
- Increase productivity.
- Allows modular system design --- consider the windows in a GUI.
- Parallel processing:
- Tightly coupled multiprocessors.
- Shared memory space.
- CPU scheduling issues.
- Working set locality.
- Finding parallelism opportunities within a problem.
- Distributed systems:
- Loosely-coupled, independent systems.
- Private memory spaces.
- Client/server computing.
- Reliability, resource sharing, load balancing, communication,
- Granularity of parallelism.
- Network Latency.
Thomas P. Kelliher
Tue Sep 3 21:20:56 EDT 1996