[bootlin/training-materials updates] master: kernel-modules: Reword the module utilities slides (d0a031dd)

Miquel Raynal miquel.raynal at bootlin.com
Wed Jan 18 14:27:53 CET 2023


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/d0a031dd31fbafef67b44305c1a096d58ba80b9e

>---------------------------------------------------------------

commit d0a031dd31fbafef67b44305c1a096d58ba80b9e
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date:   Wed Jan 18 12:37:55 2023 +0100

    kernel-modules: Reword the module utilities slides
    
    Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


>---------------------------------------------------------------

d0a031dd31fbafef67b44305c1a096d58ba80b9e
 .../kernel-intro-modules/kernel-intro-modules.tex  | 57 +++++++---------------
 .../sysdev-kernel-booting.tex                      | 33 +++++++------
 2 files changed, 36 insertions(+), 54 deletions(-)

diff --git a/slides/kernel-intro-modules/kernel-intro-modules.tex b/slides/kernel-intro-modules/kernel-intro-modules.tex
index 4675595b..056d962c 100644
--- a/slides/kernel-intro-modules/kernel-intro-modules.tex
+++ b/slides/kernel-intro-modules/kernel-intro-modules.tex
@@ -37,39 +37,31 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{Kernel log}
-
-  When a new module is loaded, related information is available in the
-  kernel log.
-  \begin{itemize}
-  \item The kernel keeps its messages in a circular buffer (so that it
-    doesn't consume more memory with many messages)
-  \item Kernel log messages are available through the \code{dmesg}
-    command ({\bf d}iagnostic {\bf mes}sa{\bf g}e)
-  \item Kernel log messages are also displayed in the system console
-    (console messages can be filtered by level using the
-    \code{loglevel} kernel command line parameter,
-     or completely disabled with the
-    \code{quiet} parameter). Example:\\
-    \code{console=ttyS0 root=/dev/mmcblk0p2 loglevel=5} 
-  \item Note that you can write to the kernel log from user space too.
-    That's useful when your device's serial console is being monitored
-    for critical messages:
-    \code{echo "<n>Debug info" > /dev/kmsg}
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{Module utilities (1)}
+  \frametitle{Module utilities: extracting information}
   \code{<module_name>}: name of the module file without the trailing \code{.ko}\\
   \begin{itemize}
   \item \code{modinfo <module_name>} (for modules in \code{/lib/modules})\\
     \code{modinfo <module_path>.ko}\\
     Gets information about a module without loading it: parameters, license,
     description and dependencies.\\
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Module utilities: loading}
+  \begin{itemize}
   \item \code{sudo insmod <module_path>.ko}\\
     Tries to load the given module. The full path to the module object
     file must be given.
+  \item \code{sudo modprobe <top_module_name>}\\
+    Most common usage of \code{modprobe}: tries to load all the
+    dependencies of the given top module, and then this module. Lots of
+    other options are available. \code{modprobe} automatically looks in
+    \code{/lib/modules/<version>/} for the object file corresponding
+    to the given module name.
+  \item \code{lsmod}\\
+    Displays the list of loaded modules\\
+    Compare its output with the contents of \code{/proc/modules}!
   \end{itemize}
 \end{frame}
 
@@ -91,22 +83,7 @@ $ dmesg
 \end{frame}
 
 \begin{frame}
-  \frametitle{Module utilities (2)}
-  \begin{itemize}
-  \item \code{sudo modprobe <top_module_name>}\\
-    Most common usage of \code{modprobe}: tries to load all the
-    dependencies of the given top module, and then this module. Lots of
-    other options are available. \code{modprobe} automatically looks in
-    \code{/lib/modules/<version>/} for the object file corresponding
-    to the given module name.
-  \item \code{lsmod}\\
-    Displays the list of loaded modules\\
-    Compare its output with the contents of \code{/proc/modules}!
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{Module utilities (3)}
+  \frametitle{Module utilities: removals}
   \begin{itemize}
   \item \code{sudo rmmod <module_name>}\\
     Tries to remove the given module.\\
diff --git a/slides/sysdev-kernel-booting/sysdev-kernel-booting.tex b/slides/sysdev-kernel-booting/sysdev-kernel-booting.tex
index a4f1c7d8..ac94bc56 100644
--- a/slides/sysdev-kernel-booting/sysdev-kernel-booting.tex
+++ b/slides/sysdev-kernel-booting/sysdev-kernel-booting.tex
@@ -75,21 +75,26 @@
     \begin{itemize}
     \item The size is configurable using \kconfig{CONFIG_LOG_BUF_SHIFT}
     \end{itemize}
-  \item Kernel logs are displayed on one or several {\em consoles},
-    configured using the \code{console=} kernel command line argument
+  \item When a module is loaded, related information is available in the
+    kernel log.
+  \item Kernel log messages are available through the \code{dmesg}
+    command ({\bf d}iagnostic {\bf mes}sa{\bf g}e)
+  \item Kernel log messages are also displayed on the console pointed by
+    the \code{console=} kernel command line argument
     \begin{itemize}
-    \item \code{loglevel=} allows to filter messages displayed on the
-      console based on priority
-    \item \code{ignore_loglevel} (same as \code{loglevel=8}) will lead
-      to all messages being printed
-    \item \code{quiet} (same as \code{loglevel=0}) allows to not display
-      any message on the console
-    \end{itemize}
-  \item The \code{dmesg} user-space tool allows to dump the contents
-    of the circular buffer
-    \begin{itemize}
-    \item \code{dmesg} = {\bf d}iagnostic {\bf mes}sa{\bf g}e
-    \item Many options available
+    \item Console messages can be filtered by level using the
+      \code{loglevel} parameter:
+      \begin{itemize}
+      \item \code{loglevel=} allows to filter messages displayed on the
+        console based on priority
+      \item \code{ignore_loglevel} (same as \code{loglevel=8}) will lead
+        to all messages being printed
+      \item \code{quiet} (same as \code{loglevel=0}) prevents any message
+        to be displayed on the console
+      \end{itemize}
+    \item Example: \code{console=ttyS0 root=/dev/mmcblk0p2 loglevel=5}
     \end{itemize}
+  \item It is possible to write to the kernel log from user space:
+    \code{echo "<n>Debug info" > /dev/kmsg}
   \end{itemize}
 \end{frame}




More information about the training-materials-updates mailing list