Chapter 3 -- System Structure
-
Structures
-
Virtual Machine
-
Idea: Everyone runs on naked hardware, possibly augmented.
Kernel virtualizes the hardware as needed.
-
For some systems, 'fake' instructions are added to do useful things, like
get-a-file.
-
Advantages:
-
Can be very fast, since you write to hardware.
-
Disadvantages
-
Can be very slow, since hardware needs to be virtualized.
-
Simple (or ad-hoc)
-
DOS is an example.
-
Can offer maximum performance
-
Apps can read down to low-level operations if needed.
-
System functions can call any other function, providing maximum flexibility
and performance.
-
Can be hard to code/debug.
-
Can have infite loops that are hard to see
-
Memory manager want to get new page -> Device driver tries to free buffer
to read in page -> (go to start)
-
Schedular tries to bring in new process -> File system calls device driver
for data -> Device driver tries to WAIT for data to arive -> (go to start)
-
Can be inhibited because you don't know what you can call.
-
Layered
-
UNIX/WinNT are examples
-
Can offer ease of coding/debugging
-
By avoiding infinite loops.
-
By allowing development in stages.
-
NOTES ON UNIX LAYERING
-
Device drivers cannot call scheduler.
-
Device driver cannot call memory manager (DMA must be set up at higher
level).
-
NOTES on VENUS LAYERING:
-
Instruction interprater is micorcode for normal instructions.
-
Virtual memory cannot call device drivers (must be able to do swapping
with I/O channel).
-
General layering concerns (hints, not laws).
-
User programs always at top.
-
Virtual Memory subsystem must be able to access disk drives.
-
All drivers at level of Disk device driver must never cause a page fault.
-
Other layers can exist (lock manager, etc.)
-
No layer can call "system()" to do it's task.
-
Modular Kernel
-
Idea: The kernel has some subsystem that can be loaded and unloaded
like shared libraries
-
The libraries are loaded as needed, and have an INIT section that
runs when first loaded.
-
The init section can be freeded after loading.
-
Advantages:
-
Can replace some subsystems as needed.
-
Fast like normal kernel.
-
Disadvantages
-
Bugs in one section can crash whole system.
-
Microkernel
-
Idea: Have a VERY SMALL kernel, and deamons to do real
work
-
Kernel can be just 30K, that's nothing. Just does message passing,
and sometimes handles VM
-
Deamons implement file system, networking, graphics, etc.
-
Advantages:
-
Bugs in one subsystem don't crash whole system
-
Can replace subsystems as needed.
-
System programming easier
-
Only need load those parts needed.
-
Disadvantages
-
SPEED (need to pass messaged, get deamons scheduled, etc.)
-
When critical subsystems go down, system is unusable.