[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: devfsd and kde



On Mon, 10 Dec 2001 11:31, Alan Chandler wrote:
> > Create a new file /etc/modutils/mysound containing something like the
> > following:
> > alias /dev/sound sound-module
>
> Thank you very much - worked a treat.
>
> Just one question - since I don't understand the logic of whats happening.
> When does devfsd make the compatibility link with /dev/dsp ?  What I

After the module is loaded, initialised, and has created the real device node 
(/dev/sound/dsp in this case).

> thought was happening was something makes a request to a sound module, this
> causes the kernel module loader to call modprobe.  Modprove looks in the
> alias file for /dev/sound and finds my sound card (emu10k1) which then
> loads into memory. The sound card registers itself which causes devfsd to
> create the compatibility links.

What happens is that something tries to access /dev/dsp, the devfs kernel 
driver (the driver for the devfs file system which is mounted on /dev) sees 
the lookup for /dev/dsp, blocks the process in question, and tells the devfsd 
process that an access to /dev/dsp has been attempted.  The devfsd in this 
case is configured to pass all requests to modprobe, see the following config 
directive:
# Enable module autoloading. You may comment this out if you don't use
# autoloading
LOOKUP          .*              MODLOAD

Then essentially devfsd runs "modprobe /dev/dsp", the modprobe program sees 
that /dev/dsp is an alias for /dev/sound in /dev/modutils.conf and does the 
appropriate thing.

> The problem I am struggling with (and why I didn't attempt your solution)
> is the chicken and egg problem of the access to /dev/dsp being the thing
> that needs to trigger the module load.  What have I missed?

You missed the fact that /dev is not a regular file system and attempts to 
access non-existant entries make things happen...

> The reason I need to understand (and what actually triggered me off in this
> direction in the first place), is that I have a similar problem with my
> cdroms.  I actually have a ide dvd drive on what previously would have been
> /dev/hdd, and a cdrom (cd - writer) on a scsi card. Previously I had
> symlinked /dev/dvd to /dev/hdd and /dev/cdrom to /dev/sr0 (scsi had been
> compiled in to the kernel - but was delaying the boot sequence for 15 secs
> whilst scanning the scsi bus and timing out).  I had built scsi as module
> and all had stopped working.  Also I had never managed to get cd writing to
> work, and had decided to make a push to sort this out.
>
> I assume the correct thing to do for the dvd (is put a file in
> /etc/devfs/conf.d with a line like)

No.  Create a file named /etc/devfs/conf.d/mine and put the following in it:
# create the standard /dev/cdrom symlink
REGISTER        ^cdroms/cdrom1$ CFUNCTION GLOBAL symlink $devname cdrom
UNREGISTER      ^cdroms/cdrom1$ CFUNCTION GLOBAL unlink cdrom
REGISTER        ^cdroms/cdrom0$ CFUNCTION GLOBAL symlink $devname dvd
UNREGISTER      ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink dvd

Of course that is presuming that you are booting from an IDE hard drive and 
thus the IDE DVD drive gets recognised early in the boot while the SCSI CD-RW 
gets recognised later.

However if you may load the two drivers in arbitary order then you need to 
have the REGISTER and UNREGISTER events refer to the real device names, 
ide/host0/bus1/target1/lun0/cd instead of ^cdroms/cdrom0$ and 
scsi/host0/bus0/target0/lun0/cd (or whatever the device name is for SCSI) 
instead of ^cdroms/cdrom1$ .

> problem of not knowing where to link it to. [As I am writing this do I
> perhaps need an alias /dev/dvd ide-cd in /etc/modutils/aliases followed by
> an
> update-modules?]

Yes, that's a good idea.

> I have not made a start on understanding my scsi problems - these seem to
> be multilayered - as far as I can see. I think I need to get the the
> aic7xxx module set up to load (perhaps alias /dev/somthing  aic7xxx - but
> what - depends on the usage)

You need the alias for /dev/cdrom resulting in loading the aix7xxx module, 
and if you have SCSI hard drives then they need to have it loaded too.  I 
can't advise more without knowing more about your hardware.

I expect you'll probably get it all going without more advice from me, if so 
please post to debian-user about how you did it, I think that other people 
will be interested.

-- 
http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/     My home page



Reply to: