Operating Systems
Total Page:16
File Type:pdf, Size:1020Kb
Operating Systems Summary Fabian Damken Contents 1 Introduction 5 1.1 History . .5 1.2 Definition over Hardware Abstraction . .5 1.2.1 Portable Operating System Interface (POSIX) . .5 1.2.2 Linux Standard Base (LSB) . .5 1.2.3 x86 Rings . .6 1.2.4 Monolithic vs. Micro-Kernel . .6 1.3 Definition over Coordination . .6 2 Processes and Inter-Process-Communication 7 2.1 Processes . .7 2.1.1 Process Family and Hierarchy . .7 2.2 Concurrency . .8 2.3 Process Management . .9 2.3.1 Process Control Block . .9 2.3.2 Process Creation (POSIX) . 10 2.3.3 Process Termination . 11 2.3.4 Inter-Process-Communication . 11 2.4 Inter-Process-Communication Models . 12 2.4.1 Shared Memory . 12 2.4.2 Message Passing . 13 3 Threads 16 3.1 Process vs. Thread Model . 16 3.2 Example: Multi-Threaded Web Server . 17 3.3 Theoretical Speedup (Amdahl’s Law) . 17 3.4 Implementations . 17 3.4.1 Many-to-One . 17 3.4.2 One-to-One . 18 3.4.3 Many-to-Many . 18 3.4.4 Two-level Model . 18 3.5 Linux Threads/Tasks . 18 3.6 POSIX Threads (C) . 19 3.7 Single to Multi-Threaded . 19 4 Deadlocks and Resource Management 20 4.1 Resource Management . 20 4.1.1 Google Chubby Lock Service . 20 4.1.2 Resource Sharing und Inter-Process-Interaction . 20 4.2 Deadlock/Livelock and Starvation . 20 4.3 Deadlock Conditions . 20 4.4 Deadlock Modeling und Visualization . 20 4.5 Deadlock Strategies . 20 4.5.1 Detection . 20 4.5.2 Recovery . 20 1 4.5.3 Avoidance . 20 4.5.4 Prevention . 20 5 Scheduling 22 5.1 Scheduling Criteria (Optimizations) . 22 5.2 Issues . 22 5.3 Determining Length of next CPU Burst . 22 5.4 Flavors of Scheduling . 22 5.4.1 First Come, First Serve (Non-Preemptive) (FCFS) . 22 5.4.2 Shortest-Job-First . 22 5.4.3 Round Robin (RR/TDMA) with Fixed Slots . 22 5.4.4 Priority Scheduling (PS) . 22 5.5 OS Examples . 22 5.5.1 Multilevel Feedback Queue . 22 5.5.2 Solaris . 22 5.5.3 Windows . 22 5.5.4 Linux . 22 5.6 Scheduler Location . 22 6 Mutual Exclusion 23 6.1 Concurrent Access to Shared Resources . 23 6.2 Taxonomy of Software Misbehavior . 23 6.3 Critical Sections . 23 6.4 Mutual Exclusion and Critical Sections . 23 6.5 Mutual Exclusion Strategies . 23 6.5.1 Interrupts . 23 6.5.2 Process Alternation . 23 6.5.3 Locks . 23 6.5.4 Semaphores . 23 6.6 Classical Problems . 23 6.6.1 Dining Philosophers . 23 6.6.2 Readers-Writers Problem . 23 7 Memory Management 24 7.1 Abstraction . 24 7.2 Avoiding Slow Disk Loads in Commodity Systems . 24 7.2.1 Solution: Address Spaces . 24 7.3 Address Space Implementations . 24 7.4 Base and Bounds . 24 7.4.1 Memory Layout . 24 7.4.2 Memory Safety . 24 7.4.3 Requirements . 24 7.4.4 OS/Hardware Interactions . 24 7.4.5 Pros and Cons . 24 7.5 Segmentation . 24 7.5.1 Memory Layout . 24 7.5.2 Address Translation . 24 7.5.3 Stack Address Calculation . 25 7.6 Paging . ..