The Magic Garden Explained

The Internals of UNIX® System V Release 4

Berny Goodheart, James Cox

Publisher: Prentice Hall, 1994, 664 pages

ISBN: 0-13-098138-9

Keywords: Operating Systems

Last modified: March 13, 2022, 11:06 a.m.

This book is the first book of its nature to be fully approved by Novell Inc, UNIX System Group (formerly AT&T UNIX System Laboratories, Inc). It is the ultimate, authoritative reference on the subject of UNIX System V Release 4 Internals. In one source, it provides a detailed, comprehensive, technically oriented description of how the UNIX System V Release 4 core operating system functions.

It is probably the most comprehensive tool ever to be made available for UNIX programmers, device driver writers, administrators, support engineers, advanced application designers and those involved in porting the UNIX system. With exercises at the end of each chapter and a case study throughout, illustrating general OS principles, the book will also appeal to people learning about or simply interested in UNIX.

  • Part 1: Overview
    1. Background and History
      1. Genealogical history of UNIX
        1. Before UNIX
        2. The Epoch
        3. First edition
        4. Research UNIX
        5. The first port of UNIX
        6. Seventh Edition
        7. Berkeley UNIX (BSD)
        8. AT&T UNIX System III & Microsoft XENIX
        9. AT&T UNIX System V
        10. AT&T UNIX System V Release 2
        11. AT&T UNIX System V Release 3
      2. Politics and the battle for standards
        1. The user's dilemma
        2. SVID
        3. POSIX
        4. X/Open
      3. AT&T UNIX System V Release 4
        1. UNIX International
        2. Univel UnixWare
        3. Novell UNIX System V Release 4
        4. Summary
    2. Concepts and Facilities
      1. Introduction
      2. Philosophy
        1. The user interface
        2. The user's credentials
        3. The privileged user
        4. User programs and commands
      3. The UNIX kernel
        1. Kernel software organization
        2. Kernel source code organization
      4. The UNIX file systems
        1. File system structure
        2. Mountable file systems
        3. Storage devices for file systems
        4. File system interface
        5. File system types
      5. Files
        1. Regular files
        2. Directories
        3. Special files
        4. Links
        5. Symbolic links
        6. Named pipes
        7. Memory mapped files
        8. File removal
        9. File names
      6. Descriptor management
        1. File and record locking
      7. I/O redirection
      8. Resource limitations
      9. Quotas
      10. Security
        1. Process execution rights
        2. File protection
      11. Devices
        1. Device drivers
        2. User process process interface
      12. System initialization
      13. Networking & communication services
        1. STREAMS
        2. TCP/IP
        3. Transport level interface (TLI)
        4. Remote procedure call (RPC)
        5. External data representation (XDR)
        6. Sockets
        7. STREAMS-based pipes
        8. UUCP
      14. File sharing
        1. Networked file system (NFS)
        2. Remote file sharing (RFS)
      15. User access
        1. Service access facility (SAF)
      16. Extended Fundamental Types (EFT)
      17. Exercises
  • Part 2: UNIX Internals
    1. Memory Management Subsystem
      1. Introduction to the memory subsystem
        1. Virtual memory
        2. Structure of a pages
        3. Associative memory cache
      2. Demand paging
        1. Page stealing
      3. Segmentation and regions
      4. The hardware independent layer
        1. Structure of physical memory
        2. Initializing the page system
        3. The page structure
        4. Page list management
        5. vnode pages
        6. Anonymous pages
        7. The as structure
        8. The seg structure
        9. The segvn_data structure
        10. The anon structure
      5. Paging system procedures
      6. Hardware dependent layer
        1. Segment operations
        2. HAT layer data structures
        3. HAT layer support functions
      7. Demand paging
        1. Exception handling
        2. Low-level routines
        3. The pagefault() function
        4. The utlbmiss function
        5. Page fault examples
      8. Page out and swapping
        1. Page stealing variables
        2. The pageout process
        3. The swapper process
        4. Swap space management
      9. Non-paged memory allocation
        1. Memory allocation strategies
        2. kmem_alloc() and kmem_free()
        3. kmem_fast_alloc() and kmem_fast_freee()
        4. rmalloc() and rmfree()
      10. Memory related system calls
        1. Stack growth, brk and sbrk
      11. Exercises
    2. Process Management Subsystem
      1. Introduction to the process management subsystem
        1. Concurrency
        2. Flow of execution
      2. The process image
        1. Format of an executable on disk
        2. Process memory model
        3. Context of a process
        4. The user-area
        5. Process image in user address space
        6. Process image in system address space
        7. Processor registers
      3. The structure of a process
        1. The user structure
        2. The proc structure
      4. Process states
        1. Functional state
        2. Execution state
      5. Context switching
      6. Process scheduling
        1. Priority classes
        2. Process time-slice
        3. Priority class independent variables
        4. Priority dispatch queues
        5. Priority class independent functions
        6. Priority class groups
        7. Priority class dispatch parameter tables
        8. System-class
        9. Real-time class
        10. Time-shared class
        11. Class dependent interface
        12. Class dependent functions
        13. Sleeping processes
        14. Algorithm sleep()
        15. Stopped processes
        16. Algorithm wakeprocs()
        17. Algorithm setrun()
      7. User-level context switching
      8. The system clock
        1. Clock interrupt service routine
        2. Priming the clock
        3. Callout tables
        4. Alarm calls
        5. Process execution-time statistics
        6. System-wide statistics
        7. System-wide process accounting
        8. Enforcing CPU resource limits
        9. Profiling
        10. Keeping time
        11. High resolution interval timers
      9. Process execution modes
        1. Transferring to kernel-mode
        2. Interrupt, trap and exception handling
        3. Saving and restoring the environment
        4. System call traps
        5. The sysent[] table
        6. Exception traps
        7. Interrupts
        8. Returning to user-mode in systrap()
        9. longjmp() and setjmp()
      10. Signals
        1. Signal posting
        2. Algorithm sigtoproc()
        3. Handling signals
        4. System calls for signals
        5. Algorithm ssig()
        6. Getting signal information
        7. Execution erros and signals
        8. Signal processing
        9. Algorithm psig()
        10. System calls for posting signals
      11. User, process, process group and session relationships
        1. Parents, children and siblings
        2. Process identification (PID)
        3. Process groups and job control
        4. Sessions
        5. Process credentials
      12. Process creation
        1. Algorithm fork()
        2. Algorithm newproc()
      13. Program execution
        1. Algorithm exece()
        2. Program flow of execution
        3. Dumping core
        4. Algorithm core()
      14. Shared libraries
        1. Statically-linked-libraries
        2. Statically-linked-shared-libraries
        3. Dynamically-linked-shared-libraries
      15. Process termination
        1. Transition phases of process termination
        2. Algorithm exit()
        3. Waiting for a process
        4. Algorithm waitid()
        5. Algorithm freeproc()
      16. Process suspension
      17. System operation
        1. System initalization
        2. System shutdown and reboot
      18. Exercises
    3. I/O Subsystem
      1. Introduction
      2. The new buffer cache
        1. Overview of the new buffer cache
        2. New buffer cache data structures
        3. Functions in the new buffer cache
      3. The old buffer cache
        1. Overview of the old buffer cache
        2. Old buffer cache data structures
        3. Buffer allocation and freeing
        4. Buffer mapping: bmap() operations
        5. Reading and writing buffers
      4. File I/O support functions
        1. Page I/O low level functions
      5. Read and write file I/O
        1. Data structure for read and write
        2. The read and write system calls
        3. The readv and writev system calls
      6. Device drivers
        1. Special files
        2. Driver functions
        3. Device driver data structures
        4. Device driver open function
        5. Device driver close function
        6. Device driver interrupt service routine
      7. Block device drivers
        1. Device driver strategy function
        2. Block device read and write functions
        3. Raw disk I/O
        4. The physiock() function
      8. Character device drivers
        1. Character device read and write functions
        2. Device driver ioctl function
        3. Character device poll function
      9. The mmap system call
        1. Block device and regular file mmap
        2. Character device mmap function
      10. Example character driver: mm
      11. The Device Driver Interface and Driver Kernel Interface
        1. DDI/DKI section 2
        2. DDI/DKI section 3
        3. DDI/DKI section 4
      12. Exercises
    4. File Management Subsystem
      1. Introduction to the file management subsystem
      2. Associating with a file
        1. The process open file table
        2. The system open file table
        3. File allocation operations
        4. File descriptor allocation
        5. File desciptors inherited from the parent
        6. The open and creat system calls
      3. The file system independent vnode
        1. Allocating a vnode
        2. vnode operations
        3. File system type dependent vnodeops functions
      4. File and record locking
        1. Advisory locking
        2. File and record locking in the vnode
        3. Mandatory locking
        4. Lock resource and accounting
      5. The virtual file system
        1. Virtual file system switch table (VFSSW)
        2. File system type dependent VFS operations
      6. The UNIX file system hierarchy
        1. Mountable file systems
        2. The system's VFS mount list
        3. The vnodes association with the vfs structure
        4. The mount and umount system calls
      7. The directory name lookup cache
      8. Pathname resolution
        1. The pathname data structure
        2. Pathname resolving functions
      9. The special file system (specfs)
        1. The shadow-special-vnode (snode)
        2. The fifo file system (fifofs)
      10. Concept of the inode
        1. Layout of the file and inode on disk
      11. The /proc file system (procfs)
        1. /proc implementation
      12. Exercises
  • Part 3: Additional Facilities
    1. STREAMS
      1. Introduction
      2. STREAMS data structures
        1. STREAMS messages (msgbs)
        2. STREAMS queue structures
        3. The module structures
        4. Initialization of module data structures
      3. STREAMS modules
        1. Open procedures
        2. Put procedures
        3. Service procedures
        4. Message processing
        5. Processing ioctl
        6. Flush handling
        7. Close procedures
      4. STREAMS drivers
        1. Configuration and linking
        2. Criver open
        3. Driver close
        4. Driver input
        5. Driver output
      5. Multiplexors
        1. Building the multiplexor
        2. Multiplexor data structures
        3. Multiplexor open
        4. Multiplexor write side
        5. Multiplexor read side
        6. Multiplexor close
      6. STREAMS utility functions
        1. STREAMS memory allocation functions
        2. Queue manipulation functions
        3. Flow-control functions
      7. STREAMS memory management
        1. allocb() and esballoc()
        2. Comparison of old and new allocation schemes
      8. STREAMS scheduling and flow-control implementation
        1. Flow-control variables
        2. Flow-control procedures
        3. The STREAMS scheduler
      9. Operation of the stream head
        1. Stream head data structures
        2. Limiting STREAMS memory
        3. Opening a stream
        4. Opening a clone device
        5. Writing to a stream
        6. Reading from a stream
        7. Stream ioctl
        8. putmsg and getmsg
        9. Polling a stream
        10. The Strinfo array
        11. qattach() and qdetach()
      10. STREAMS-based pipes and FIFOs
        1. FIFO operations
        2. Pipe operations
      11. STREAMS terminals
        1. Using ldterm
        2. Job control
        3. The straccess() function
      12. Implementation of ldterm
        1. Data structures in ldterm
        2. ldterm read side
        3. ldterm write side
        4. ldterm ioctl
        5. Character input
        6. Special character I/O
        7. Flow-control
        8. VMIN & VTIME input
      13. Other terminal issues
        1. Pseudo terminals
        2. Intelligent controllers
      14. STREAMS networking support
        1. Transport service interface
        2. Socket interface
        3. Transport layer interface
      15. Exercises
    2. Interprocess Communication
      1. Introduction to interprocess communication
        1. IPC operation permissions
      2. Semaphores
        1. Semaphore initalization and control
        2. Using semaphores
      3. The implementation of semaphores
        1. Semaphore support functions
        2. Semaphore initialization
        3. Semaphore allocation
        4. Semaphore operations
        5. Semaphore undo
      4. Message queues
        1. Message initialization and control
        2. Using messages
      5. The implementation of message queues
        1. Message initialization
        2. Message allocation
        3. Message operations
      6. Shared memory
        1. Shared memory data structures
        2. Using shared memory
      7. The implementation of shared memory
        1. Initialization and control of shared memeory
        2. Attaching shared memory
        3. Detaching shared memory
      8. Exercises
    3. Crash
      1. Introduction to crash
      2. Getting started
      3. Symbols
      4. Processes
        1. The proc command
        2. Hints for the proc command
        3. The u command
        4. Hints for the u command
        5. The as command
      5. Kernel stack
        1. C Language stack
        2. The kernel stack layout
        3. Kernel stack commands
        4. Kernel stack hints
      6. Files
        1. The file command
        2. Examining vnodes
        3. Examining inodes
        4. Mounted file systems
      7. Memory
        1. Memory configurations commands
        2. Virtual memory commands
        3. The map command
        4. Memory hints
      8. STREAMS
        1. STREAMS memory
        2. Queues and streams
        3. STREAMS terminals
        4. STREAMS hints
      9. Miscellaneous commands
  • Appendix A: System call error codes
  • Appendix B: filock structure
  • Appendix C: siginfo structure
  • Appendix D: strevent structure
  • Appendix E: Streams D3DK functions
  • Appendix F: Crash command
  • Appendix G: IEEE POSIX Suite

Reviews

The Magic Garden Explained

Reviewed by Roland Buresund

Outstanding ********* (9 out of 10)

Last modified: May 21, 2007, 2:47 a.m.

A brilliant book, that disappeared because of Linux growing popularity. Still an excellent resource and teaching aid.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required