rom1@catsrule.garfield.com
Revision History | ||
---|---|---|
Revision v0.01 | 16 April 2001 | Revised by: rml |
Started this whole thing. |
OK, this is my second try at writing something to help newbies configuring several devices, starting with sound cards.
SGML source for this document is available. This is GPL territory.
A basic Debian installation will usually set up several peripherals, including disks (floppies, IDE and SCSI), networking devices and the screen-related stuff (if you're lucky and your video card is supported).
However, it will usually NOT include many essential devices, such as sound cards, TV cards, and a lot of other exotic boards I don't know about but which I'll help you set up.
Pre-requisites:
Well, I'll try to make it as simple as possible, to explain difficult stuff, and to guide you step by step. So I don't think any special knowledge is required, however, I'll assume you're familiar with Unix concepts such as 'kernel' and 'root' and 'compiling'. But that's all. If you don't feel like that at all, just tell me, and I'll update this paragraph.
As usual, comments, both positive (good for the mood) and negative are welcome. Really.
"Great stuff ! Keep up the good work" -- New York Time
"One of the best docs around" -- Computer Quarterly
Plug and Play is basically one thing: knowing where, and how to talk to the device. It is not directly related to autodetecting new hardware.
If your hardware is plug-and-play, as is the case with most modern stuff ( all PCI and AGP devices, and a few of the last ISA boards), you may jump directly to the section about software configuration.
Aaaahh. OK. This is for people having some really old hardware.
First thing to do:
Before even plugging in your board: let's check for free IRQ, I/O and DMA channels. Those are the channels that are used to talk to any and each piece of hardware.
cat /proc/interrupts |
cat /proc/ioports |
I don't know how to list used DMA channels.
cat /proc/dma |
Once done, take a look at your board, and the manual that comes with it. There should be jumpers (small removable plastic+metal parts) that you can plug into different places that allow you to physically change the IRQ, DMA, IO port, etc...
Use them to set your device's IRQ DMA and IO port to an unused value.
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...