What small projects would you suggest to a novice with the kernel, but someone who has plenty of systems and C experience? The aim is to develop a familiarity with the kernel source code, and a facility for experimentation with crazy ideas.
I'm trying to think of some manageable small tasks (for example, add a syscall), but what would you suggest? For a target audience think someone who has at least an undergraduate OS course under their belt.
-
The Kernel Janitors project has some great ones.
From mjc -
When I took the aforementioned undergraduate OS course, one of our tasks was to add a few syscalls. They were extremely simple, nothing but reading and resetting counters that counted the number of times other syscalls were invoked. However, adding a syscall requires looking at and modifying quite a few files.. a lot of them are in the same relatively-small subtree of the kernel source, but its enough to get you familiar with the coding conventions, at least.
You might also consider:
Adding another (very simple) mode to the scheduler to implement a policy you find interesting. The "one implementation to rule them all" is quite hard (and even harder to agree on), but doing a simple O(N) scheduler, even a rudimentary O(1) scheduler, can be done relatively simply, algorithmically speaking. Even so, it requires poking through a lot of code.
Writing a device driver for a very simple piece of external hardware, like an 8-bit microcontroller that communicates via serial, or even something you build yourself. If you have any hardware experience, maybe try to write a device driver that can emulate an NES controller (bit-bang a few wires using the serial port and maybe a serial-to-parallel shift register). You could also do something like driving a really simple 7-segment LED display (like you have in an alarm clock), or a small collection of them.
From Matt J -
At the risk of starting a flame war: I'd recommend you to stay away from Linux kernel code. If you want to get your hands dirty with kernel programming, go with FreeBSD, NetBSD or OpenSolaris, for example. The code is much cleaner and better-structured (this is of course subjective opinion), actually designed, and even documented. Plus they have a kernel debugger (note that Linus is against both kernel debuggers and stable kernel API, which makes any kernel a moving target for your work). These OS-es even have a list of projects on their respective web-sites, and I personally have extremely good experience with people on OpenSolaris forums and NetBSD mailing lists.
You say that you have experience with C -- look at web source code repositories of Linux and of OpenSolaris or some of BSDs, compare the code, and make your own opinion. What I'm saying is, I guess, that there's more to open-source UNIX than Linux, and that you should at least look at them before going for Linux.
pjc50 : [Citation Needed] on Linus being against kernel debuggers? I'm aware of his rationale against committing to an API.zvrba : Is this good enough citation: http://www.linuxtoday.com/news_story.php3?ltsn=2000-09-07-002-21-OS-CY-KNFrom zvrba
0 comments:
Post a Comment