Monthly Archives: November 2024

A Day of Progress

I explored the driver files again, and I think I found the driver relevant to me. But I realized that what we call a “driver” is not just a single file. Within the C files, there are references to header (.h) files, such as include statements and relational structures. It all sounds very complicated. Many files reference each other, creating a tangled web. Now I do understand what they mean when they say “architecture”. Finding my way through this is going to be very tiresome, so I found two resources to guide me: The first one is Linux Device Drivers, by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman, and the other one is The Linux Kernel Module Programming Guide by Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang. I also stumbled upon a wonderful blog by an expert: https://javiercarrascocruz.github.io, which seems I’ll be visiting very often next year.

However, these books feel too heavy for me. I’m not ready yet so I’ve set another goal for myself: to practice the C language for a while. At least until I feel comfortable and I can start guessing what the code in those driver files are referring to. Otherwise it’s going to be like skimming the grammar summary of a foreign language, which I’d learn to compose well-structured texts. But I wouldn’t be able to draft even a short message with any confidence or style. In fact, I couldn’t even understand a simple text.

So I spent my Sunday going over the C tutorial again on w3schools.com and asked ChatGPT to give me a starting task, which I completed (despite a few syntax errors that I’ve learned to fix). I’ve had the chance to use the functions scanf, printf and if as well as basic math operators. I’m thinking of doing small challenges over the next 30 days (maybe even a year), at least until I reach a level where I can understand the driver code I’ll be reading. I’ll be sharing only my progress in C on this blog for a long time.

2 Weeks of Non-progress

The past two weeks have been far from fruitful in my quest. My schedule has been relentless—probably the busiest I’ve faced in the past seven years—leaving me with only the smallest slivers of time to work on what I set out to achieve in my previous post.

In those rare breaks, I managed to download the Linux kernel files from kernel.org to my computer (after a somewhat frustrating hunt to locate them under Debian’s root folders). Then, I went through a sea of folders, each containing files with extensions .h and .c, without even a vague idea of what purpose they serve.

Once again, the sheer scale of what I’m attempting hit me hard. It felt monumental, almost overwhelming. There have been many moments of helplessness, where it seemed nearly impossible. And yet, there’s one thought that keeps me going: it’s difficult, but not impossible. I am committed to relying solely on online resources and tutorials available without reaching out to experts for guidance.

When things seem unnerving, I try to step back and locate my position on the roadmap. It’s been only a few weeks since I started and, well, at least now I know where drivers are under Debian (they are all .ko files now), though I don’t know how they operate. Anyway, that’s something. I will not lose heart. The busy work schedule and my foreignness to drivers and kernels are reasonable excuses for the non-progress. I will not lose heart. The busy work schedule and my foreignness to drivers and kernels are reasonable excuses for the non-progress.