Creative Commons CC-BY-ND 4.0  license  
		  
 Please contact me  for translating the book into other languages. 
  
|  |   | 
Homeworks/Lab Assignments:
| Easy | Hard | |
| A1 | Link | Link | 
| A2 | Link | Link | 
| A3 | Link | Link | 
Guide to Linux kernel hacking by Abhishek Safui.
Lectures and Slides:
| Chapter | Topics | Details | 
| 1 | Introduction | What is an OS? Overview of the Linux kernel's codebase Overview of the book  | 
| 2 | Basics of Computer Architecture | 1. Privileged and non-privileged registers; system calls, exceptions and inerrupts; context switching  | 
| 2. Timer chips and basic x86 assembly  | ||
| 3. x86 memory addressing, compiling, linking and loading  | ||
| 4. Virtual memory and paging  | ||
| 5. Segmentation and I/O  | ||
| 3 | Processes | 1. Process states  | 
| 2. Kernel stack + process priorities  | ||
| 3. mm_struct, B+ tree, maple tree, anonymous and file-backed virtual memory   | ||
| 4. Pids and namespaces  | ||
| 5. Creating and destroying processes   | ||
| 6. Overview of the Context Switch Process   | ||
| 7. Details of the Context Switch Process   | ||
| 4 | Communication: System Calls, Interrupts and Signals | 1. The path followed by a library call, implementation of a sys. call handler.  | 
| 2. x86 interrupt architecture. Kernel-level data structures for internal handling.  | ||
| 3. Exceptions, softirqs, threaded IRQs and work queues  | ||
| 4. Signal handling  | ||
| 5 | Synchronization and Scheduling | 1. Basic pthreads example  ex1 Pthreads with locks ex2 [Lec] Basics of pthreads and locks  | 
| 2. Theory of memory models and non-blocking algorithms Consistency models  | ||
| 3. Reader-writer locks and queues, C files: wfq.c  | ||
| 4. Different kinds of concurrent queues: wfbusylock.c, wfsem, wfsem-ii, reader-write-lock  | ||
| 5.  Concurrency in the kernel  | ||
| 6. The read-copy-update (RCU) mechanism   | ||
| 7. Generic problem of scheduling, KSW model, common algorithms, NP-complete problems   | ||
| 8.Multiprocessor scheduling: bin packing and partition, list scheduling, Banker's algorithm   | ||
| 9. Linux schedulers: CFS scheduler   | ||
| 10. Real-time schedulers: EDF, RMS and DMS  | ||
| 11. Real-time resource allocation: PIP, HLP and PCP  | ||
| 6 | Memory System | 1. Traditional heuristics for page allocation: OPT, FIFO, LRU, Stack property  | 
| 2. Organization of the kernel's virtual and physical memory space  | ||
| 3. Reverse mapping  | ||
| 4. MGLRU algorithm  | ||
| 5. Kernel memory allocation  | ||
| References | ||
| Static and dynamic linking | Static and dynamic linking Links: link1, link2, link3 [very detailed] | |
| Processes and related data structures | pids, namespaces, pid structure, radix trees, and bitmaps  | |
| Interrupt handling and signals | IRQs, LAPIC, I/O APIC, IRQ domains, the irq_desc data structure link | |
| Spin locks and Mutexes | Additional reference: pointer to the paper on ticket locks and MCS locks [Paper] Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors John M. Mellor-Crummey, Michael L. Scott, ACM TOCS, 1991 [link] | |
| Introduction to Scheduling |  Youtube video | |
| Real Time Systems | EDF RMS [Paper] The Rate Monotonic Scheduling Algorithm: Event Characterization and Average Case Behavior, Lehoczky, Sha, and Ding. IEEE Real Time Systems Symposium, 1989DMS [Paper] Deadline Monotonic Scheduling, Audsley, 1990 | |
| Security | Code for the buffer overflow attack: link Linux page directory and page access | |
| I/O Systems: Introduction | I/O Protocols  Youtube Video | |
| Storage devices | ||
| Kernel memory allocators |  Youtube Video  Slab, Slub, and Buddy allocation | |