Introduction
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
filesystem.
- Low level: management of real resources: CPU cycles, memory, disk
space, device allocations.
- Secondary concerns: efficiency, fairness.
Abstractions:
- 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
independently.
Deposit process:
temp1 = balance;
temp1 += deposit;
balance = temp1;
Withdrawal process:
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.
- Executes
- 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.
Protection?
- System parallelism:
- Overlap processing of one job with I/O of another.
- Off-line processing (card to tape, vice versa).
- Spooling.
- 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.
- Protection?
- Timesharing:
- 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.
- Workstations:
- 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,
transparency.
- Granularity of parallelism.
- Network Latency.
Thomas P. Kelliher
Tue Sep 3 21:20:56 EDT 1996
Tom Kelliher