Added functions to move memory to and from user space.
[cascardo/kernel/old_slides/.git] / 01.hello / 01.hello.xml
index 954422f..9eb0458 100644 (file)
@@ -15,6 +15,14 @@ Let's take a look at how linux modules work.
 </para>
 </foil>
 
+<foil>
+<title>Building Linux</title>
+<para>
+But, first, we will build Linux. The procedure is configuring, building and
+installing. Try <screen>make help</screen>.
+</para>
+</foil>
+
 <foil>
 <title>Requirements</title>
 <para>
@@ -37,16 +45,36 @@ We have prepared sample code to build in the samples/ directory. Try them.
 <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.
+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.
+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>License and taint</title>
+<para>
+<emphasis>MODULE\_LICENSE</emphasis> is highly recommended. A free software
+license should be used, otherwise the kernel is tainted. This indicates to
+developers that something has gone wrong, and some bug reports are ignored some
+times.
 </para>
 </foil>
 
@@ -102,4 +130,15 @@ MODULE\_ALIAS
 </itemizedlist>
 </foil>
 
+<foil>
+<title>Module parameters</title>
+<para>
+Besides <emphasis>MODULE\_PARM\_DESC</emphasis> to inform user about the
+parameter, we must use <emphasis>module\_param</emphasis>.
+</para>
+<screen>
+module_param(name, type, perm);
+</screen>
+</foil>
+
 </slides>