Well after my rant last night I would like to actually work out how modules are supposed to work as I don't seem to understand them very well at the moment!
So, to some rather basic questions:-
How do modules get installed (as in attached to the kernel when the system starts up)? In my previous encounters with modules I think it was a totally manual process in that one had to add the required modprobe command to the rc files. Is this still true or is there some sort of automatic process that does this nowadays?
What does setting a device to [M] in the kernel configuration actually do? It can't be necessary for a module to work as otherwise one wouldn't be able to add new modules would you? (E.g. I seem to have added my RTL8168 module by just compiling it and installing it, it doesn't appear in the kernel configuration - or does it?)
By the way my problems with the RTL8168 module seem to be down to the fact that the rc.modules script was linked to a 2.4.33 version rather than the 2.6.18 version which it should have been linked to. Fixing this seems to have made things work rather better.
On Wednesday 18 October 2006 10:29, cl@isbd.net wrote:
How do modules get installed (as in attached to the kernel when the system starts up)? In my previous encounters with modules I think it was a totally manual process in that one had to add the required modprobe command to the rc files. Is this still true or is there some sort of automatic process that does this nowadays?
You can install modules with modprobe (remove them with rmmod, and list the currently installed ones with lsmod, though I'm sure you know that). In Debian, you can add the names of any additional modules you want to be installed at boot to the file /etc/modules. I'm not sure how other distros handle this. However, at least on my machine, the boot process is pretty good at finding all the hardware I have and automatically installing the modules it needs.
What does setting a device to [M] in the kernel configuration actually do? It can't be necessary for a module to work as otherwise one wouldn't be able to add new modules would you? (E.g. I seem to have added my RTL8168 module by just compiling it and installing it, it doesn't appear in the kernel configuration - or does it?)
If you set a module to M in the kernel config, the kernel builder will compile it as a module (the other options are to have in compiled into the main kernel binary, or not compiled at all - in which case its unavailable). Any LKM compatible binary can be installed into a running kernel, it doesn't have to been shipped with the kernel distribution or compiled by the kernel builder. If you compile and install a kernel module independently of the main kernel source then, no, it won't appear in the kernel config. (The principal situation where 3rd party modules /would/ be included in the kernel config is when they need to be compiled into the main kernel binary, in which case the distributor will most likely produce diffs to be applied to the kernel source.)
Cheers, Richard
On Wed, Oct 18, 2006 at 10:50:55AM +0100, Richard Lewis wrote:
On Wednesday 18 October 2006 10:29, cl@isbd.net wrote:
How do modules get installed (as in attached to the kernel when the system starts up)? In my previous encounters with modules I think it was a totally manual process in that one had to add the required modprobe command to the rc files. Is this still true or is there some sort of automatic process that does this nowadays?
You can install modules with modprobe (remove them with rmmod, and list the currently installed ones with lsmod, though I'm sure you know that). In Debian, you can add the names of any additional modules you want to be installed at boot to the file /etc/modules. I'm not sure how other distros handle this. However, at least on my machine, the boot process is pretty good at finding all the hardware I have and automatically installing the modules it needs.
My Slackware seems pretty like your Debian.
However my problem is how do I know when "the boot process is pretty good at finding all the hardware I have and automatically installing the modules" and when it isn't? It seems a bit vague to me, most of the time it's essentially transparent and then sometimes it isn't.
What does setting a device to [M] in the kernel configuration actually do? It can't be necessary for a module to work as otherwise one wouldn't be able to add new modules would you? (E.g. I seem to have added my RTL8168 module by just compiling it and installing it, it doesn't appear in the kernel configuration - or does it?)
If you set a module to M in the kernel config, the kernel builder will compile it as a module (the other options are to have in compiled into the main kernel binary, or not compiled at all - in which case its unavailable). Any LKM compatible binary can be installed into a running kernel, it doesn't have to been shipped with the kernel distribution or compiled by the kernel builder. If you compile and install a kernel module independently of the main kernel source then, no, it won't appear in the kernel config. (The principal situation where 3rd party modules /would/ be included in the kernel config is when they need to be compiled into the main kernel binary, in which case the distributor will most likely produce diffs to be applied to the kernel source.)
Ah, yes, so [M} just means do what I did manually for my added in module when the kernel is built so that the driver is available as a module if needed. OK, that's cleared that up anyway, thanks.