The Linux Kernel Module Programming Guide

4 views
Skip to first unread message

Copper Hill

unread,
Apr 22, 2009, 10:07:09 PM4/22/09
to worldhunter
Kernel modules are different here, too. In the hello world example,
you might have noticed that we used a function, printk() but didn't
include a standard I/O library. That's because modules are object
files whose symbols get resolved upon insmod'ing. The definition for
the symbols comes from the kernel itself; the only external functions
you can use are the ones provided by the kernel. If you're curious
about what symbols have been exported by your kernel, take a look at /
proc/kallsyms.

The 2nd man section is devoted to system calls (like kill() and read
(). The 3rd man section is devoted to library calls, which you would
probably be more familiar with (like cosh() and random()).

The major number tells you which driver is used to access the
hardware. Each driver is assigned a unique major number; all device
files with the same major number are controlled by the same driver.
The minor number is used by the driver to distinguish between the
various hardware it controls.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages