Kernel development is difficult. Even creating the classic intro "Hello World!" kernel module involves a Makefile and a bunch of nonsensical amount of code.
TCC is a tiny C compiler written by Fabrice Bellard. It's only 300KB of executable, and it's small enough to be run anywhere, including the kernel.
Some cool things you might be able to do are:
- Make C "scripts" : TCC runs so fast. It can literally "run" C source code like scripts.
- You can invoke kernel functions from user space, enabling you to write a kernel specific program without having the need to go through the pain of writing a kernel module.
- You could run C programs inside a C program. Kind of like the eval function in Python.
- Warning We aren't responsible for any breach of security that may occur from using this
tcc_service is a user-level program that serves as a linker to the TCC module in Kernel. Type tcc_service -h for help.
- Note that TCCLK only works on Linux machines for now.
- Note again that you can only use TCCLK if you are the root user (because you have to insert a new kernel module into the kernel
- git clone https://github.com/jameswhang/tcclk.git
- cd tcclk
- ./configure
- cd modules
- make clean
- make
- Either run the shell script ./start.sh OR insmod tcc_module.ko
- dmesg will tell you the major number
- mknod /dev/tcc_dev c (major num) 0
- ./service -f (source code filename)
James Whang Tai Won Chung Peter Dinda
I have a Trello board to keep all the TODOs. Initially I kept this in the TODO file under module directory but that is now deprecated. Trello is awesome.
Feel free to send me an email / join us on Trello if you want to contribute!