[FE training-materials-updates] Kernel slides: simplify hello.c example
Michael Opdenacker
michael.opdenacker at free-electrons.com
Tue Feb 4 13:31:28 CET 2014
Repository : git://git.free-electrons.com/training-materials.git
On branch : master
Link : http://git.free-electrons.com/training-materials/commit/?id=a4775a5f56be2c3f76eaab9a95421147a87adbb2
>---------------------------------------------------------------
commit a4775a5f56be2c3f76eaab9a95421147a87adbb2
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date: Tue Feb 4 13:29:21 2014 +0100
Kernel slides: simplify hello.c example
- There was a missing space at the beginning of the second
pr_alert string (the first one has no \n)
- Put the code download URL in cgit, easier to keep in sync
- Misc minor fixes
Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>
>---------------------------------------------------------------
a4775a5f56be2c3f76eaab9a95421147a87adbb2
code/hello/hello.c | 6 ++----
.../kernel-i2c-communication.tex | 4 ++--
.../kernel-driver-development-modules.tex | 16 +++++++---------
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/code/hello/hello.c b/code/hello/hello.c
index 919231d..bd584de 100644
--- a/code/hello/hello.c
+++ b/code/hello/hello.c
@@ -5,15 +5,13 @@
static int __init hello_init(void)
{
- pr_alert("Good morrow");
- pr_alert("to this fair assembly.\n");
+ pr_alert("Good morrow to this fair assembly.\n");
return 0;
}
static void __exit hello_exit(void)
{
- pr_alert("Alas, poor world, what treasure");
- pr_alert("hast thou lost!\n");
+ pr_alert("Alas, poor world, what treasure hast thou lost!\n");
}
module_init(hello_init);
diff --git a/labs/kernel-i2c-communication/kernel-i2c-communication.tex b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
index d94516e..6f564e6 100644
--- a/labs/kernel-i2c-communication/kernel-i2c-communication.tex
+++ b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
@@ -100,7 +100,7 @@ am33xx_pinmux: pinmux at 44e10800 {
The base address is \code{0x44e10800} instead of \code{0x44e10000} in
the datasheet! The value in the DTS is \code{0x800} greater, which
-matches the different in the offsets.
+matches the difference in the offsets.
Why this difference? If you get back to the big TRM document where
the offsets are defined, you will see that below the \code{0x800}
@@ -275,7 +275,7 @@ when one of the buttons is pressed.
Compile your module, and reload it. No button presses should be
detected. Remove your module.
-Now hold the \code{Z} and reload and remove your module again:
+Now hold the \code{Z} button and reload and remove your module again:
\begin{verbatim}
insmod /root/nunchuk/nunchuk.ko; rmmod nunchuk
\end{verbatim}
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 9a449c3..85841aa 100644
--- a/slides/kernel-driver-development-modules/kernel-driver-development-modules.tex
+++ b/slides/kernel-driver-development-modules/kernel-driver-development-modules.tex
@@ -10,15 +10,13 @@
static int __init hello_init(void)
{
- pr_alert("Good morrow");
- pr_alert("to this fair assembly.\n");
+ pr_alert("Good morrow to this fair assembly.\n");
return 0;
}
static void __exit hello_exit(void)
{
- pr_alert("Alas, poor world, what treasure");
- pr_alert("hast thou lost!\n");
+ pr_alert("Alas, poor world, what treasure hast thou lost!\n");
}
module_init(hello_init);
@@ -41,7 +39,7 @@ MODULE_AUTHOR("William Shakespeare");
\item discarded when module compiled statically into the kernel.
\end{itemize}
\item Example available on
- \url{http://free-electrons.com/doc/c/hello.c}
+ \url{http://git.free-electrons.com/training-materials/plain/code/hello/hello.c}
\end{itemize}
\end{frame}
@@ -291,7 +289,7 @@ module_param(howmany, int, 0);
\begin{frame}[fragile]
\frametitle{Hello Module with Parameters 2/2}
-\begin{minted}[fontsize=\small]{c}
+\begin{minted}[fontsize=\footnotesize]{c}
static int __init hello_init(void)
{
int i;
@@ -308,9 +306,9 @@ static void __exit hello_exit(void)
module_init(hello_init);
module_exit(hello_exit);
\end{minted}
-Thanks to Jonathan Corbet for the example!
-
-Example available on \url{http://free-electrons.com/doc/c/hello_param.c}
+Thanks to Jonathan Corbet for the example!\\
+Source code available on: {\small
+\url{http://git.free-electrons.com/training-materials/plain/code/hello-param/hello_param.c}}
\end{frame}
\begin{frame}[fragile]
More information about the training-materials-updates
mailing list