As part of my EECS 441: Resource Virtualization class at Northwestern University, I decided to work on a project involving porting compilers into the Linux Kernel. TCCLK is the effort to port the Tiny C Compiler, written by Fabrice Bellard, into the Linux Kernel.
I worked on this project with my friend Tai Won Chung.
Porting anything to the Kernel can be painful. There are a lot of places that can break the kernel, and once the kernel breaks, the whole system just halts. Without the special setup that Professor Peter Dinda enabled us to safely hack on the Linux Kernel, this project would have been impossible to accomplish. The most difficult challenge was figuring out the symbol lookups in the kernel, because it was not possible to debug the code in the traditional way. Through this project I learned to not debug with a bunch of print statements, mostly because in the Kernel that can be difficult. Also, working in an environment where it is difficult to debug code forced me to learn that carefully writing a few lines of code that have been thought through well is much better than writing hundreds of lines of code without much thinking. I also learned a lot about how Linux Kernel modules are made, and how to configure the Makefile. Most importantly, this made me get interested in writing kernel modules and Linux Kernel hacking.
Check it out!
You can check this out from my publicly available Git repo here.