Adding System Calls (an OpenBSD Example) 19
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."
other examples (Score:4, Informative)
Re:other examples (Score:2)
Re:other examples (Score:1)
Interesting, however.... (Score:1, Funny)
Sometimes this is more trouble then it seems. (Score:3, Interesting)
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
Re:Sometimes this is more trouble then it seems. (Score:1)
I wrote patches to the linux kernel and apache to allow all PHP and CGI requests to run as the owner of the file being requested. Actually the UID changes for each request, even static pages. So long as a stat() can be done it should work. This means the files don't have to be readable by the webserver.
The system stores the user ID on a stack and returns to the webserver user ID when the request has been served so no forking or set-uid files are needed. (Yes root needs to configure
Syscalls (Score:1)
Re:Syscalls (Score:1)
The article is about syscalls in the OpenBSD kernel. I don't think that Linus is very interested in recieving patches for new syscalls in a BSD kernel.
Eternal pet peeve (Score:2)
Here, the author needlessly repeats the "1024" constant, which introduces a fine opportunity to make an error by only changing the
Re:Eternal pet peeve (Score:2)
Its not just a case of personal taste , using sizeof with parenthesis will only work for types that only have a 1 token declaration
Eg: sizeof int
works fine , whereas
sizeof int * sizeof struct foo
will give an error with most compilers. So in this sense the sizeof operator is not treated
syntatically in an equivalent way to the return operator. Just anothe
Re:Eternal pet peeve (Score:2)
sizeof int *
sizeof struct foo
should have been seperate.
Re:Eternal pet peeve (Score:1)