Operating System Components and Services, Continued
Tom Kelliher, CS42
Sept. 13, 1996
- Hardware
- Uniprocessor --- single CPU
- Multiprocessor --- multiple CPU's, shared memory
- Distributed system --- multiple CPU's, no shared memory (How is a
hypercube classified?)
- Software
- Process (Job, Task) --- Activity generated by a program executed
by a sequential processor. Single thread of control. Deterministic.
Is this definition bullet-proof? Can a process be associated with
more than one program? Can a program be associated to more than one
process?
- Sequential Program --- program executed by a single process
- Parallel or Concurrent Program --- program executed by several
processes
If two people run vi, does that make vi a concurrent program? What
is sharable there (this distinguishes concurrency, as does working
toward a common goal)?
- O.S. Classification
- Based on interaction with the user
- Classical --- batch, timesharing
- Special Purpose --- database, real-time
- Based on number of jobs and processors
Unix shell and commands. Foreground and background processes:
shell:
while (!EOF)
{
read cmd
parse cmd
fork cmd
if (! background command)
wait cmd
}
cmd:
execute
exit
Pipeline: c1 | c2
set up environment and pipeline
fork c1
fork c2
wait
wait
Definitions:
- Layered System --- A system in which pieces are built on top of other
pieces, with hardware as a foundation. A layer make calls
exclusively to the layer beneath it.
Advantages:
- Well defined structure.
- Modular.
- Information Hiding.
Disadvantages:
- Poor performance on ``deep'' calls.
- Difficulty in creating a ``good'' layered design.
- Micro Kernel --- A small executive that provides only necessary
functionality to support threads/processes:
- CPU scheduling.
- Process primitives: create, destroy, suspend, activate, change
priority, etc.
- IPC.
- Virtual Memory.
- Interrupt handlers.
- Device driver interface.
Runs in kernel (supervisor) mode. Everything else runs in user mode.
Advantages:
- Only a small amount of code runs in kernel mode.
- Easily extended.
- System routines work with an abstract machine model --- portability.
Disadvantages:
- System calls require a context switch (slow).
- Not easily extended (traditional kernel).
Weak layering:
Traditional kernel:
Micro kernel:
A strictly layered system:
Lowest software level (between kernel and hardware) provides a virtual
machine interface to multiple, independent kernels. IBM VM.
- Support for OS development alongside a production system.
- Virtual user/monitor mode, real user/monitor mode.
- How is a disk operation carried out?
- Virtual Machine is a simulation:
- Simulate one architecture with another.
- Efficiency?
- How are physical devices (a disk) ``virtualized?''
- Implementing OSs in HLLs:
- Burroughs MCP in Algol (NEWP).
- Unix in C.
- A few modules must be written in assembler. Others for
efficiency.
- Running make to build a Unix kernel.
- BSD/OS boot procedure:
- BIOS.
- Boot block on 1st hard disk.
- /boot.
- /bsd.
- Autoprobing.
- init.
See boot(8).
Thomas P. Kelliher
Fri Sep 13 09:31:42 EDT 1996
Tom Kelliher