Полезная информация

next up previous contents index
Next: The /proc File System Up: Character Device Files Previous: Character Device Files

   
Multiple Kernel Versions Source Files

The system calls, which are the major interface the kernel shows to the processes, generally stay the same across versions. A new system call may be added, but usually the old ones will behave exactly like they used to. This is necessary for backward compatibility -- a new kernel version is not supposed to break regular processes. In most cases, the device files will also remain the same. On the other hand, the internal interfaces within the kernel can and do change between versions.

The Linux kernel versions are divided between the stable versions (n.<even number>.m) and the development versions (n.<odd number>.m). The development versions include all the cool new ideas, including those which will be considered a mistake, or reimplemented, in the next version. As a result, you can't trust the interface to remain the same in those versions (which is why I don't bother to support them in this book, it's too much work and it would become dated too quickly). In the stable versions, on the other hand, we can expect the interface to remain the same regardless of the bug fix version (the m number).   

This version of the MPG includes support for both version 2.0.x and version 2.2.x of the Linux kernel. Since there are differences between the two, this requires conditional compilation depending on the kernel version. The way to do this to use the macro LINUX_VERSION_CODE. In version a.b.c of the kernel, the value of this macro would be 216a+28b+c. To get the value for a specific kernel version, we can use the KERNEL_VERSION macro. Since it's not defined in 2.0.35, we define it ourselves if necessary.           


next up previous contents index
Next: The /proc File System Up: Character Device Files Previous: Character Device Files

1999-05-19