home | list info | list archive | date index | thread index

Re: [Bulk] Re: [OCLUG-Tech] Engineer's question -- where and how do peripherals store their identity?

  • Subject: Re: [Bulk] Re: [OCLUG-Tech] Engineer's question -- where and how do peripherals store their identity?
  • From: Bart Trojanowski <bart-oclug [ at ] jukie [ dot ] net>
  • Date: Mon, 10 Dec 2007 14:21:52 -0500
* William Case <billlinux [ at ] rogers [ dot ] com> [071210 14:10]:
> > > What does the kernel do with that data?  I have a kernel manual for 2.6
> > > and greater.  The manual is silent or I have mis-read something.
> > 
> > Upon discovering a new device on a bus, the kernel will ask all
> > registered drivers (all, within reason) if they can handle it.  If there
> > is no match, it will ask a user space helper to load a module that will.
> > 
> How does the kernel 'discover a new device on a a bus'?  I know it
> compares devices on the existing hwconfig with a new device file
> (structure) to see if there are any additions or deletions.  How does it
> get the new additions or deletions?  (Rhetorical question to myself)

Most buses have bridges (or hubs) which link multiple bus segments
together.  For PCI you can see this topology with lspci -tv.  In most
(maybe all) cases the kernel has to communicate with the first bridge
before talking past it; there are things called transparent bridges, but
they have to be configured first.  Anyway, starting with the first bus
the kernel will probe for all devices connected on that bus.
Discovering a PCI-to-PCI bridge it will recursively search on the other
side of that bridge.

> One real question; would looking at the source code for udev help my
> understanding?  If I read things clearly, HAL (and Fedora's kudzu) seem
> to be just extensions of udev.

I am not really sure how all this fancy user space stuff cooperates.
But here is what I know...

udev doesn't probe.  udev acts on probes done by the kernel.

hal also does not probe.  hal is an interface library (and tools) that
glue applications to the kernel interfaces.

kudzu predates udev and hal.  Even when I ran RH, I used to turn it off.
It seldom did the right thing.

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/