If you have a Plug and Play device, it will know how to talk to the driver which will tell its IRQ, DMA, etc... So you don't need to know about them. That's cool.
Easy case: the driver for you device is included in the kernel distribution. The magic word is:
#modconf |
Medium case: you need to recompile your kernel. Usually that's because you're not using a standard kernel, or because your hardware is a bit too 'exotic'. You need to recompile your kernel (no big deal, usually). Since we at Newbiedoc think things ahead, there is a Kernel Compiling Doc.
Patching a kernel: sometimes patches are available that modify your kernel source. To apply a patch:
cd /usr/src/kernel-source-xx.yy.zz cat my_patch | patch -p0 |
Hard case: You got the driver from elsewhere. Don't worry, it's not that bad. You need first to compile it, then to try and load it, and then have it done automatically at boot-time. Next section is for you ( feel privileged huh ?)
For those whose driver is not included in the standard kernel
The standard way is to uncompress the source somewhere:
tar zxvf driver-src.tgz |
cd unpacked_source_directory ./configure |
make |
#make install |
OK, so now the driver is compiled and ready for testing.
Now, I'll assume you are root, so I'll prefix all commands with a '#'.
#modprobe my_new_driver |
#lsmod |
#rmmod my_new_driver |
Since the driver can't read IRQ DMA (etc) values from the board, that means you'll have to tell it at load-time.
Aside from that, it's the same as for PnP devices, so refer to what I wrote above. You'll need to add info either when using 'modconf', when compiling the kernel, or when loading the driver 'by hand'.
Usually you need at least to tell the module the IRQ of the device it's talking to, and possibly some other stuff. This should load a good ol'SoundBlaster:
#insmod sb irq=7 io=0x220 dma=1 dma16=6 |
Check if the insmod succeeded by doing
#lsmod |
There are two ways for modules to be loaded:
If they are needed by another module, or by a program (such as X).
If they appear in /etc/modules
To automatically load a module, just write its name in the file /etc/modules , without any options or path, just the name (such a 'sb','ne2k-pci','vfat', etc...)
So where do I put the options ? Add a file to the /etc/modutils (the name doesn't matter). The syntax would then be:
options sb irq 7 io 0x220 dma 1 dma16 5 |
alias char-major-195 NVdriver |
When all is done, do as root:
#update-modules |
OK so to sum up:
Standard Modules
as root do
#modconf |
Non Standard Modules
Compile the driver
Find the correct settings using
#insmod my_module irq XX dma YY other_option ZZ |
Add a file in /etc/modutils containing these settings (if no setting is needed, then no file is required). And run
#update-modules |
Try to load the module with
#modprobe my_module |
If you want (or need), reference your module in /etc/modules.
Have fun...