Version Numbering

As the last point before digging in to programming, I’d like to comment on the unusual version numbering scheme used in Linux and what version this book refers to.

First of all, note that every software package used in a Linux system has its own release number, and there are often interdependencies across them: you need a particular version of one package to run a particular version of another package. The creators of Linux distributions usually handle the messy problem of matching packages, and the user who installs from a prepackaged distribution doesn’t need to deal with version numbers. Those who replace and upgrade system software, on the other hand, are on their own. Fortunately, some modern distributions allow the upgrade of single packages by checking interpackage dependencies, and this greatly simplifies things for the user who needs to keep system software up to date.

In this book, I’ll assume you have version 2.6.3 or newer of the gcc compiler, version 1.3.57 or newer of the module utilities, and a recent-enough version of the GNU tools (the most important being gmake) for program development. Those requirements aren’t particularly strict, as nearly every Linux installation is equipped with GNU tools, and these versions are relatively old (besides, kernel versions 2.0 and later refuse to compile with a gcc older than 2.6). Note that recent kernels include a file called Documentation/Changes, which lists the software needed to proficiently compile and run that kernel version. This file is missing from the 1.2 sources.

As far as the kernel is concerned, I’ll concentrate on the 2.0.x and 1.2.13 versions, trying to write code that can work with both of them.

The even-numbered kernel versions (i.e., 1.2.x and 2.0.x) are the stable ones and are intended for general distribution. The odd versions, on the contrary, are development snapshots and are quite ephemeral; the latest of them represents the current status of development, but becomes obsolete in a few days.

There should be no general reason to ever run a 1.3 or 2.1 kernel, unless it is the latest one. Sometimes, however, you will choose to run a development kernel, either because it has some features you need that are missing in the stable distributions, or simply because you have made your personal changes to that version, and you lack the time to upgrade your patch. Note, however, that there’s no guarantee on experimental kernels, and nobody will help you if you lose your data because of a bug in a non-current odd-numbered kernel. Nonetheless, this book supports development versions of the kernel up to 2.1.43, as the last chapter describes how to write drivers that are aware of interface differences between 2.0 and 2.1.x.

As far as 1.2.13 is concerned, I feel it is an important kernel version, though quite old. While 2.0.x is faster than 1.2.13 on most new hardware, 1.2.13 is considerably smaller, and might be a good choice for someone who runs old hardware. Inexpensive systems based on a 386 processor with a small RAM supply are good candidates for embedded systems or automated controllers, and they might be faster with 1.2.13 than with 2.0.x. Since 1.2.13 is a bugfix release over previous 1.2.x versions, I won’t consider earlier 1.2 kernels.

Whenever there is some incompatibility between 1.2.13 and 2.0, or in the latest 2.1 kernels, I’ll report it.

My main target version is nonetheless Linux 2.0, and some features introduced in this book are not available in older kernels. Most sample modules will compile and run on a wide range of kernel versions; in particular, they have all been tested with version 2.0.30, and most of them with 1.2.13. Sometimes I won’t support version 1.2 in the sample modules, but this only happens in the second part of the book, which is more advanced by design and can thus live without reference to older kernels.

Another feature of Linux is that it is a platform-independent operating system, as it isn’t only ``a Unix clone for PC clones'' anymore: it is successfully being used with Axp-Alpha, the Sparc processors, Mips Rx000, and a few other platforms, in addition to the x86. This book is platform-independent as far as possible, and all the code samples have been tested on PCs, an Alpha platform, and a Sparc machine. Since the code has been tested on both 32-bit and 64-bit (the Alpha) processors, it should compile and run on all the other platforms. As you might expect, the code samples that rely on particular hardware don’t work on all the supported platforms, but this is always stated in the source code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.121.55