Beruflich Dokumente
Kultur Dokumente
Fall 2014
Operating System
Component and Structure
Myungjin Lee
myungjin.lee@ed.ac.uk
1
OS structure
D1 start i/o D4
D2 D3
2
User Apps
Portable
Systems Manager Manager Support
Device Interrupt Boot &
Drivers Handlers Init
Hardware Abstraction Layer
3
Command Interpreter
Information Services
Protection System
I/O System
4
Major OS components
• processes
• memory
• I/O
• secondary storage
• file systems
• protection
• shells (command interpreter, or OS UI)
• GUI
• Networking
5
Process management
6
Program/processor/process
7
States of a user process
running
dispatch interrupt
ready trap or
exception
interrupt
blocked
8
Process operations
9
Memory management
• The primary memory is the directly accessed storage for the CPU
– programs must be stored in memory to execute
– memory access is fast
– but memory doesn’t survive power failures
• OS must:
– allocate memory space for programs (explicitly and implicitly)
– deallocate space when needed by rest of system
– maintain mappings from physical to virtual memory
• through page tables
– decide how much memory to allocate to each process
• a policy decision
– decide when to remove a process from memory
• also policy
10
I/O
11
Secondary storage
12
File systems
13
File system operations
14
Protection
15
Command interpreter (shell)
16
OS structure
Command Interpreter
Information Services
Protection System
I/O System
17
OS structure
18
Early structure: Monolithic
user programs
OS everything
hardware
19
Monolithic design
• Major advantage:
– cost of module interactions is low (procedure call)
• Disadvantages:
– hard to understand
– hard to modify
– unreliable (no isolation between system modules)
– hard to maintain
• What is the alternative?
– find a way to organize the OS in order to simplify its design and
implementation
20
Layering
21
Problems with layering
22
Hardware Abstraction Layer
23
Microkernels
24
Microkernel structure illustrated
firefox powerpoint
user
processes apache photoshop
user mode
itunes word
communication
Kernel
mode
microkernel low-level VM processor
protection control
hardware
25
26
27
Loadable Kernel Modules
Kernel modules
Kernel
29