Professional Documents
Culture Documents
Gedankundmathematics
Recall the pointer verification case for fread( ) Can you speed up the checking process? Whats the best you could achieve? O(n)? O(logn)? O(1)? What happens if you have >32 bits?
Mechanics
Readings updated
Protection Issues
I/O protection
Memory protection
CPU protection
Protection is a prerequisite Safety can be separation of concerns Security related to overall design
Examples? Bad pointer access causing seg fault Sniffing cleartext passwords on the wire
System Calls & Libraries
Special Instructions
Mapping, TLB, etc Device registers I/O channels, etc. Processor features
Mode Bits
Device access
System Calls & Libraries
Capabilities
Fine-grained access control Crypto-like tokens OS services in user space Small core hypervisor
Microkernels
Monolithic
User program
User program
10
11
Layered Structure
12
13
Microkernel
Micro-kernel is micro Services are implemented as regular process Micro-kernel get services on behalf of users by messaging with the service processes Examples: Taos, Mach, L4
User program
Services
entry m-kernel
14
15
Virtual Machine
provide multiple virtual real hardware run different OS codes IBM VM/370 virtual 8086 mode Java VMWare
Example
Small kernel
Bare hardware
16
Hardware Support
What is the minimal support? Can virtual machine be protected without such support?
Hint: what is a Turing machine?
17
User code can be arbitrary User User User code cannot modify program program kernel memory Makes a system call with parameters The call mechanism switches entry code to kernel mode Kernel in Execute system call protected memory Return with results
18
Interrupt Sources
Exceptions
Program error: faults, traps, and aborts Software generated: INT 3 Machine-check exceptions
19
1
2 3 4 5 6 7 8 9 10
#DB
#BP #OF #BR #UD #NM #DF #TS
Debug
NMI interrupt Breakpoint Overflow BOUND range exceeded Invalid opcode Device not available Double fault Coprocessor segment overrun Invalid TSS
System Calls & Libraries
Fault/trap
Interrupt Trap Trap Trap Fault Fault Abort Fault
20
Type Fault Fault Fault Fault Fault Fault Fault Abort Interrupt
21
System Calls
22
System services
23
Passing Parameters
Architecture Compiler OS
24
25
26
frame
frame
27
User stack
Kernel stack
Kernel memory
28
User stack
Kernel stack
Kernel memory
29
Can user code lie? One result register large results? Parameters in user memory Multiprocessors
30
Simplicity, obviousness Generality same call handles many cases Composition / decomposition
31
Separation Of Concerns
Memory management Kernel allocates pages hw protection Programs use malloc( ) fine grained Kernel doesnt care about small allocs
32
Library Benefits
Call overhead
Easier to program
33
Answer: signals
System Calls & Libraries
34