|
|
/ Hathaway Weblog / Kernel Hacking |
Lately I've had the rare pleasure of hacking kernels. No, this has nothing to do with corn or axes. I'm talking about changing the mostly-invisible software that runs deep inside the computer, runs all other programs, parcels out memory and disk space, and passes information between devices and programs. It's fun to work on software that runs inside the kernel because you get blazing speed but very little protection against your own mistakes. Here is what I've been doing.
We have a DWL-122 USB wireless adapter. It works well in Linux, except it occasionally cuts out and refuses to revive. I've been working on fixing its driver (linux-wlan) for months, but I finally discovered that the driver frequently tries to send firmware (a small program that runs inside the device) before the device is ready to receive it. I added a delay and now at least it's easy to make it work again once it cuts out. Now I'm trying to discover what makes it cut out in the first place.
I also have a laptop with a wireless card that uses a madwifi driver. When I upgraded the laptop to the latest kernel, the madwifi driver hit a compilation error. I learned that a function signature in the kernel had changed. Once I had made the corresponding change in madwifi, the driver compiled and worked flawlessly.
I've also been configuring kernels: creating lean-and-mean kernels, expanding TCP buffers, making more RAM available to network cards, and fiddling with sysctl parameters to break through bottlenecks in data throughput. It is quite a joy to tweak open source code and jump from 300 megabits per second to nearly a gigabit per second.
