diff --git a/index.html b/index.html index 2e47bb8..efd2e24 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@

The Linux Kernel Module Programming Guide

Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang

-
October 21, 2022
+
October 22, 2022
@@ -101,9 +101,9 @@

The Linux Kernel Module Programming Guide is a free book; you may reproduce and/or modify it under the terms of the Open Software License, version 3.0. -

This book is distributed in the hope it will be useful, but without any warranty, -without even the implied warranty of merchantability or fitness for a particular -purpose. +

This book is distributed in the hope that it would be useful, but without any +warranty, without even the implied warranty of merchantability or fitness for a +particular purpose.

The author encourages wide distribution of this book for personal or commercial use, provided the above copyright notice remains intact and the method adheres to the provisions of the Open Software License. In summary, you may copy and @@ -577,13 +577,14 @@ is as simple as this: 8 9clean: 10    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean -

Now have a look at drivers/char/Makefile for a real world example. As you can -see, some things get hardwired into the kernel (obj-y) but where are all those obj-m -gone? Those familiar with shell scripts will easily be able to spot them. For those not, -the obj-$(CONFIG_FOO) entries you see everywhere expand into obj-y or obj-m, -depending on whether the CONFIG_FOO variable has been set to y or m. While we are -at it, those were exactly the kind of variables that you have set in the .config file in -the top-level directory of Linux kernel source tree, the last time when you said +

Now have a look at drivers/char/Makefile for a real world example. As +you can see, some things got hardwired into the kernel (obj-y) but where +have all those obj-m gone? Those familiar with shell scripts will easily be +able to spot them. For those who are not, the obj-$(CONFIG_FOO) entries +you see everywhere expand into obj-y or obj-m, depending on whether the +CONFIG_FOO variable has been set to y or m. While we are at it, those were +exactly the kind of variables that you have set in the .config file in the +top-level directory of Linux kernel source tree, the last time when you said make menuconfig or something like that.

@@ -601,10 +602,10 @@ when the init function is invoked, this makes perfect sense. like __init , has no effect for loadable modules. Again, if you consider when the cleanup function runs, this makes complete sense; built-in drivers do not need a cleanup function, -while loadable modules do. +while loadable modules do.

These macros are defined in include/linux/init.h and serve to free up kernel memory. When you boot your kernel and see something like Freeing unused kernel memory: 236k freed, this is precisely what the kernel is freeing. diff --git a/lkmpg-for-ht.html b/lkmpg-for-ht.html index 2e47bb8..efd2e24 100644 --- a/lkmpg-for-ht.html +++ b/lkmpg-for-ht.html @@ -18,7 +18,7 @@

The Linux Kernel Module Programming Guide

Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang

-
October 21, 2022
+
October 22, 2022
@@ -101,9 +101,9 @@

The Linux Kernel Module Programming Guide is a free book; you may reproduce and/or modify it under the terms of the Open Software License, version 3.0. -

This book is distributed in the hope it will be useful, but without any warranty, -without even the implied warranty of merchantability or fitness for a particular -purpose. +

This book is distributed in the hope that it would be useful, but without any +warranty, without even the implied warranty of merchantability or fitness for a +particular purpose.

The author encourages wide distribution of this book for personal or commercial use, provided the above copyright notice remains intact and the method adheres to the provisions of the Open Software License. In summary, you may copy and @@ -577,13 +577,14 @@ is as simple as this: 8 9clean: 10    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean -

Now have a look at drivers/char/Makefile for a real world example. As you can -see, some things get hardwired into the kernel (obj-y) but where are all those obj-m -gone? Those familiar with shell scripts will easily be able to spot them. For those not, -the obj-$(CONFIG_FOO) entries you see everywhere expand into obj-y or obj-m, -depending on whether the CONFIG_FOO variable has been set to y or m. While we are -at it, those were exactly the kind of variables that you have set in the .config file in -the top-level directory of Linux kernel source tree, the last time when you said +

Now have a look at drivers/char/Makefile for a real world example. As +you can see, some things got hardwired into the kernel (obj-y) but where +have all those obj-m gone? Those familiar with shell scripts will easily be +able to spot them. For those who are not, the obj-$(CONFIG_FOO) entries +you see everywhere expand into obj-y or obj-m, depending on whether the +CONFIG_FOO variable has been set to y or m. While we are at it, those were +exactly the kind of variables that you have set in the .config file in the +top-level directory of Linux kernel source tree, the last time when you said make menuconfig or something like that.

@@ -601,10 +602,10 @@ when the init function is invoked, this makes perfect sense. like __init , has no effect for loadable modules. Again, if you consider when the cleanup function runs, this makes complete sense; built-in drivers do not need a cleanup function, -while loadable modules do. +while loadable modules do.

These macros are defined in include/linux/init.h and serve to free up kernel memory. When you boot your kernel and see something like Freeing unused kernel memory: 236k freed, this is precisely what the kernel is freeing.