Linux Kernel Programming
Instructor: Dr. Yongguang Zhang (ygz@hrl.com)
Objectives
This course is designed as a laboratory component
in the undergrad Operating Systems curriculum.
It will supplement the introductory OS course
and enable students to experiment with a contemporary OS (Linux).
Through a series of programming assignments,
the students will develop an appreciation in systems programming in general,
experience the new open source software development model,
and gain necessary skills and experiences
to work large system software as complex as an OS kernel.
Why Teaching/Learning Linux Kernel Programming
Linux kernel is a very complex and monolithic software system.
For performance reasons, it forgoes the structural design
and many other software engineering principles that we learn in CS courses.
Working in the kernel requires special skills and good judgements,
such as
- thinking through every line
- understanding the details without loosing the big picture
- understanding the trade-offs and making the right choices
- dealing with serve constraints (resource, space and time)
- yet maintaining good programming style and discipline
Students taking this course will not only learn
the linux 2.4/2.6 kernel,
but also perfect these skills
to become a great system programmer.
Furthermore, linux represents a new software development paradigm --
open source and community building.
This class will be taught in such a way that
allows students to learn to work in the open source community.
Prerequisites
- Undergrad OS course
- Strong programming skills in C/C++
- Practical Unix/Linux experience from a user's level
- Enjoy "hacking"
Syllabus
- Introductions
- Contemporary operating systems
- Linux and its evolution
- Systems programming
- Course format
- Linux Basics
- Basic Linux installation and administration
- Linux kernel architecture
- Using User-Mode-Linux
- Kernel Basics
- General kernel responsibilities
- Kernel organization
- Kernel modules
- Using Kernel Services
- System calls
- /proc file system
- Managing Memory
- Address architecture, address translation
- Physical memory, pages
- Kernel dynamic memory, address space
- Paging/swapping
- Managing Processes
- Process, kernel thread, tasklet
- Context switch and scheduling
- Interrupts, signals, and exceptions
- Managing Times and Synchronization
- Kernel timer, hardware clocks
- Synchronization, locks, semaphores
- Linux Devices
- Linux device driver architecture
- Device filesystem (devfs)
- Character device
- Block device
- Linux Filesystems
- Virtual filesystem (VFS)
- Superblock, inode, dentry, file.
- Linux Networking
- Multiplexing and demultiplexing
- Socket API, protocol stack
- Netfilter and advanced networking in Linux
- Network device driver
- Linux Security
- Contemporary Topics
- Enterprise Linux (scaling up)
- Embedded Linux (scaling down)
- Term Projects
Projects
The students will first do a series of smaller projects
(one per week) to cover various aspects of a Linux kernel.
Then, they will do a bigger term project to explore
a particular area.
Previous offerings
I have taught this course before, see: