Linux Kernel Internals Table of Contents Linux Kernel Internals. 1 Tigran Aivazian tigran@veritas.com. 1Booting.. 2.Process and Interrupt Management 3.Virtual Filesystem (VFS). LBooting 11 Building the Linux Kernel Image L2 Booting Overyiew. L3 Booting:Blos POST 14 Booting:bootsector and setup LILO as a bootloader. dat and code d li and Inter 22 of tas and kemnel threads 、9 nux linked list implementation 20 2 5 Wait Oucues 26 Kemel timer 2 7 Rottom Halve 28 Task Oucues 26 2.9 Tasklets. 27 2 10 Softiras 27 2.11 How System Calls Are Implemented on i386 Architecture2. 27 2.12 Atomic Operations 28 2 13 Spinlocks Read-write Spinlocks and Big-Reader Spinlocks .30 2.14 Semaphores and read/write Semaphores. 32 2.15 Kernel Support for Loading Modules. .33 3.Virtual Filesvstem (VFS).. 3.1 Inode Caches and Interaction with Deache 3.2 Filesystem Registration/Unregistration. 39 3.5 File Descriptor Management.. 1 3.4 Flle Structure Management 3.5 Superblock and Mountpoint Management 3.6 Example virtua Fllesystem:pipefs. ample Disk Filesvste d Binan 1a 52 Table of Contents Linux Kernel Internals.......................................................................................................................................1 Tigran Aivazian tigran@veritas.com.......................................................................................................1 1.Booting..................................................................................................................................................1 2.Process and Interrupt Management.......................................................................................................1 3.Virtual Filesystem (VFS)......................................................................................................................2 1.Booting..................................................................................................................................................2 1.1 Building the Linux Kernel Image......................................................................................................2 1.2 Booting: Overview.............................................................................................................................3 1.3 Booting: BIOS POST.........................................................................................................................3 1.4 Booting: bootsector and setup............................................................................................................4 1.5 Using LILO as a bootloader ..............................................................................................................7 1.6 High level initialisation .....................................................................................................................7 1.7 SMP Bootup on x86...........................................................................................................................9 1.8 Freeing initialisation data and code...................................................................................................9 1.9 Processing kernel command line.....................................................................................................10 2.Process and Interrupt Management.....................................................................................................12 2.1 Task Structure and Process Table....................................................................................................12 2.2 Creation and termination of tasks and kernel threads......................................................................16 2.3 Linux Scheduler...............................................................................................................................18 2.4 Linux linked list implementation.....................................................................................................20 2.5 Wait Queues.....................................................................................................................................22 2.6 Kernel Timers..................................................................................................................................25 2.7 Bottom Halves.................................................................................................................................25 2.8 Task Queues.....................................................................................................................................26 2.9 Tasklets............................................................................................................................................27 2.10 Softirqs...........................................................................................................................................27 2.11 How System Calls Are Implemented on i386 Architecture?.........................................................27 2.12 Atomic Operations.........................................................................................................................28 2.13 Spinlocks, Read−write Spinlocks and Big−Reader Spinlocks......................................................30 2.14 Semaphores and read/write Semaphores.......................................................................................32 2.15 Kernel Support for Loading Modules............................................................................................33 3.Virtual Filesystem (VFS)....................................................................................................................36 3.1 Inode Caches and Interaction with Dcache......................................................................................36 3.2 Filesystem Registration/Unregistration...........................................................................................39 3.3 File Descriptor Management............................................................................................................41 3.4 File Structure Management..............................................................................................................42 3.5 Superblock and Mountpoint Management.......................................................................................45 3.6 Example Virtual Filesystem: pipefs.................................................................................................48 3.7 Example Disk Filesystem: BFS.......................................................................................................50 3.8 Execution Domains and Binary Formats.........................................................................................52 Linux Kernel Internals i