Skip to content

Commit 4639ca1

Browse files
committed
Remove out-of-date versioing scheme
1 parent fd80247 commit 4639ca1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: lkmpg.tex

+2-6
Original file line numberDiff line numberDiff line change
@@ -899,13 +899,9 @@ \subsection{Writing Modules for Multiple Kernel Versions}
899899
This is necessary for backward compatibility -- a new kernel version is not supposed to break regular processes.
900900
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.
901901

902-
The Linux kernel versions are divided between the stable versions (n.\$<\(even number\)>\$.m) and the development versions (n.\$<\(odd number\)>\$.m).
903-
The development versions include all the cool new ideas, including those which will be considered a mistake, or reimplemented, in the next version.
904-
As a result, you can not 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).
905-
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).
906-
907902
There are differences between different kernel versions, and if you want to support multiple kernel versions, you will find yourself having to code conditional compilation directives.
908-
The way to do this to compare the macro LINUX\_VERSION\_CODE to the macro KERNEL\_VERSION. In version a.b.c of the kernel, the value of this macro would be \(2^{16}a+2^{8}b+c\).
903+
The way to do this to compare the macro \verb|LINUX_VERSION_CODE| to the macro \verb|KERNEL_VERSION|.
904+
In version a.b.c of the kernel, the value of this macro would be \(2^{16}a+2^{8}b+c\).
909905

910906
While previous versions of this guide showed how you can write backward compatible code with such constructs in great detail, we decided to break with this tradition for the better.
911907
People interested in doing such might now use a LKMPG with a version matching to their kernel.

0 commit comments

Comments
 (0)