Adding System Calls (an OpenBSD Example)
BSD Forums writes "Kernel programming sometimes feels like a dark art where application programmers should never venture, but sometimes it's the right way to solve a problem. (Oh, and it's also very interesting.) One of the easiest places to start is by adding a new system call to a kernel. Kevin Lo explains how and why, with the OpenBSD kernel in this OnLamp article."
I have done this several times in the past and what happens is you then have an application trapped on a non-standard system. Any system that it runs that application will need your kernal patch with the new calls.
This gets even worse when the OS keeps upgrading and you are forced to migrate your changes up to be able to use current hardware. (this is need when all of the supported hardware is no longer available new)
In practice it turn into a major undertaking everytime a new OS release came out.
It's is a cool thing to have fun with. But think twice before you base a product or application on a kernel change. (unless you can get the main development tree to adopt it.) Or have the resources to maintain your own OS development team.
Adding new syscontrols and sockopts are also great fun.
At one point we had a versions of FreeBSD that could run DES encrypted Binaries, access the hard driver serial numbers and Mount a CD from HTTP or FTP connection, transmit Datagrams masquerading as TCP connections and be able to process Router Alert packets.
John
I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso