Hehe, well, you can always do evil things like write your own custom
kernel module to find the module in question and play around with it's
data structure (change status flag, usecount, etc). The important data
structure when trying to hack together a forced module unloader is the
module structure defined in /usr/src/linux/include/linux/module.h. In the
2.4 Kernels, I don't think you still have the 'module_list' linked list
exported, but you DO have '__this_module', which is really the top of the
stack, as far as you're concerned. You can search, for your module by
looking at module->name and comparing it to your desired module name,
starting at __this_module and moving forward ("using the linked list's
'next' pointer").
I had to do this once to unload a crashed vmware module. It had a usage
count, when in reality after closely inspecting the source code, I
realized that usage count was bogus. So I wrote a kernel module to seek
out the dead vmware module and decrease its usage count. Then I was able
to safely remove it using rmmod (calls the delete_module system call). I
still have the source to my hackish vmware unloader, if you want to
inspect it.
So, if your module isn't actually in use by another module, and even if it
didn't finish initializing, you can still do this, just by playing with
the module struct in the kernel pertaining to your module. Probably the
two important fields in that module struct are 'usecount' and 'flags',
when it comes to forcing your module to unload.
Good luck and happy hacking! And remember.. any advice i have given you
above is strictly unorthodox! Really, rebooting is probably the safest
thing :)
-Calin
On Wed, 5 Sep 2001, Thamm, Russell wrote:
> Hi,
>
> I apparently have an error in init_module() and I get an exception message:
>
> /usr/bin/rtlinux: line 161: 3155 Segmentation fault ${INSMOD} $modules
>
> when I load the module.
>
> However, after this I cannot unload the module :
>
> Device or resource busy.
>
> Is there any way to recover from this apart from rebooting?
>
> thanks
> Russell Thamm
>
>
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
>
>
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/