Weenix
Brown University Department of Computer Science
Authored by Operating Systems Teaching Assistant Sta
Edited by Dan Kimmel and J. Rassi
September 22, 2015
1.1 Motivation
1.2 How to Read This Book
1.3 History
1.4 Acknowledgements
2.1 Introduction
2.2 Preparing Weenix Assignments
2.2.1 Quick Start: Getting Weenix Running
2.2.2 Getting the Source
2.2.3 Dependencies
2.2.4 Conguration
2.2.5 Blanking Solutions
2.3 Implementing Weenix Assignments
2.3.1 A Message to the Reader
2.3.2 Build System
2.3.3 Assignment Specication
2.3.4 Running
2.3.5 Making Changes
3.1 Introduction
3.2 Kernel Memory Management
3.3 Boot Sequence
3.4 Processes and Threads
3.5 Scheduler
3.6 Synchronization Primitives
3.7 Testing
4.1 Introduction
4.2 Object-Oriented C
4.3 TTY Device
4.3.1 Line Discipline
4.3.2 TTY Driver
4.4 Disk Device Driver
4.5 Memory Devices
4.6 Testing
5.1 Introduction
5.1.1 Constructors
5.1.2 Virtual Functions
5.1.3 Overview
5.1.4 Getting Started
5.2 The ramfs File System
5.3 Pathname to vnode Conversion
5.4 Opening Files
5.5 System Calls
5.6 Testing
6.1 Introduction
6.2 Disk Layout
6.2.1 Superblock
6.2.2 Inodes
6.2.3 Data Blocks
6.2.4 Directories
6.3 Caching
6.3.1 Page Frame States
6.3.2 Lazy Cleaning
6.4 Error Handling
6.5 Getting Started
6.6 Testing
7.1 Introduction
7.2 Virtual Memory Maps
7.3 Page Fault Handler
7.3.1 The Memory Management Unit
7.4 Memory Management
7.4.1 Anonymous Objects
7.4.2 Shadow Objects
7.5 System Calls
7.5.1 Kernel System Call Interface
7.5.2 Accessing User Memory
7.5.3 Running Userland Programs
7.5.4 VM-Related System Calls
7.6 fork()
7.7 Odds and Ends
7.8 Testing
7.8.1 Userland Tests
7.8.2 A Relatively Dicult Test Suite
7.8.3 Dynamic Linking
7.9 Conclusion
A.1 Realistic projects
A.1.1 Multithreaded processes
A.1.2 Current working directory
A.1.3 File system mounting
A.1.4 Userspace preemption
A.1.5 Pipes and synchronous multiplexing
A.1.6 Asynchronous disk driver
A.1.7 Better scheduling
A.2 Possible long-term projects
A.2.1 Multi-core/processor support
A.2.2 Users
A.2.3 Signals
A.3 \Abandon all hope, ye who enter here"
A.3.1 Networking stack
A.3.2 X window system
A.3.3 64-bit support
A.3.4 Kernel preemption
B.1 Version Control with git
B.2 Taking notes
B.3 Text Editors and IDEs
B.3.1 Integration with cscope
B.4 Debugging with gdb
C.1 Beginning Debugging
C.1.1 Printing
C.1.2 Printing Using Info Functions
C.1.3 Using Assertions
C.2 Intermediate Debugging
C.2.1 Prerequisites
C.2.2 Debugging Multiple Threads
C.2.3 Using the Weenix gdb Scripts
C.2.4 Disassembling a Program
C.2.5 Using the QEMU monitor
C.3 Advanced Debugging Techniques
C.3.1 Debugging a Page Fault
C.3.2 Debugging processes from the kernel debugger
C.3.3 gdb and DYNAMIC