July 1999

Getting to the Source of GNU/Linux

Undoubtedly the best way to get to know how something works is to tear it apart. I am a very curious person myself and have a tendency sometimes to start investigating things out of the blue. I have found that philosophy works on things like bikes, cars, electronics and so on - but not software. Software is not so easy to just "take apart". It can be done, however. Even protected software can be UN-compiled into pure machine code. If you have twenty spare years laying around you might be able to make heads or tails of large programs that are in machine code. There is another way however, what if you could look at it before it was put together? Like all of the parts of a hotrod laid out on a shop floor before it was completed? Well for the longest time that was not so easy, and like so many other aspects of technology that have been affected by this statement: there is open source.

As if it were so simple

When I was using Slakware 1.0.13 it was not such a big deal to root thorough the files in the source tree, there weren't that many. As my curiosity got the best of me one day (not too long ago actually) I installed the entire source tree and development kit for Red Hat's 5.2 distribution onto my GNU/Linux box. I first browsed the Kernel with the GUI thingamajigger but that wasn't enough. I wanted to know how that sucker ticked. So I cracked open a few files in vi - and boy was I lost. There were at least 200 more than I remember with my old Slakware version. I was in a quandary, you see I wasn't interested in developing or adding anything to the kernel - just figuring out how the Core Operating System worked. So how could I get just the basics?

Well duh. A mini-distribution was just what I needed. I mean how small do you want it? There are actually net-workable single floppy versions of GNU/Linux running around out there. An ingenious fellow can (and some have) use these like flash card boot devices for routing and simple network services on smaller networks.

Obtaining the Source

There are a variety of tiny GNU/Linux distributions (actually if I recall one is actually known as "Tiny GNU/Linux") laying around out there. So I suggest visiting Index of Mini GNU/Linux Distributions and find one that suits your tastes. Remember to download the source if you intend to get the installation stuff too. Some are so tiny the source is a separate package. Unpack the files somewhere and start snooping. I found following Makefiles around was the easiest way to figure out how a lot of stuff actually worked. I also recommend figuring out what files are common first, then get a feel for what they do so as you snoop around other files and you see them sourced you already know what they are for.

Compiling Stuff

Be wary - be very wary. I advise reading all associating documentation that comes with the distribution you downloaded. There are ways to compile entire OS distributions without replacing the one you are using, just make sure you are well aware of the outcome of any compiling you do. Once I got a few bits and pieces to compile correctly I began seeing how difficult it might be to work on the source tree that came with my distribution.

For the Sake of Learning

Digging around the guts of GNU/Linux really explained a lot of how it works and is put together. Most Unix systems are similar in nature and anyone who takes the time to check out the guts of a GNU/Linux Source tree will find it well worth their time. Heck, maybe you can come up with your own distribution!