Form Zero to Hero in Kernel Module Development

Speaker(s): 
suchakra's picture
Suchakra
Sharma
FAS ID: 
suchakra
Bio: 

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 http://suchakra.in and https://suchakra.wordpress.com/about/

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): http://lwn.net/images/pdf/LDD3/ch02.pdf
LKMPG: http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf
My trace filter presentation: http://ctpd.dorsal.polymtl.ca/system/files/11Dec2014.pdf

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