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: William Case <billlinux [ at ] rogers [ dot ] com>
  • Date: Mon, 10 Dec 2007 14:11:08 -0500
Thanks Bart;

The responses below are as much notes to myself as comments to your
answers.

On Mon, 2007-12-10 at 13:24 -0500, Bart Trojanowski wrote:
> * William Case <billlinux [ at ] rogers [ dot ] com> [071210 13:08]:
> > This is a physical, hardware question: Where is the device identity
> > registered on the device and how is it probed?
> 
> Depends on the bus and type of device.  Some have it in EEPROM, some
> have it hardwired, some have it in firmware.

Forgot to look into how firmware plays a role in this.

> 
> > Does each device have a EEPROM or is the identity hardwired in place by
> > the manufacturer?  Does a 'probe' send a signal down the control lines
> > on a bus and report back an identity for each device it finds? How?  On
> > the Data Lines?  Is there a specific function, in BIOS, in the kernel,
> > in udev, that accomplishes this?
> 
> On some buses you have to send a message requesting that info; I think
> that's how USB works.  

How is that triggered? (Rhetorical question to myself)

> On other buses you just read a bus memory
> address; this is how PCI works.
> 
Lots of stuff on bus memory address.  I didn't realize that it was about
identifying devices ==> drivers.  (Rhetorical question to myself)

> I don't think the x86 BIOS knows anything about vendor/device IDs.  The
> BIOS tends to be simple.  It uses generic drivers, as opposed to Linux
> which uses specialized drivers when ever possible.
> 

I didn't mean to imply that BIOS was concerned with vendor/device IDs,
but I did not think of 'generic' drivers.  (Rhetorical question to
myself)

> In the PCI config space, and I would imagine on other buses too, there
> are fields that identify device class.  A device could be a "IDE device"
> in which case the BIOS would talk to it using the legacy IDE interface,
> even though there may be a faster way to talk to the device.
> 
Yes, my question was how does the field " identify device class" get
filled in and how does the PCI config space get created in the first
place?  (Rhetorical question to myself)

> > 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)

Bart, I won't take up anymore of your time until I have chased down
these questions/points to the best of my ability.  

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.

Thanks

-- 
Regards Bill