Form Zero to Hero in Kernel Module Development

suchakra's picture

Suchakra is a PhD student at Ecole Polytechnique de Montreal. He researches on JIT compilers and tracing tools full-time and loves to do UX/UI and design stuff when he is free. He is involved with Fedora as a packager and designer. You can know more about him at and

OK, lets be realistic. Its not possible in a short duration. But I'll give you something which is half as good as that! How about writing a simple kernel module which filters network packets? A module which is neither a lame "Hello World", nor a high end device device driver for some telecommunication tower hardware. But nevertheless, something which you can be proud of and form a basis for learning more advanced stuff. A module which your future you will remember with a smile :)

In short, you will create a small network packet filtering kernel module for a simple use case such a filtering based on the device or length orthe type of network packet.

Target Audience: Young and/or enthusiastic minds willing to kickstart kernel module development

Tentative Timeline
1. Introduction
1.1 Short theory about modules and their place in kernel
1.2 Structure of modules

2. System setup
2.1 Setup/distribute VMs
2.2 Setup toolchain
2.3 Custom kernel install demo (maybe)

3. Hello Module World
3.1 Write a basic module
3.2 Building out-of-kernel tree

4. Moving on to net-filter module
4.1 Browsing kernel for clues
4.2 Looking at Netfilter/tracepoint probes
4.3 Creating a module

Run the module. Feel awesome!

Prerequisites: Knowledge of C

Sources I may be referring
Linux Device Drivers (Chapter 2):
My trace filter presentation:

Session Track: 
Session Time Slot(s): 
Experience level: