To compile a Linux Kernel Module, you need: 1) The module source, in its own directory (you need R/W access to it!) 2) The source of the kernel for which you want to compile the module (read only access to it should be enough). NOTE: you do not really need the whole kernel source... Some makefiles and scripts (the KBuild system) and the kernel headers should be enough. Look at the kern-headers-xeno.tar.bz2 package The module can be easily compiled by typing make -C M= So, to compile the test module: cd /tmp tar xvzf module_test.tgz cd module_test make -C /lib/modules/`uname -r`/build M=/tmp/module_test Some .ko files will be created... You can insert them in the kernel by using the "insmod" command. But to do so, you need the root power, which you generally don't have. So, the only way to experiencing with kernel modules is to use an emulator. Let's use Qemu, and let's emulate an ARM system. - First of all, you need the cross-compiler for ARM: cd /tmp tar xvzf cross.tgz export PATH=$PATH:/tmp/Cross/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin - Then, you need the kernel source, configured for ARM, for compiling the modules tar xvjf kern-headers-xeno.tar.bz2 (this package only contains the needed part of the kernel source, plus some patches for Xenomai... But it is ok for our experiments) - If you did not uncompress the example modules yet, do it now: tar xvzf module_test.tgz - And now, finally compile the module!!! cd module_test make -C /tmp/l-head M=/tmp/module_test ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu- - To test the module, you now need to boot an ARM kernel... The binaries-xeno.tar.bz2 package from binaries-xeno.tar.bz2 contains the binary of the kernel corresponding to the sources from kern-headers-xeno.tar.bz2. To boot it, you need an initramfs... To build a proper initramfs from busybox, you can use the mkfs-1.tgz scripts from www.disi.unitn.it/~abeni/RTOS/mkfs-1.tgz tar xvzf mkfs-1.tgz cd initramfs-scripts ./mkfs.sh Now copy your test modules in the FS, and re-run the "cpio step": cp /tmp/module_test/*.ko /tmp/rootfs cd /tmp/rootfs find . | cpio -o -H newc | gzip > ../newfs.img cd .. - Finally, you can boot your emulated system: qemu-system-arm -kernel Xeno/zImage -initrd newfs.img if you want the "console version", use: qemu-system-arm -kernel Xeno/zImage -initrd newfs.img -nographic -append "console=ttyAMA0" - When the system is up, login as root and try cd / insmod test_mod.ko n_elem=10 rmmod test_mod If you have problems with one of the previous steps, send me an email.