Skip to content

Commit 5aabe58

Browse files
authored
Merge pull request #347 from Jordymalone/label-sec
Unify subsection labels with sec prefix
2 parents 156cf71 + 463b068 commit 5aabe58

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lkmpg.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ \subsection{Hello and Goodbye}
493493
the last time you ran \sh|make menuconfig| or something similar.
494494

495495
\subsection{The \_\_init and \_\_exit Macros}
496-
\label{init_n_exit}
496+
\label{sec:init_n_exit}
497497
The \cpp|__init| macro causes the init function to be discarded and its memory freed once the init function finishes for built-in drivers, but not loadable modules.
498498
If you think about when the init function is invoked, this makes perfect sense.
499499

@@ -508,7 +508,7 @@ \subsection{The \_\_init and \_\_exit Macros}
508508
\samplec{examples/hello-3.c}
509509

510510
\subsection{Licensing and Module Documentation}
511-
\label{modlicense}
511+
\label{sec:modlicense}
512512
Honestly, who loads or even cares about proprietary modules?
513513
If you do then you might have seen something like this:
514514
\begin{verbatim}
@@ -527,7 +527,7 @@ \subsection{Licensing and Module Documentation}
527527
\samplec{examples/hello-4.c}
528528

529529
\subsection{Passing Command Line Arguments to a Module}
530-
\label{modparam}
530+
\label{sec:modparam}
531531
Modules can take command line arguments, but not with the argc/argv you might be used to.
532532

533533
To allow arguments to be passed to your module, declare the variables that will take the values of the command line arguments as global and then use the \cpp|module_param()| macro (defined in \src{include/linux/moduleparam.h}) to set the mechanism up.
@@ -600,7 +600,7 @@ \subsection{Passing Command Line Arguments to a Module}
600600
\end{verbatim}
601601

602602
\subsection{Modules Spanning Multiple Files}
603-
\label{modfiles}
603+
\label{sec:modfiles}
604604
Sometimes it makes sense to divide a kernel module between several source files.
605605

606606
Here is an example of such a kernel module.
@@ -634,7 +634,7 @@ \subsection{Modules Spanning Multiple Files}
634634
First we invent an object name for our combined module, second we tell \sh|make| what object files are part of that module.
635635
636636
\subsection{Building modules for a precompiled kernel}
637-
\label{precompiled}
637+
\label{sec:precompiled}
638638
Obviously, we strongly suggest you to recompile your kernel, so that you can enable a number of useful debugging features, such as forced module unloading (\cpp|MODULE_FORCE_UNLOAD|): when this option is enabled, you can force the kernel to unload a module even when it believes it is unsafe, via a \sh|sudo rmmod -f module| command.
639639
This option can save you a lot of time and a number of reboots during the development of a module.
640640
If you do not want to recompile your kernel then you should consider running the examples within a test distribution on a virtual machine.

0 commit comments

Comments
 (0)