You are previewing Operating Systems in Depth.
O'Reilly logo
Operating Systems in Depth

Book Description

Programmers don't want to just read about the core concepts of operating systems. They want to learn how to apply the material by actually building applications. This new book motivates them by presenting numerous programming exercises at the code level. They are not only introduced to the OS concepts and abstractions, but also the implementation. Two design projects are integrated throughout the book that they'll be able to follow to get them into the code. Self-assessment and review material is presented at the end of each chapter to reinforce concepts. These features help to make this an excellent resource for programmers to gain invaluable experience.

Table of Contents

  1. Copyright
  2. Preface
    1. AUDIENCE
    2. TOPIC COVERAGE
    3. PROGRAMMING PROJECTS
    4. ADDITIONAL MATERIALS
    5. EXERCISES
    6. ACKNOWLEDGMENTS
  3. 1. Introduction
    1. 1.1. OPERATING SYSTEMS
      1. 1.1.1. OPERATING SYSTEMS AS A FIELD OF STUDY
    2. 1.2. A BRIEF HISTORY OF OPERATING SYSTEMS
      1. 1.2.1. THE 1950s: THE BIRTH OF THE CONCEPT
      2. 1.2.2. THE 1960s: THE MODERN OS TAKES FORM
      3. 1.2.3. MINICOMPUTERS AND UNIX
      4. 1.2.4. THE PERSONAL COMPUTER
        1. 1.2.4.1. Hobbyist Computing
        2. 1.2.4.2. Computer Workstations
        3. 1.2.4.3. Microsoft Windows
        4. 1.2.4.4. Unix Continues
    3. 1.3. A SIMPLE OS
      1. 1.3.1. OS STRUCTURE
        1. 1.3.1.1. Traps
        2. 1.3.1.2. System Calls
        3. 1.3.1.3. Interrupts
      2. 1.3.2. PROCESSES, ADDRESS SPACES, AND THREADS
      3. 1.3.3. MANAGING PROCESSES
      4. 1.3.4. LOADING PROGRAMS INTO PROCESSES
      5. 1.3.5. FILES
        1. 1.3.5.1. Naming Files
        2. 1.3.5.2. Using File Descriptors
        3. 1.3.5.3. Random Access
        4. 1.3.5.4. Pipes
        5. 1.3.5.5. Directories
        6. 1.3.5.6. Access Protection
        7. 1.3.5.7. Creating Files
    4. 1.4. BEYOND A SIMPLE OS
      1. 1.4.1. EXTENSIONS
        1. 1.4.1.1. Multithreaded Processes
        2. 1.4.1.2. Virtual Memory
        3. 1.4.1.3. Naming
        4. 1.4.1.4. Object References
        5. 1.4.1.5. Security
      2. 1.4.2. NEW FUNCTIONALITY
        1. 1.4.2.1. Networking
        2. 1.4.2.2. Interactive User Interfaces
        3. 1.4.2.3. Software Complexity
    5. 1.5. CONCLUSIONS
    6. 1.6. EXERCISES
    7. 1.7. REFERENCES
  4. 2. Multithreaded Programming
    1. 2.1. WHY THREADS?
    2. 2.2. PROGRAMMING WITH THREADS
      1. 2.2.1. THREAD CREATION AND TERMINATION
        1. 2.2.1.1. Creating POSIX Threads
        2. 2.2.1.2. Creating Win-32 Threads
        3. 2.2.1.3. Handling Multiple Arguments
        4. 2.2.1.4. Thread Termination
        5. 2.2.1.5. Attributes and Stack Size
        6. 2.2.1.6. Example
      2. 2.2.2. THREADS AND C++
      3. 2.2.3. SYNCHRONIZATION
        1. 2.2.3.1. Mutual Exclusion
        2. 2.2.3.2. Beyond Mutual Exclusion
      4. 2.2.4. THREAD SAFETY
      5. 2.2.5. DEVIATIONS
        1. 2.2.5.1. Unix Signals
        2. 2.2.5.2. POSIX Cancellation
    3. 2.3. CONCLUSIONS
    4. 2.4. EXERCISES
    5. 2.5. REFERENCES
  5. 3. Basic Concepts
    1. 3.1. CONTEXT SWITCHING
      1. 3.1.1. PROCEDURES
        1. 3.1.1.1. Intel x86 Stack Frames
        2. 3.1.1.2. SPARC Stack Frames
      2. 3.1.2. THREADS AND COROUTINES
      3. 3.1.3. SYSTEM CALLS
      4. 3.1.4. INTERRUPTS
    2. 3.2. INPUT/OUTPUT ARCHITECTURES
    3. 3.3. DYNAMIC STORAGE ALLOCATION
      1. 3.3.1. BEST-FIT AND FIRST-FIT ALGORITHMS
      2. 3.3.2. BUDDY SYSTEM
      3. 3.3.3. SLAB ALLOCATION
    4. 3.4. LINKING AND LOADING
      1. 3.4.1. STATIC LINKING AND LOADING
      2. 3.4.2. SHARED LIBRARIES
    5. 3.5. BOOTING
    6. 3.6. CONCLUSIONS
    7. 3.7. EXERCISES
    8. 3.8. REFERENCES
  6. 4. Operating-System Design
    1. 4.1. A SIMPLE SYSTEM
      1. 4.1.1. A FRAMEWORK FOR DEVICES
      2. 4.1.2. LOW-LEVEL KERNEL
        1. 4.1.2.1. Terminals
        2. 4.1.2.2. Network Communication
      3. 4.1.3. PROCESSES AND THREADS
      4. 4.1.4. STORAGE MANAGEMENT
        1. 4.1.4.1. Managing Primary Storage
        2. 4.1.4.2. File Systems
    2. 4.2. RETHINKING OPERATING-SYSTEM STRUCTURE
      1. 4.2.1. VIRTUAL MACHINES
        1. 4.2.1.1. Processor Virtualization
        2. 4.2.1.2. I/O Virtualization
        3. 4.2.1.3. Paravirtualization
      2. 4.2.2. Microkernels
    3. 4.3. CONCLUSIONS
    4. 4.4. EXERCISES
    5. 4.5. REFERENCES
  7. 5. Processor Management
    1. 5.1. THREADS IMPLEMENTATIONS
      1. 5.1.1. STRATEGIES
        1. 5.1.1.1. One-Level Model
        2. 5.1.1.2. Two-Level Model
        3. 5.1.1.3. Scheduler Activations
      2. 5.1.2. A SIMPLE THREADS IMPLEMENTATION
      3. 5.1.3. MULTIPLE PROCESSORS
    2. 5.2. INTERRUPTS
      1. 5.2.1. INTERRUPT HANDLERS
        1. 5.2.1.1. Synchronization and Interrupts
        2. 5.2.1.2. Interrupt Threads
      2. 5.2.2. DEFERRED WORK
      3. 5.2.3. DIRECTED PROCESSING
        1. 5.2.3.1. Asynchronous Procedure Calls
        2. 5.2.3.2. Unix Signals
    3. 5.3. SCHEDULING
      1. 5.3.1. STRATEGY
        1. 5.3.1.1. Simple Batch Systems
        2. 5.3.1.2. Multiprogrammed Batch Systems
        3. 5.3.1.3. Time-Sharing Systems
        4. 5.3.1.4. Shared Servers
        5. 5.3.1.5. Real-Time Systems
      2. 5.3.2. TACTICS
        1. 5.3.2.1. Handoff Scheduling
        2. 5.3.2.2. Preemption Control
        3. 5.3.2.3. Multiprocessor Issues
      3. 5.3.3. CASE STUDIES
        1. 5.3.3.1. Scheduling in Linux
        2. 5.3.3.2. Scheduling in Windows
    4. 5.4. CONCLUSIONS
    5. 5.5. EXERCISES
    6. 5.6. REFERENCES
  8. 6. File Systems
    1. 6.1. THE BASICS OF FILE SYSTEMS
      1. 6.1.1. UNIX'S S5FS
      2. 6.1.2. DISK ARCHITECTURE
        1. 6.1.2.1. The Rhinopias Disk Drive
      3. 6.1.3. PROBLEMS WITH S5FS
      4. 6.1.4. IMPROVING PERFORMANCE
        1. 6.1.4.1. Larger Blocks and Improved Layouts
        2. 6.1.4.2. Aggressive Caching and Optimized Writes
      5. 6.1.5. DYNAMIC INODES
    2. 6.2. CRASH RESILIENCY
      1. 6.2.1. WHAT GOES WRONG
      2. 6.2.2. DEALING WITH CRASHES
        1. 6.2.2.1. Soft Updates
        2. 6.2.2.2. Journaled File Systems
        3. 6.2.2.3. Shadow-Paged File Systems
    3. 6.3. DIRECTORIES AND NAMING
      1. 6.3.1. DIRECTORIES
        1. 6.3.1.1. Hashing
        2. 6.3.1.2. B+ Trees
      2. 6.3.2. NAME-SPACE MANAGEMENT
        1. 6.3.2.1. Multiple Name Spaces
        2. 6.3.2.2. Naming Beyond the File System
    4. 6.4. MULTIPLE DISKS
      1. 6.4.1. REDUNDANT ARRAYS OF INEXPENSIVE DISKS (RAID)
    5. 6.5. FLASH MEMORY
      1. 6.5.1. FLASH TECHNOLOGY
      2. 6.5.2. FLASH-AWARE FILE SYSTEMS
      3. 6.5.3. AUGMENTING DISK STORAGE
    6. 6.6. CASE STUDIES
      1. 6.6.1. FFS
      2. 6.6.2. EXT3
      3. 6.6.3. REISER FS
      4. 6.6.4. NTFS
      5. 6.6.5. WAFL
      6. 6.6.6. ZFS
    7. 6.7. CONCLUSIONS
    8. 6.8. EXERCISES
    9. 6.9. REFERENCES
  9. 7. Memory Management
    1. 7.1. MEMORY MANAGEMENT IN THE EARLY DAYS
    2. 7.2. HARDWARE SUPPORT FOR VIRTUAL MEMORY
      1. 7.2.1. FORWARD-MAPPED PAGE TABLES
      2. 7.2.2. LINEAR PAGE TABLES
      3. 7.2.3. HASHED PAGE TABLES
      4. 7.2.4. TRANSLATION LOOKASIDE BUFFERS
      5. 7.2.5. 64-BIT ISSUES
      6. 7.2.6. VIRTUALIZATION
    3. 7.3. OPERATING-SYSTEM ISSUES
      1. 7.3.1. GENERAL CONCERNS
      2. 7.3.2. REPRESENTATIVE SYSTEMS
        1. 7.3.2.1. Linux
        2. 7.3.2.2. Windows
      3. 7.3.3. COPY ON WRITE AND FORK
      4. 7.3.4. BACKING STORE ISSUES
    4. 7.4. CONCLUSIONS
    5. 7.5. EXERCISES
    6. 7.6. REFERENCES
  10. 8. Security
    1. 8.1. SECURITY GOALS
      1. 8.1.1. THREATS
    2. 8.2. SECURITY ARCHITECTURES
      1. 8.2.1. ACCESS CONTROL IN TRADITIONAL SYSTEMS
      2. 8.2.2. MANDATORY ACCESS CONTROL
      3. 8.2.3. CAPABILITY SYSTEMS
    3. 8.3. CONCLUSIONS
    4. 8.4. EXERCISES
    5. 8.5. REFERENCES
  11. 9. Introduction to Networking
    1. 9.1. NETWORK BASICS
      1. 9.1.1. NETWORK PROTOCOLS
        1. 9.1.1.1. The Internet Protocol (IP)
        2. 9.1.1.2. The Transport Level
    2. 9.2. REMOTE PROCEDURE CALL PROTOCOLS
      1. 9.2.1. MARSHALLING
      2. 9.2.2. RELIABLE SEMANTICS
    3. 9.3. CONCLUSIONS
    4. 9.4. EXERCISES
    5. 9.5. REFERENCES
  12. 10. Distributed File Systems
    1. 10.1. THE BASICS
    2. 10.2. NFS VERSION 2
      1. 10.2.1. RPC SEMANTICS
      2. 10.2.2. MOUNT PROTOCOL
      3. 10.2.3. NFS FILE PROTOCOL
      4. 10.2.4. NETWORK LOCK MANAGER
    3. 10.3. COMMON INTERNET FILE SYSTEM (CIFS)
      1. 10.3.1. SERVER MESSAGE BLOCK (SMB) PROTOCOL
      2. 10.3.2. OPPORTUNISTIC LOCKS
    4. 10.4. DFS
    5. 10.5. NFS VERSION 4
      1. 10.5.1. MANAGING STATE
        1. 10.5.1.1. Mandatory Locks
        2. 10.5.1.2. Maintaining Order
      2. 10.5.2. DEALING WITH FAILURE
    6. 10.6. CONCLUSIONS
    7. 10.7. EXERCISES
    8. 10.8. REFERENCES
  13. A. Index of URLs