[Kos-cvs] kos/doc helloworld.tex,1.1,1.2

thomas at kos.enix.org thomas at kos.enix.org
Tue Jan 18 21:47:00 CET 2005


Update of /home/kos/cvs/kos/doc
In directory the-doors:/tmp/cvs-serv17926/doc

Modified Files:
	helloworld.tex 
Log Message:
2005-01-18  Thomas Petazzoni  <thomas at crazy.kos.nx>

	* doc/helloworld.tex: Modifications suggested by David Mentré.



Index: helloworld.tex
===================================================================
RCS file: /home/kos/cvs/kos/doc/helloworld.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- helloworld.tex	15 Jan 2005 23:07:41 -0000	1.1
+++ helloworld.tex	18 Jan 2005 20:46:57 -0000	1.2
@@ -84,9 +84,9 @@
 that has the name of the module, in our case, it will be {\tt
 helloworld.c}. This file should contain nothing except initialisation
 and cleanup routines, and symbol export directives (see
-\ref{export-symbols}). 
+\ref{export-symbols}).
 
-There are two kinds of initialisation routines :
+There are two kinds of initialisation routines:
 
 \begin{itemize}
 
@@ -110,7 +110,7 @@
 
 As our {\em Hello World} module doesn't contain any low-level feature,
 we'll only use a {\tt post init} initialisation routine, that we'll
-put at level 0 ;
+put at level 0:
 
 \begin{lstlisting}[caption=Initialisation routine]
 __init_text static int post_init_module_level0
@@ -118,7 +118,7 @@
 {
    UNUSED(kp);
 
-   printk("(Init module helloworld... Ok)");
+   printk("(Init module helloworld... Ok)\n");
    return 0;
 }
 \end{lstlisting}
@@ -144,7 +144,7 @@
 placed after all local variables declaration.
 
 Now, we have to register this function as an initialisation routine,
-using the following statement :
+using the following statement:
 
 \begin{lstlisting}[caption=Initialisation routine declaration]
 DECLARE_INIT_SYMBOL(post_init_module_level0, POST_INIT_LEVEL0);
@@ -167,7 +167,7 @@
 {
    UNUSED(kp);
 
-   printk("(Init module helloworld... Ok)");
+   printk("(Init module helloworld... Ok)\n");
    return 0;
 }
 
@@ -178,7 +178,7 @@
 \label{compilation}
 
 In order to compile our module, we need to set up a simple {\tt
-  Makefile}, in the module directory :
+  Makefile}, in the module directory:
 
 \begin{lstlisting}[caption={\tt Makefile} for the {\em Hello World} module]
 OBJS=  helloworld.o
@@ -193,7 +193,7 @@
 
 The {\tt OBJS} variables must contain the name of all object files
 that must be compiled in the module. {\tt helloworld.ro} is the result
-of the compilation : it is the module itself, usable by the
+of the compilation: it is the module itself, usable by the
 loader. Using that {\tt Makefile}, you can now compile your module by
 simply typing {\tt make}.
 
@@ -225,17 +225,17 @@
    \label{fig:screenshot}
 \end{figure}
 
-\section{Module functionalities, exporting symbols}
+\section{Module features, exporting symbols}
 
 Your {\em Hello World} module is very simple for the moment. Let's add
-some functionalities to it. The first one is an internal function of
-the module, which can be called only inside the module. This function
-will be called {\tt hello\_inside}. The second one is a function which
-is going to be exported, which means that other modules will be able
-to call it.
+some features to it. The first one is an internal function of the
+module, which can be called only inside the module. This function will
+be called {\tt hello\_inside}. The second one is a function which is
+going to be exported, which means that other modules will be able to
+call it.
 
-All module functionalities should be implemented in C source files
-whose names start with an underscore. In our example, the code will be
+All module features should be implemented in C source files whose
+names start with an underscore. In our example, the code will be
 stored inside the {\tt \_helloworld.c} file.
 
 \begin{lstlisting}[caption=The code of the {\em Hello World} module]
@@ -285,8 +285,8 @@
 \end{lstlisting}
 
 Now, we can modify the {\tt helloworld.c} file to use the {\tt
-  hello\_inside} function and to export the {\tt hello\_outside}
-  function :
+hello\_inside} function and to export the {\tt hello\_outside}
+function:
 
 \begin{lstlisting}[caption={\tt helloworld.c} source code]
 #include <loader/mod.h>
@@ -299,7 +299,7 @@
 {
    UNUSED(kp);
 
-   printk("(Init module helloworld... Ok)");
+   printk("(Init module helloworld... Ok)\n");
    hello_inside();
    return 0;
 }
@@ -308,6 +308,14 @@
 DECLARE_INIT_SYMBOL(post_init_module_level0, POST_INIT_LEVEL0);
 \end{lstlisting}
 
+Since our module has several C source files, we need to modify the
+{\tt Makefile} accordingly. The {\tt OBJS} variable of the {\tt
+  Makefile} must be modified to:
+
+\begin{lstlisting}[caption={\tt OBJS} variable of the {\tt Makefile}]
+OBJS= helloworld.o _helloworld.o
+\end{lstlisting}
+
 \section{Various coding conventions}
 
 \subsection{File naming}
@@ -360,5 +368,3 @@
 \end{itemize}
 
 \end{document}
-
-



More information about the Kos-cvs mailing list