Linux Internals

(to the power of -1)

Simone Demblon

Sebastian Spitzner

Legal Notice

2005-01-25 22:21:13

Revision History
Revision 0.0.1 01/NOV/2004
Initial version

Table of Contents

1. Introduction and History
Course Objectives
Introducing the other influence in this course
History
1955
1966
1969 to 1970
Assembler/ compilers / hardware architecture
1971 - 1973
1973 - 1974
1974 - 1975
1976 - 1978
1979
1980
1977 to 1983
1989
1992 to 1998
This is the story of Linux
An Introduction to Linux
The story of BSD
1994 1.0 release
The Operations of a Unix/Linux System
In Libraries Level
Kernel
Memory
2. Booting
What the kernel does when it starts up
Booting
Switch On
3. Logging in
Reading the Man pages - A review
init
RUNLEVELS
BOOTING
CHANGING RUNLEVELS
TELINIT(Older technology look at "init q")
BOOTFLAGS
INTERFACE
SIGNALS
Run Level versus programs
Default run level to go to as defined in /etc/inittab
Example Debian /etc/rcS.d/ directory
Getty and gettdefs
Terminal Emulation
Terminfo (Some Extracts from stated reference material)
Terminfo Compiler (tic)
Save disk space
TERM
Multiple Virtual Terminals
Some tips
In Summary
4. The Kernel versus Process Management
The Kernel
Overview of kernel/process control, resources
Executing a process
Process Management
Shell Command line parsing
Command Execution and Process Creation
Process Properties
Process Life Cycle
The state of a process
Scheduler
Linux Multitasking
Task States
Time-slicing
Timer
Task switching
When does switching occur?
5. Memory Management
The Buffer Cache
The Directory Cache
Paging and swapping
Introduction
Swap Space
Swapping
Paging
The working sets
Implementation of swapping and paging in different systems
Virtual memory
6. Drivers
Introduction to drivers
Driver Types
Driver Implementations
Driver Management
Listing currently loaded modules
Loading Modules
Unloading modules
Other module management commands
Device Drivers
7. System Tuning
Performance Tuning
A machine is a finite resource
System Model - Sleep Queue
Scheduling, Priority Calculation and the nice value.
The algorithm
Scheduling code - From the process table perspective
More detail on scheduling
Performance Criteria
Limiting the memory usage
Times
Top (Some extracts are from the man pages)
Sar (Some extracts are from the man pages)
Vmstat (Some extracts are from the man pages)
Iostat (Some extracts are from the man pages)
ps (Some extracts are from the man pages)
8. Tips and Tricks
Why recompile the kernel at all?
To prepare
Using "config"
Creating dependencies and re-compiling the kernel
Edit LILO config file
General Information on hard disk partitions
Generic Unix filesystem properties
Generic Unix filesystem enhancements
Free Blocks bitmap
Block Groups
Extents
Datablock pre-allocation
Filesystems
Why use filesystems?
Filesystem support inside the kernel
A logical division
Attaching a filesystem (mount)
Filesystems other than Linux filesystems and some utilities
A filesystem Structure
The Virtual Filesystem
The Ext2 and Ext3 Filesystems
File System Checking
Performing a filesystem check
Lost+found directory
The proc filesystem
Exercise:
The System Logger - syslogd
How does syslogd work
Why use a log file to record happenings on systems?
Let's look at the .conf file
Setting up the loghost
Inter-Process Communication
Signals
A. Referances
Simone Demblon reference material
Online sources for recommended reading
Index

List of Figures

1.1. PDP 7 with teletypewriter
1.2. Relationship between hardware, assembler and a compiler
1.3. Dennis Richie and Ken Thompson working on a PDP-11.
1.4. Professor Andy Tannebaum
1.5. Linus Torvald
1.6. Tux, the Linux mascot
1.7. The BSD mascot
1.8. Operating System Layers
1.9. Bootloader in memory
1.10. Kernel loaded into memory
1.11. Kernel memory and User Memory
1.12. Kernel Memory, table and buffer cache allocations
4.1. The Layers of the Operating System
4.2. Separate fields are interpreted by the shell
4.3. Process Life Cycle
4.4. The Scheduler
4.5. Round-Robin Scheduling
4.6. Sleep Queue and Run Queue
4.7. Multitasking flow
4.8. Time-slicing
5.1. Kernel Memory, table and buffer cache allocations
6.1. Kernel Binary
6.2. Loadable modules
6.3. Block and Character Device Drivers
7.1. Let us look again at the sleep queue
8.1. Hard disk partitions
8.2. Generic Unix Filesystem Support
8.3. Inode List
8.4. Free Blocks Bitmap (Extension to Inode List Figure)
8.5. Block Groups
8.6. Filesystems
8.7. Mounting filesystems
8.8. /dev/hda3 - Where are you working now?
8.9. /dev/hda4 - Where are you working now?
8.10. Filesystem Structure
8.11. Datablock addressing in the inode
8.12. The Virtual Filesystem

List of Tables

1.1. Major vendors/ hardware and related operating systems.