The joys of writing code

Yesterday and today I decided to tackle an issue in some of my code that I wrote for a client. This wasn’t a huge chunk of code, but how it worked bugged me and was actually going to affect my current project. This chunk of code, unfortunately was in a kernel extension (KEXT) and is extremely hard to debug. Each time I made a slight mistake, my machine would crash and I’d have to restart. After 4 or 5 times doing things, I decided to get smart and use one of my test machines. Luckily one of the machines already had Xcode on it. Crashes on this machine aren’t that bad as I can work on my main machine when it is restarting and it restarts much faster as I don’t have so much junk on it.

Anyway, after fighting with the code for something like 8 hours, I got it working how I wanted. Yeah! This is one aspect of development that I truly dislike; kernel extensions are hard and even if I was paid more, I wouldn’t want to do them. In this particular case, the kernel extension is very minor because I convinced the client to change their firmware to make it minor. It didn’t take much convincing as the more complex a kernel extension is, the more prone it is to crash (and take down the entire machine), require changes for the next OS update, and cost significantly more to write.

So while I can tackle just about any code on the Mac, will I is another question. In this case, it was worth my time to investigate this issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.