| It doesn't really work like that. It's more like this:
1. A program tries to access the first sound card (for example by opening /dev/dsp).
2. The kernel gets the open request, and passes it on to the sound core driver multiplexer.
3. It, in turn, looks in its tables of installed sound cards. Assuming no sound module has been loaded, it will find nothing for the first sound card.
4. It then makes a request back to userspace to modprobe for snd-card-0 (zero as in the first DSP device). This kernel thread is now blocked.
5. Modprobe gets run in userspace, finds the alias for snd-card-0 and requests to the kernel to load the snd-intel8x0 module.
6. The module is loaded and its initialization code is run. The initialization function makes a request to the sound core driver multiplexer to register it as a sound card driver. The multiplexer does so, registering it as the first sound card.
7. The initialization function returns and modprobe terminates. The first kernel thread is then resumed, and it checks again for the first sound card, which now exists.
8. It passes the open request on to the snd-intel8x0 module, which performs it, and lets the thread return into userspace, to the program that called open on /dev/dsp.
So you see, the module names aren't used at all in the kernel. That's why they need a mapping in userspace. |