Book description
Avoiding the typical black box approach found in other operating system textbooks, this bestselling book explains how to build an operating system from the ground up. It removes the mystery from operating system design and consolidates the body of material into a systematic discipline.
Table of contents
- Cover Page
- Half Title Page
- Title Page
- Copyright Page
- Dedication
- Contents
- Preface
- About the Author
- Chapter 1 Introduction And Overview
-
Chapter 2 Concurrent Execution And Operating System Services
- 2.1 Introduction
- 2.2 Programming Models For Multiple Activities
- 2.3 Operating System Services
- 2.4 Concurrent Processing Concepts And Terminology
- 2.5 Distinction Between Sequential And Concurrent Programs
- 2.6 Multiple Processes Sharing A Single Piece of Code
- 2.7 Process Exit And Process Termination
- 2.8 Shared Memory, Race Conditions, And Synchronization
- 2.9 Semaphores And Mutual Exclusion
- 2.10 Type Names Used In Xinu
- 2.11 Operating System Debugging With Kputc And Kprintf
- 2.12 Perspective
- 2.13 Summary
- Exercises
-
Chapter 3 An Overview Of The Hardware And Runtime Environment
- 3.1 Introduction
- 3.2 Physical And Logical Organizations of A Platform
- 3.3 Instruction Sets
- 3.4 General-purpose Registers
- 3.5 I/O Buses And The Fetch-Store Paradigm
- 3.6 Direct Memory Access
- 3.7 The Bus Address Space
- 3.8 Bus Startup And Configuration
- 3.9 Calling Conventions And The Runtime Stack
- 3.10 Interrupts And Interrupt Processing
- 3.11 Vectored Interrupts
- 3.12 Exception Vectors And Exception Processing
- 3.13 Clock Hardware
- 3.14 Serial Communication
- 3.15 Polled vs. Interrupt-driven I/O
- 3.16 Storage Layout
- 3.17 Memory Protection
- 3.18 Hardware Details And A System On Chip Architecture
- 3.19 Perspective
- 3.20 Hardware References
- Exercises
-
Chapter 4 List And Queue Manipulation
- 4.1 Introduction
- 4.2 A Unified Structure for Linked Lists of Processes
- 4.3 A Compact List Data Structure
- 4.4 Implementation of the Queue Data Structure
- 4.5 Inline Queue Manipulation Functions
- 4.6 Basic Functions To Extract A Process From A List
- 4.7 FIFO Queue Manipulation
- 4.8 Manipulation of Priority Queues
- 4.9 List Initialization
- 4.10 Perspective
- 4.11 Summary
- Exercises
-
Chapter 5 Scheduling And Context Switching
- 5.1 Introduction
- 5.2 The Process Table
- 5.3 Process States
- 5.4 Ready And Current States
- 5.5 A Scheduling Policy
- 5.6 Implementation Of Scheduling
- 5.7 Deferred Rescheduling
- 5.8 Implementation Of Context Switching
- 5.9 State Saved In Memory
- 5.10 Context Switch Operation
- 5.11 An Address At Which To Restart A Process
- 5.12 Concurrent Execution And A Null Process
- 5.13 Making A Process Ready And The Scheduling Invariant
- 5.14 Other Process Scheduling Algorithms
- 5.15 Perspective
- 5.16 Summary
- Exercises
-
Chapter 6 More Process Management
- 6.1 Introduction
- 6.2 Process Suspension And Resumption
- 6.3 Self–suspension And Information Hiding
- 6.4 The Concept Of A System Call
- 6.5 Interrupt Control With Disable And Restore
- 6.6 A System Call Template
- 6.7 System Call Return Values SYSERR And OK
- 6.8 Implementation of Suspend
- 6.9 Suspending The Current Process
- 6.10 The Value Returned By Suspend
- 6.11 Process Termination And Process Exit
- 6.12 Process Creation
- 6.13 Other Process Manager Functions
- 6.14 Summary
- Exercises
-
Chapter 7 Coordination Of Concurrent Processes
- 7.1 Introduction
- 7.2 The Need for Synchronization
- 7.3 A Conceptual View of Counting Semaphores
- 7.4 Avoidance of Busy Waiting
- 7.5 Semaphore Policy And Process Selection
- 7.6 The Waiting State
- 7.7 Semaphore Data Structures
- 7.8 The Wait System Call
- 7.9 The Signal System Call
- 7.10 Static And Dynamic Semaphore Allocation
- 7.11 Example Implementation of Dynamic Semaphores
- 7.12 Semaphore Deletion
- 7.13 Semaphore Reset
- 7.14 Coordination Across Parallel Processors (Multicore)
- 7.15 Perspective
- 7.16 Summary
- Exercises
- Chapter 8 Message Passing
-
Chapter 9 Basic Memory Management
- 9.1 Introduction
- 9.2 Types of Memory
- 9.3 Definition of A Heavyweight Process
- 9.4 Memory Management In Our Example System
- 9.5 Program Segments And Regions of Memory
- 9.6 Dynamic Memory Allocation
- 9.7 Design Of The Low–level Memory Manager
- 9.8 Allocation Strategy And Memory Persistence
- 9.9 Keeping Track of Free Memory
- 9.10 Implementation Of Low–level Memory Management
- 9.11 Data Structure Definitions Used With Free Memory
- 9.12 Allocating Heap Storage
- 9.13 Allocating Stack Storage
- 9.14 Releasing Heap And Stack Storage
- 9.15 Perspective
- 9.16 Summary
- Exercises
-
Chapter 10 High-level Memory Management And Virtual Memory
- 10.1 Introduction
- 10.2 Partitioned Space Allocation
- 10.3 Buffer Pools
- 10.4 Allocating A Buffer
- 10.5 Returning Buffers To the Buffer Pool
- 10.6 Creating A Buffer Pool
- 10.7 Initializing the Buffer Pool Table
- 10.8 Virtual Memory And Memory Multiplexing
- 10.9 Real And Virtual Address Spaces
- 10.10 Hardware for Demand Paging
- 10.11 Address Translation With A Page Table
- 10.12 Metadata In A Page Table Entry
- 10.13 Demand Paging And Design Questions
- 10.14 Page Replacement And Global Clock
- 10.15 Perspective
- 10.16 Summary
- Exercises
- Chapter 11 High-level Message Passing
-
Chapter 12 Interrupt Processing
- 12.1 Introduction
- 12.2 The Advantage of Interrupts
- 12.3 Interrupt Processing
- 12.4 Vectored Interrupts
- 12.5 Integration of Interrupts and Exceptions
- 12.6 ARM Exception Vectors Using Code
- 12.7 Assignment Of Device Interrupt Vector Numbers
- 12.8 Interrupt Dispatching
- 12.9 The Structure Of Interrupt Software
- 12.10 Disabling Interrupts
- 12.11 Constraints On Functions That Interrupt Code Invokes
- 12.12 The Need To Reschedule During An Interrupt
- 12.13 Rescheduling During An Interrupt
- 12.14 Perspective
- 12.15 Summary
- Exercises
-
Chapter 13 Real-time Clock Management
- 13.1 Introduction
- 13.2 Timed Events
- 13.3 Real-time Clocks And Timer Hardware
- 13.4 Handling Real-time Clock Interrupts
- 13.5 Delay And Preemption
- 13.6 Implementation Of Preemption
- 13.7 Efficient Management of Delay With A Delta List
- 13.8 Delta List Implementation
- 13.9 Putting A Process To Sleep
- 13.10 Timed Message Reception
- 13.11 Awakening Sleeping Processes
- 13.12 Clock Interrupt Processing
- 13.13 Clock Initialization
- 13.14 Perspective
- 13.15 Summary
- Exercises
-
Chapter 14 Device–independent Input and Output
- 14.1 Introduction
- 14.2 Conceptual Organization of I/O and Device Drivers
- 14.3 Interface and Driver Abstractions
- 14.4 An Example I/O Interface
- 14.5 The Open-Read-Write-Close Paradigm
- 14.6 Bindings For I/O Operations And Device Names
- 14.7 Device Names In Xinu
- 14.8 The Concept Of A Device Switch Table
- 14.9 Multiple Copies Of A Device And Shared Drivers
- 14.10 The Implementation Of High–level I/O Operations
- 14.11 Other High–level I/O Functions
- 14.12 Open, Close, And Reference Counting
- 14.13 Null And Error Entries In Devtab
- 14.14 Initialization Of The I/O System
- 14.15 Perspective
- 14.16 Summary
- Exercises
-
Chapter 15 An Example Device Driver
- 15.1 Introduction
- 15.2 Serial Communication Using UART Hardware
- 15.3 The Tty Abstraction
- 15.4 Organization Of A Tty Device Driver
- 15.5 Request Queues And Buffers
- 15.6 Synchronization Of Upper Half And Lower Half
- 15.7 UART Hardware FIFOs And Driver Design
- 15.8 The Concept Of A Control Block
- 15.9 Tty Control Block And Data Declarations
- 15.10 Minor Device Numbers
- 15.11 Upper–half Tty Character Input (ttygetc)
- 15.12 Upper–half Tty Read Function (ttyread)
- 15.13 Upper–half Tty Character Output (ttyputc)
- 15.14 Starting Output (ttykickout)
- 15.15 Upper–half Tty Multiple Character Output (ttywrite)
- 15.16 Lower–half Tty Driver Function (ttyhandler)
- 15.17 Output Interrupt Processing (ttyhandle_out)
- 15.18 Tty Input Processing (ttyhandle_in)
- 15.19 Tty Control Block Initialization (ttyinit)
- 15.20 Device Driver Control (ttycontrol)
- 15.21 Perspective
- 15.22 Summary
- Exercises
-
Chapter 16 DMA Devices And Drivers (Ethernet)
- 16.1 Introduction
- 16.2 Direct Memory Access And Buffers
- 16.3 Multiple Buffers And Rings
- 16.4 An Example Ethernet Driver Using DMA
- 16.5 Device Hardware Definitions and Constants
- 16.6 Rings And Buffers In Memory
- 16.7 Definitions Of An Ethernet Control Block
- 16.8 Device And Driver Initialization
- 16.9 Reading From An Ethernet Device
- 16.10 Writing To An Ethernet Device
- 16.11 Handling Interrupts From An Ethernet Device
- 16.12 Ethernet Control Functions
- 16.13 Perspective
- 16.14 Summary
- Exercises
-
Chapter 17 A Minimal Internet Protocol Stack
- 17.1 Introduction
- 17.2 Required Functionality
- 17.3 Simultaneous Conversations, Timeouts, And Processes
- 17.4 A Consequence Of The Design
- 17.5 ARP Functions
- 17.6 Definition Of A Network Packet
- 17.7 The Network Input Process
- 17.8 Definitions For IP
- 17.9 IP Functions
- 17.10 Definition Of The UDP Table
- 17.11 UDP Functions
- 17.12 Internet Control Message Protocol
- 17.13 Dynamic Host Configuration Protocol
- 17.14 Perspective
- 17.15 Summary
- Exercises
-
Chapter 18 A Remote Disk Driver
- 18.1 Introduction
- 18.2 The Disk Abstraction
- 18.3 Operations A Disk Driver Supports
- 18.4 Block Transfer And High-level VO Functions
- 18.5 A Remote Disk Paradigm
- 18.6 The Important Concept Of Caching
- 18.7 Semantics Of Disk Operations
- 18.8 Definition Of Driver Data Structures
- 18.9 Driver Initialization (rdsinit)
- 18.10 The Upper-half Open Function (rdsopen)
- 18.11 The Remote Communication Function (rdscomm)
- 18.12 The Upper-half Write Function (rdswrite)
- 18.13 The Upper-half Read Function (rdsread)
- 18.14 Flushing Pending Requests
- 18.15 The Upper-half Control Function (rdscontrol)
- 18.16 Allocating A Disk Buffer (rdsbufalloc)
- 18.17 The Upper-half Close Function (rdsclose)
- 18.18 The Lower-half Communication Process (rdsprocess)
- 18.19 Perspective
- 18.20 Summary
- Exercises
-
Chapter 19 File Systems
- 19.1 What Is A File System?
- 19.2 An Example Set Of File Operations
- 19.3 Design Of A Local File System
- 19.4 Data Structures For The Xinu File System
- 19.5 Implementation Of The Index Manager
- 19.6 Clearing An Index Block (Ifibclear)
- 19.7 Retrieving An Index Block (lfibget)
- 19.8 Storing An Index Block (lfibput)
- 19.9 Allocating An Index Block From The Free List (lfiballoc)
- 19.10 Allocating A Data Block From The Free List (lfdballoc)
- 19.11 Using The Device-Independent I/O Functions For Files
- 19.12 File System Device Configuration And Function Names
- 19.13 The Local File System Open Function (lfsopen)
- 19.14 Closing A File Pseudo-Device (lflclose)
- 19.15 Flushing Data To Disk (lfflush)
- 19.16 Bulk Transfer Functions For A File (lflwrite, lflread)
- 19.17 Seeking To A New Position In the File (lflseek)
- 19.18 Extracting One Byte From A File (lflgetc)
- 19.19 Changing One Byte In A File (lflputc)
- 19.20 Loading An Index Block And A Data Block (lfsetup)
- 19.21 Master File System Device Initialization (lfsinit)
- 19.22 Pseudo-Device Initialization (lflinit)
- 19.23 File Truncation (lftruncate)
- 19.24 Initial File System Creation (lfscreate)
- 19.25 Perspective
- 19.26 Summary
- Exercises
-
Chapter Chapter 20 A Remote File Mechanism
- 20.1 Introduction
- 20.2 Remote File Access
- 20.3 Remote File Semantics
- 20.4 Remote File Design And Messages
- 20.5 Remote File Server Communication (rfscomm)
- 20.6 Sending A Basic Message (rfsndmsg)
- 20.7 Network Byte Order
- 20.8 A Remote File System Using A Device Paradigm
- 20.9 Opening A Remote File (rfsopen)
- 20.10 Checking The File Mode (rfsgetmode)
- 20.11 Closing A Remote File (rflclose)
- 20.12 Reading From A Remote File (rflread)
- 20.13 Writing To A Remote File (rflwrite)
- 20.14 Seeking On A Remote File (rflseek)
- 20.15 Character I/O On A Remote File (rflgetc, rflputc)
- 20.16 Remote File System Control Functions (rfscontrol)
- 20.17 Initializing The Remote File System (rfsinit, rflinit)
- 20.18 Perspective
- 20.19 Summary
- Exercises
-
Chapter Chapter 21 A Syntactic Namespace
- 21.1 Introduction
- 21.2 Transparency And A Namespace Abstraction
- 21.3 Myriad Naming Schemes
- 21.4 Naming System Design Alternatives
- 21.5 Thinking About Names Syntactically
- 21.6 Patterns And Replacements
- 21.7 Prefix Patterns
- 21.8 Implementation Of A Namespace
- 21.9 Namespace Data Structures And Constants
- 21.10 Adding Mappings To The Namespace Prefix Table
- 21.11 Mapping Names With The Prefix Table
- 21.12 Opening A Named File
- 21.13 Namespace Initialization
- 21.14 Ordering Entries In The Prefix Table
- 21.15 Choosing A Logical Namespace
- 21.16 A Default Hierarchy And The Null Prefix
- 21.17 Additional Object Manipulation Functions
- 21.18 Advantages And Limits Of The Namespace Approach
- 21.19 Generalized Patterns
- 21.20 Perspective
- 21.21 Summary
- Exercises
- Chapter 22 System Initialization
-
Chapter 23 Subsystem Initialization And Memory Marking
- 23.1 Introduction
- 23.2 Self-initializing Modules
- 23.3 Self-initializing Modules In A Concurrent System
- 23.4 Self-initialization In The Presence Of Reboot
- 23.5 Initialization Using Accession Numbers
- 23.6 A Generalized Memory Marking Scheme
- 23.7 Data Declarations For The Memory Marking System
- 23.8 Implementation Of Marking
- 23.9 Perspective
- 23.10 Summary
- Exercises
-
Chapter 24 Exception Handling
- 24.1 Introduction
- 24.2 Terminology: Faults, Checks, Traps, And Exceptions
- 24.3 Vectored Exceptions And Maskable Interrupts
- 24.4 Types Of Exceptions
- 24.5 Handling Exceptions
- 24.6 Exception Vector Initialization
- 24.7 Panic In The Face Of Catastrophic Problems
- 24.8 Implementation Of Panic
- 24.9 Perspective
- 24.10 Summary
- Exercises
- Chapter 25 System Configuration
-
Chapter 26 An Example User Interface: The Xinu Shell
- 26.1 Introduction
- 26.2 What Is A User Interface?
- 26.3 Commands And Design Principles
- 26.4 Design Decisions For A Simplified Shell
- 26.5 Shell Organization And Operation
- 26.6 The Definition Of Lexical Tokens
- 26.7 The Definition Of Command-Line Syntax
- 26.8 Implementation Of The Xinu Shell
- 26.9 Storage Of Tokens
- 26.10 Code For The Lexical Analyzer
- 26.11 The Heart Of The Command Interpreter
- 26.12 Command Name Lookup And Builtin Processing
- 26.13 Arguments Passed To Commands
- 26.14 Passing Arguments To A Non-builtin Command
- 26.15 I/O Redirection
- 26.16 An Example Command Function (sleep)
- 26.17 Perspective
- 26.18 Summary
- Exercises
-
Chapter Appendix 1: Porting An Operating System
- A1.1 Introduction
- A1.2 Motivation: Evolving Hardware
-
A1.3 Steps Taken When Porting An Operating System
- A1.3.1 Learning About The Hardware
- A1.3.2 Build Cross-Development Tools
- A1.3.3 Learn The Compiler's Calling Conventions
- A1.3.4 Build A Bootstrap Mechanism
- A1.3.5 Devise A Basic Polled Output Function
- A1.3.6 Load And Run A Sequential Program
- A1.3.7 Port And Test The Basic Memory Manager
- A1.3.8 Port The Context Switch And Process Creation Functions
- A1.3.9 Port And Test The Remaining Process Manager Functions
- A1.3.10 Build An Interrupt Dispatcher
- A1.3.11 Port And Test The Real-Time Clock Functions
- A1.3.12 Port And Test A Tty Driver
- A1.3.13 Port Or Create Drivers For An Ethernet And Other Devices
- A1.3.14 Port The Network Stack, Including Internet Protocols
- A1.3.15 Port The Remote Disk And RAM Disk Modules
- A1.3.16 Port The Local And Remote File System Modules
- A1.3.17 Port The Xinu Shell And Other Applications
- A1.4 Programming To Accommodate Change
- A1.5 Summary
- Chapter Appendix 2: Xinu Design Notes
- Index
Product information
- Title: Operating System Design, 2nd Edition
- Author(s):
- Release date: February 2015
- Publisher(s): Chapman and Hall/CRC
- ISBN: 9781003803768
You might also like
book
Operating System Design
Operating System Design: The Xinu Approach, Linksys Version provides a comprehensive introduction to Operating System Design, …
book
Operating System Concepts, 9th Edition
, now in its ninth edition, continues to provide a solid theoretical foundation for understanding operating …
book
Operating System Concepts, 8th Edition
Keep pace with the fast-developing world of operating systems Open-source operating systems, virtual machines, and clustered …
book
Computer Architecture, 5th Edition
Computer Architecture: A Quantitative Approach, Fifth Edition, explores the ways that software and technology in the …