1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE slides SYSTEM "/usr/share/xml/docbook/custom/slides/3.3.1/schema/dtd/slides-full.dtd">
7 <title>Hello World Module</title>
8 <author><firstname>Thadeu</firstname><surname>Cascardo</surname></author>
12 <title>Introduction</title>
14 Let's take a look at how linux modules work.
19 <title>Requirements</title>
21 We need the tools to build a module and a building linux tree. Running the built
22 linux kernel is highly recommended so we can test our modules.
25 The tools include GNU make, GCC and GNU binutils. Linux build is highly
26 dependent on the GNU toolchain, since the beginning.
31 <title>Hands-on</title>
33 We have prepared sample code to build in the samples/ directory. Try them.
38 <title>Init and Exit Functions</title>
40 We use <emphasis>module_init</emphasis> and <emphasis>module_exit</emphasis> to
41 declare our init and exit functions.
46 <title>Init and Exit Functions</title>
48 The <emphasis>__init</emphasis> and <emphasis>__exit</emphasis> marks allow the
49 kernel to remove them when they are not needed, reducing memory consumption.
54 <title>Building</title>
56 Building an out-of-tree linux module is very simple:
59 $ make -C /lib/modules/`uname -r`/build M=$PWD modules
64 <title>Module Tools</title>
85 <title>Module Description Definitions</title>