[Date Prev][Date Next][Date Index]
[linux] Linux module programming notes
These are some of my notes for linux module programming.
1. You can see what modules are already loaded into the kernel by running
lsmod, which reads /proc/modules. You can also cat this file, too.
2. kmod is a linux kernel daemon.. It uses modprobe to load needed
modules... check what modules are available in /etc/modules.conf
for e.g. cat /etc/modules.conf produces the following o/p
alias parport_lowlevel parport_pc
alias eth0 3c59x
alias usb-controller usb-uhci
alias sound-slot-0 cs4232
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null
2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null
2>&1 || :
options sound dmabuf=1
alias synth0 opl3
options opl3 io=0x388
options cs4232 isapnp=1
after the 'alias' the first parameter is a generic identifier of the
module.. the second argument is the module name..
U can find where is parport_pc.o located by catting
/lib/modules/2.4.7-10/modules.dep
This location is passed to insmod..
insmod check for all the dependencies of this module on other modules and
loads them into the kernel.