[FE training-materials-updates] Minor improvements and updates: style, font, etc.

Michael Opdenacker michael.opdenacker at free-electrons.com
Fri Oct 5 13:24:30 CEST 2012


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=1c4ba86fd0667d9060c7fa65c1aacd0121157555

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

commit 1c4ba86fd0667d9060c7fa65c1aacd0121157555
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Fri Oct 5 13:24:54 2012 +0200

    Minor improvements and updates: style, font, etc.


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

1c4ba86fd0667d9060c7fa65c1aacd0121157555
 ...kernel-driver-development-character-drivers.tex |    5 +--
 .../kernel-driver-development-io-memory.tex        |    9 +++---
 .../kernel-driver-development-memory.tex           |   20 ++++++------
 .../kernel-driver-development-modules.tex          |   32 +++++++++++---------
 .../kernel-driver-development-sleeping.tex         |    4 +--
 .../sysdev-linux-intro-cross-compilation.tex       |    4 +--
 .../sysdev-linux-intro-modules.tex                 |    2 +-
 .../sysdev-root-filesystem-contents.tex            |    2 +-
 8 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/slides/kernel-driver-development-character-drivers/kernel-driver-development-character-drivers.tex b/slides/kernel-driver-development-character-drivers/kernel-driver-development-character-drivers.tex
index 0c0e5ab..0445618 100644
--- a/slides/kernel-driver-development-character-drivers/kernel-driver-development-character-drivers.tex
+++ b/slides/kernel-driver-development-character-drivers/kernel-driver-development-character-drivers.tex
@@ -293,7 +293,8 @@ Piece of code available at \url{http://free-electrons.com/doc/c/acme.c}
     \mint{c}+unsigned int cmd, unsigned long arg)+
     \begin{itemize}
     \item Associated to the \code{ioctl()} system call.
-    \item Called unlocked because it doesn't hold the Big Kernel Lock.
+    \item Called unlocked because it didn't hold the Big Kernel Lock
+      (gone now).
     \item Allows to extend the driver capabilities beyond the limited
       read/write API.
     \item For example: changing the speed of a serial port, setting
@@ -408,7 +409,7 @@ int register_chrdev_region(
         unsigned count,    /* Number of device numbers */
         const char *name); /* Registered name */
 \end{minted}
-Returns 0 if the allocation was successful.\\
+Returns \code{0} if the allocation was successful.\\
 Example
 \begin{minted}[fontsize=\small]{c}
 static dev_t acme_dev = MKDEV(202, 128);
diff --git a/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex b/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex
index 84173b5..b132e75 100644
--- a/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex
+++ b/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex
@@ -40,7 +40,7 @@ struct resource *request_region(
      unsigned long len,
      char *name);
 \end{minted}
-  \item Tries to reserve the given region and returns NULL if unsuccessful.
+  \item Tries to reserve the given region and returns \code{NULL} if unsuccessful.
   \item \code{request_region(0x0170, 8, "ide1");}
   \item
 \begin{minted}{c}
@@ -165,7 +165,7 @@ void *ioremap(unsigned long phys_addr,
     unsigned long size);
 void iounmap(void *address);
 \end{minted}
-  \item Caution: check that ioremap doesn't return a NULL address!
+  \item Caution: check that ioremap doesn't return a \code{NULL} address!
   \end{itemize}
 \end{frame}
 
@@ -259,8 +259,9 @@ __raw_writel(1 << KS8695_IRQ_UART_TX,
     address.
   \item Used by applications such as the X server to write directly to
     device memory.
-  \item On x86, arm, tile, unicore32, s390:
+  \item On \code{x86}, \code{arm}, \code{tile}, \code{powerpc},
+    \code{unicore32}, \code{s390}:
     \code{CONFIG_STRICT_DEVMEM} option to restrict \code{/dev/mem}
-    non-RAM addresses, for security reasons (Linux 3.3 status).
+    non-RAM addresses, for security reasons (Linux 3.6 status).
 \end{itemize}
 \end{frame}
diff --git a/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex b/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex
index 10436a2..4b49e4b 100644
--- a/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex
+++ b/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex
@@ -88,7 +88,7 @@
   \frametitle{Notes on user-space memory}
   \begin{itemize}
   \item New user-space memory is allocated either from the already
-    allocated process memory, or using the mmap system call
+    allocated process memory, or using the \code{mmap} system call
   \item Note that memory allocated may not be physically allocated:
     \begin{itemize}
     \item Kernel uses demand fault paging to allocate the physical
@@ -116,8 +116,8 @@
   \item Kernel memory low-level allocator manages pages. This is the
     finest granularity (usually 4 KB, architecture dependent).
   \item However, the kernel memory management handles smaller memory
-    allocations through its allocator (see slabs / SLUB allocator –
-    used by kmalloc).
+    allocations through its allocator (see \emph{SLAB allocators}
+    – used by \code{kmalloc}).
   \end{itemize}
 \end{frame}
 
@@ -271,7 +271,7 @@
   \item The kmalloc allocator is the general purpose memory allocator
     in the Linux kernel, for objects from 8 bytes to 128 KB
   \item For small sizes, it relies on generic SLAB caches, named
-    kmalloc-XXX in \code{/proc/slabinfo}
+    \code{kmalloc-XXX} in \code{/proc/slabinfo}
   \item For larger sizes, it relies on the page allocator
   \item The allocated area is guaranteed to be physically contiguous
   \item The allocated area size is rounded up to the next power of two
@@ -290,7 +290,7 @@
   \item \mint{c}+#include <linux/slab.h>+
   \item \mint{c}+void *kmalloc(size_t size, int flags);+
     \begin{itemize}
-    \item Allocate size bytes, and return a pointer to the area
+    \item Allocate \code{size} bytes, and return a pointer to the area
       (virtual address)
     \item \code{size}: number of bytes to allocate
     \item \code{flags}: same flags as the page allocator
@@ -318,15 +318,15 @@ kfree(work);
     \end{itemize}
   \item \mint{c}+void *kcalloc(size_t n, size_t size, gfp_t flags);+
     \begin{itemize}
-    \item Allocates memory for an array of n elements of size size,
-      and zeroes its contents.
+    \item Allocates memory for an array of \code{n} elements of
+      \code{size} size, and zeroes its contents.
     \end{itemize}
   \item \mint{c}+void *krealloc(const void *p, size_t new_size,+
     \mint{c}+gfp_t flags);+
     \begin{itemize}
     \item Changes the size of the buffer pointed by \code{p} to
       \code{new_size}, by reallocating a new buffer and copying the
-      data, unless the \code{new_size} fits within the alignment of
+      data, unless \code{new_size} fits within the alignment of
       the existing buffer.
     \end{itemize}
   \end{itemize}
@@ -335,7 +335,7 @@ kfree(work);
 \begin{frame}[fragile]
   \frametitle{vmalloc Allocator}
   \begin{itemize}
-  \item The vmalloc allocator can be used to obtain virtually
+  \item The \code{vmalloc} allocator can be used to obtain virtually
     contiguous memory zones, but not physically contiguous. The
     requested memory size is rounded up to the next page.
   \item The allocated area is in the kernel space part of the address
@@ -362,7 +362,7 @@ kfree(work);
     \item \code{Kmemcheck}
       \begin{itemize}
       \item Dynamic checker for access to uninitialized memory.
-      \item Only available on x86 so far (Linux 3.3 status), but will
+      \item Only available on \code{x86} so far (Linux 3.6 status), but will
         help to improve architecture independent code anyway.
       \item See \code{Documentation/kmemcheck.txt} for details.
       \end{itemize}
diff --git a/slides/kernel-driver-development-modules/kernel-driver-development-modules.tex b/slides/kernel-driver-development-modules/kernel-driver-development-modules.tex
index 40fd673..6926b81 100644
--- a/slides/kernel-driver-development-modules/kernel-driver-development-modules.tex
+++ b/slides/kernel-driver-development-modules/kernel-driver-development-modules.tex
@@ -58,8 +58,8 @@ MODULE_AUTHOR("William Shakespeare");
     \end{itemize}
   \item An initialization function
     \begin{itemize}
-    \item Called when the module is loaded, returns an error code (0
-      on success, negative value on failure)
+    \item Called when the module is loaded, returns an error code
+      (\code{0} on success, negative value on failure)
     \item Declared by the \code{module_init()} macro: the name of the
       function doesn't matter, even though \code{<modulename>_init()}
       is a convention.
@@ -155,7 +155,7 @@ MODULE_AUTHOR("William Shakespeare");
 \begin{frame}[fragile]
   \frametitle{Compiling an out-of-tree Module 1/2}
   \begin{itemize}
-  \item The below Makefile should be reusable for any single-file
+  \item The below \code{Makefile} should be reusable for any single-file
     out-of-tree Linux module
   \item The source file is \code{hello.c}
   \item Just run make to build the hello.ko file
@@ -200,7 +200,8 @@ endif
   \frametitle{Modules and Kernel Version}
   \begin{itemize}
   \item To be compiled, a kernel module needs access to the kernel
-    headers, containing the functions, types and constants definitions
+    headers, containing the definitions of functions, types and
+    constants.
   \item Two solutions
     \begin{itemize}
     \item Full kernel sources
@@ -214,7 +215,7 @@ endif
   \item A kernel module compiled against version X of kernel headers
     will not load in kernel version Y
     \begin{itemize}
-    \item modprobe/insmod will say \emph{Invalid module format}
+    \item \code{modprobe} / \code{insmod} will say \code{Invalid module format}
     \end{itemize}
   \end{itemize}
 \end{frame}
@@ -227,10 +228,10 @@ endif
     \item Add your new source file to the appropriate source
       directory. Example: \code{drivers/usb/serial/navman.c}
     \item Single file drivers in the common case, even if the file is
-      several thousand lines of code. Only really big drivers are
+      several thousand lines of code big. Only really big drivers are
       split in several files or have their own directory.
     \item Describe the configuration interface for your new driver by
-      adding the following lines to the Kconfig file in this
+      adding the following lines to the \code{Kconfig} file in this
       directory:
     \end{itemize}
 {\footnotesize
@@ -249,9 +250,10 @@ config USB_SERIAL_NAVMAN
 \begin{frame}
   \frametitle{New Driver in Kernel Sources 2/2}
   \begin{itemize}
-  \item Add a line in the Makefile file based on the Kconfig setting:
+  \item Add a line in the \code{Makefile} file based on the
+\code{Kconfig} setting:
     \code{obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o}
-  \item It tells the kernel build system to build navman.c when the
+  \item It tells the kernel build system to build \code{navman.c} when the
     \code{USB_SERIAL_NAVMAN} option is enabled. It works both if
     compiled statically or as a module.
     \begin{itemize}
@@ -270,17 +272,17 @@ config USB_SERIAL_NAVMAN
   \item The old school way
     \begin{itemize}
     \item Before making your changes, make sure you have two kernel
-      trees: \code{cp -a linux-2.6.37/ linux-2.6.37-patch/}
-    \item Make your changes in \code{linux-2.6.37-patch/}
+      trees: \code{cp -a linux-3.5.5/ linux-3.5.5-patch/}
+    \item Make your changes in \code{linux-3.5.5-patch/}
     \item Run \code{make distclean} to keep only source files.
     \item Create a patch file:
-      \code{diff -Nur linux-2.6.37/ linux-2.6.37-patch/ > patchfile}
-    \item Not practical, does not scale to multiple patches
+      \code{diff -Nur linux-3.5.5/ linux-3.5.5-patch/ > patchfile}
+    \item Not convenient, does not scale to multiple patches
     \end{itemize}
   \item The new school ways
     \begin{itemize}
-    \item Use quilt (tool to manage a stack of patches)
-    \item Use Git (revision control system used by the Linux kernel
+    \item Use \code{quilt} (tool to manage a stack of patches)
+    \item Use \code{git} (revision control system used by the Linux kernel
       developers)
     \end{itemize}
   \end{itemize}
diff --git a/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex b/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex
index 59172fe..90ee0e1 100644
--- a/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex
+++ b/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex
@@ -64,13 +64,13 @@ init_waitqueue_head(&queue);
   \item \mint{c}+int wait_event_timeout(queue, condition, timeout);+
     \begin{itemize}
     \item Also stops sleeping when the task is woken up and the
-      timeout expired. Returns 0 if the timeout elapsed, non-zero if
+      timeout expired. Returns \code{0} if the timeout elapsed, non-zero if
       the condition was met.
     \end{itemize}
   \item \mint{c}+int wait_event_interruptible_timeout(queue,+
     \mint{c}+condition, timeout);+
     \begin{itemize}
-    \item Same as above, interruptible. Returns 0 if the timeout
+    \item Same as above, interruptible. Returns \code{0} if the timeout
       elapsed, \code{-ERESTARTSYS} if interrupted, positive value if
       the condition was met.
     \end{itemize}
diff --git a/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex b/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex
index f4b4322..68cb2d9 100644
--- a/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex
+++ b/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex
@@ -101,7 +101,7 @@
     \code{gconfig} or \code{menuconfig} interfaces
   \item You can also start the configuration from scratch without
     loading a default configuration file
-  \item As the architecture is different than your host architecture
+  \item As the architecture is different from your host architecture
     \begin{itemize}
     \item Some options will be different from the native configuration
       (processor and architecture specific options, specific drivers,
@@ -123,7 +123,7 @@
     \item can be \code{uImage}, \code{zImage}, \code{vmlinux},
       \code{bzImage} in \code{arch/<arch>/boot}
     \end{itemize}
-  \item make install is rarely used in embedded development, as the
+  \item \code{make install} is rarely used in embedded development, as the
     kernel image is a single file, easy to handle
     \begin{itemize}
     \item It is however possible to customize the make install
diff --git a/slides/sysdev-linux-intro-modules/sysdev-linux-intro-modules.tex b/slides/sysdev-linux-intro-modules/sysdev-linux-intro-modules.tex
index 812576b..4f23cb0 100644
--- a/slides/sysdev-linux-intro-modules/sysdev-linux-intro-modules.tex
+++ b/slides/sysdev-linux-intro-modules/sysdev-linux-intro-modules.tex
@@ -10,7 +10,7 @@
   \item Also useful to reduce boot time: you don't spend time
     initializing devices and kernel features that you only need later.
   \item Caution: once loaded, have full control and privileges in the
-    system. No particular protection. That's why only the root user
+    system. No particular protection. That's why only the \code{root} user
     can load and unload modules.
   \end{itemize}
 \end{frame}
diff --git a/slides/sysdev-root-filesystem-contents/sysdev-root-filesystem-contents.tex b/slides/sysdev-root-filesystem-contents/sysdev-root-filesystem-contents.tex
index faa2517..cf20fba 100644
--- a/slides/sysdev-root-filesystem-contents/sysdev-root-filesystem-contents.tex
+++ b/slides/sysdev-root-filesystem-contents/sysdev-root-filesystem-contents.tex
@@ -35,7 +35,7 @@
 \begin{frame}
   \frametitle{Important directories (2)}
   \begin{description}
-  \item[/root]Home directory of the root user
+  \item[/root]Home directory of the \code{root} user
   \item[/sbin]Basic system programs
   \item[/sys]Mount point of the sysfs virtual filesystem
   \item[/tmp]Temporary files



More information about the training-materials-updates mailing list