Hello World module.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sun, 16 May 2010 16:03:49 +0000 (13:03 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sun, 16 May 2010 16:03:49 +0000 (13:03 -0300)
Found many problems with the doc tools.

02hello/hello [new file with mode: 0644]

diff --git a/02hello/hello b/02hello/hello
new file mode 100644 (file)
index 0000000..9fd20b5
--- /dev/null
@@ -0,0 +1,72 @@
+%Linux Hello World
+%Thadeu Cascardo
+
+# Module Tools
+
+* lsmod
+* insmod
+* rmmod
+* modprobe
+* modinfo
+* depmod
+
+# Module Files
+
+* /lib/modules/
+* /proc/modules
+* /sys/module/
+
+# Module parameters
+
+* modinfo output
+* modprobe configuration files
+* /sys/module/*/parameters/
+
+# Headers
+
+include/linux/module.h
+include/linux/init.h
+
+# Init and Exit Functions
+
+We use *module\\_init* and *module\\_exit* to declare our init and exit
+functions.
+
+The *\\_\\_init* and *\\_\\_exit* marks allow the kernel to remove them when
+they are not needed, reducing memory consumption.
+
+# printk
+
+*printk* is very similar to printf. The messages are usually preceded by a
+string in the form \<n\>, where *n* is a priority. There are macros, like
+*KERN\\_ALERT* and *KERN\\_DEBUG* to use for that.
+
+# License and taint
+
+*MODULE\\_LICENSE* 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.
+
+# Building out-of-tree
+
+Building an out-of-tree linux module is very simple:
+
+FIX_ME
+       $ make -C /lib/modules/`uname -r`/build M=$PWD modules
+
+# Module description definitios
+
+* MODULE\\_AUTHOR
+* MODULE\\_LICENSE
+* MODULE\\_DESCRIPTION
+* MODULE\\_INFO
+* MODULE\\_ALIAS
+* MODULE\\_VERSION
+
+# Module parameters
+
+Besides *MODULE\\_PARM\\_DESC* to inform user about the parameter, we must use
+*module\\_param*.
+
+FIX_ME
+       module_param(name, type, perm);