[openbeos] get_next_loaded_module_name()

  • From: François Revol <revol@xxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 24 Apr 2002 00:24:28 +0200 (MEST)

Hi !
I managed to write a /dev/misc/lsmodules driver, which lists loaded 
kernel modules.

grab it at:
http://clapcrest.free.fr/revol/beos/lsmodules_driver.zip

It shows some hints about get_next_loaded_module_name()'s use of the cookie
param (had a hard time, thinking it incremented it by one on each iteration,
which it doesn't do). The cookie is the internal id of the module, which 
is a unique int assigned from a number starting from 1 and incrementing 
on each call to load_module().
The list is parsed bottom-up, that is it begins by the last loaded module
(highest id)
This way it ensures that the function doesn't miss one in the list.

It also can be of use to kernel developpers (including net team)
for debug purposes, as it shows the order of modules loaded.

[revol@patrick /boot/home/devel/lsmodules]$ cat /dev/misc/lsmodules
Loaded modules:
222: generic/mempool/v1
216: media/ac97_module/v2
215: generic/mpu401/v2
214: generic/gameport/v2
152: network/bone_tcp
151: network/bone_endpoint
94: network/framings/bone_ether_frame
93: network/bone_arp
92: network/interfaces/bone_ether
83: network/bone_dhcp
78: network/framings/bone_loop_frame
76: network/bone_alias
75: network/bone_ipv4
74: network/interfaces/bone_loopback
73: network/bone_datalink
72: network/bone_udp
70: network/bone_util
64: generic/gameport/v1
55: busses/config_manager/isa/pnp/v1
54: busses/config_manager/pci/v1
53: busses/config_manager/isa/onboard/v1
52: busses/config_manager/jumpered/v1
51: bus_managers/config_manager/driver/v1
48: bus_managers/config_manager/bus/v1
35: bus_managers/tty/v1
34: generic/genpool/v2
32: debugger/symbols/v1
31: debugger/parser/v1
30: debugger/internals/v1
29: debugger/i586/v1
28: debugger/gdb-stub/v1
27: debugger/disasm/v1
26: busses/ide/genericpci/v0.6
25: bus_managers/ide/v0.6
2: bus_managers/pci/v1
1: bus_managers/isa/v1

Would this be included in the tree maybe ?
Btw I still have to check rescan in :^) (where will I put it ?)
François.

Other related posts: