Work in progress - Not Complete!!
Some notes regarding where to look for kernel modules in running Linux system.
How modules/device drivers are loaded into a typical Linux distribution
Some useful things to look at on a running Linux system
Look at the contents of file /proc/modules.
Entering this at the shell prompt:
#cat /proc/modules
will produce output that looks like this:
sr_mod 16920 0 (autoclean)
cdrom 32192 0 (autoclean) [sr_mod]
edt 72500 0 (unused)
binfmt_misc 7556 1
parport_pc 18724 1 (autoclean)
lp 8864 0 (autoclean)
parport 34208 1 (autoclean) [parport_pc lp]
autofs 12164 0 (autoclean) (unused)
eepro100 20336 1
sb 9152 1
sb_lib 40416 0 [sb]
uart401 7936 0 [sb_lib]
sound 72012 1 [sb_lib uart401]
soundcore 6692 5 [sb_lib sound]
usb-uhci 24484 0 (unused)
usbcore 73152 1 [usb-uhci]
ext3 67136 7
jbd 49400 7 [ext3]
aic7xxx 124768 8
sd_mod 12864 16
scsi_mod 108576 3 [sr_mod aic7xxx sd_mod]
The first column indicates the name of the driver (minus the typical ".o").
The second column indicates the running module size.
Q:code or data size??
The third column indicates the reference count of the module.
'[]' indicates a list of dependencies when using stacked modules.
depmode :
modules.dep file :
The /proc directory
This is where a list of running modules is available. You can do typical things like:
cmdline
cpuinfo
Lots of useful info on your CPU.
devices
List of character and block devices organized around their Major Numbers
dma
Info about DMA channel usage
execdomains
fb
filesystems
interrupts
iomem
A list of physical memory addresses related to hardware devices; reported as:
Memory_range : Device_or_structure_name
For Intel processors, Memory_range is reported as a set of hex numbers
indicating memory space occupied by given device or data structure (sometimes
referred to as the "owner" of the memory area).
ioports
A list of I/O ports related to hardware devices. Each entry is listed as:
Device_range : Device_name
where Device_range is a set of hex numbers indicating I/O port addresses and
Device_name indicates name of device (typically controlled by module)
kcore
kmsg
ksyms
Exported kernel symbols; useful for finding entries in modules
loadavg
locks
mdstat
meminfo
misc
modules
List of running modules, formatted as follows:
Name_of_module Number_of_bytes_used Current_usage_count [options]
[options] can include things like:
(autoclean)
- module is managed by kmod or kerneld
(unused)
- module is currently not being used
mtrr
partitions
pci
PCI device tree;
slabinfo
stat
swaps
uptime
version
Installing and removing modules
insmod
rmmod