Fix presentation build.
[cascardo/kernel/old_slides/.git] / 01.hello / 01.hello.xml
index 19aad0f..b6b2969 100644 (file)
 <foil>
 <title>Introduction</title>
 <para>
+Let's take a look at how linux modules work.
+</para>
+</foil>
+
+<foil>
+<title>Requirements</title>
+<para>
+We need the tools to build a module and a building linux tree. Running the built
+linux kernel is highly recommended so we can test our modules.
+</para>
+<para>
+The tools include GNU make, GCC and GNU binutils. Linux build is highly
+dependent on the GNU toolchain, since the beginning.
+</para>
+</foil>
+
+<foil>
+<title>Hands-on</title>
+<para>
 We have prepared sample code to build in the samples/ directory. Try them.
 </para>
 </foil>
 
+<foil>
+<title>Init and Exit Functions</title>
+<para>
+We use <emphasis>module\_init</emphasis> and <emphasis>module\_exit</emphasis>
+to declare our init and exit functions.
+</para>
+</foil>
+
+<foil>
+<title>Init and Exit Functions</title>
+<para>
+The <emphasis>\_\_init</emphasis> and <emphasis>\_\_exit</emphasis> marks allow
+the kernel to remove them when they are not needed, reducing memory consumption.
+</para>
+</foil>
+
+<foil>
+<title>printk</title>
+<para>
+<emphasis>printk</emphasis> is very similar to printf. The messages are usually
+preceded by a string in the form &lt;n&gt;, where <emphasis>n</emphasis> is a
+priority. There are macros, like <emphasis>KERN\_ALERT</emphasis> and
+<emphasis>KERN\_DEBUG</emphasis> to use for that.
+</para>
+</foil>
+
 <foil>
 <title>Building</title>
 <para>
@@ -25,4 +70,46 @@ $ make -C /lib/modules/`uname -r`/build M=$PWD modules
 </screen>
 </foil>
 
+<foil>
+<title>Module Tools</title>
+<itemizedlist>
+<listitem>
+insmod
+</listitem>
+<listitem>
+rmmod
+</listitem>
+<listitem>
+modprobe
+</listitem>
+<listitem>
+modinfo
+</listitem>
+<listitem>
+depmod
+</listitem>
+</itemizedlist>
+</foil>
+
+<foil>
+<title>Module Description Definitions</title>
+<itemizedlist>
+<listitem>
+MODULE\_AUTHOR
+</listitem>
+<listitem>
+MODULE\_DESCRIPTION
+</listitem>
+<listitem>
+MODULE\_VERSION
+</listitem>
+<listitem>
+MODULE\_LICENSE
+</listitem>
+<listitem>
+MODULE\_ALIAS
+</listitem>
+</itemizedlist>
+</foil>
+
 </slides>