next up previous
Next: Linux Networking API Up: ORB Integration into Kernel Previous: ORB Integration into Kernel

Linux Kernel Module API

Conceptually, writing a Linux kernel module is as simple as supporting two functions: init_module() and cleanup_module(), and then compiling into object code (with the appropriate defines). However, when considering what is actually necessary in order to initialize KORBit, and the full ramifications of being a Linux kernel module, things become a bit stickier.

In a nutshell, initializing KORBit requires doing enough initialization so that an IOR can be written to /proc, and launching a new kernel thread in order to service requests to the ORB. This first step requires creating and binding a TCP socket, and then performing the gyrations to actually write a file into /proc. This process is best described by the document ``Linux Kernel Module Programming Guide''5, by Ori Pomerantz. This document provides some sample code for initializing the requisite data structures, and setting up the callback function necessary for /proc.

While all of the above is simply a matter of driving the Linux kernel, we encounter problems when attempting to support the nuances of kernel modules. Linux kernel modules support the notion of ``reference counting''. But considering the timeframe for our project we will leave as a future enhancement.

When KORBit is loaded, it will set it's reference counter to some non-zero value, and mark its VISITED flag. From this point on, these values will not be changed. The only way to unload KORBit will be manually (via rmmod).


next up previous
Next: Linux Networking API Up: ORB Integration into Kernel Previous: ORB Integration into Kernel