Re: how is a device detected

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

 



Bond wrote:
> On Mon, Nov 22, 2010 at 11:45 PM, Rolf Eike Beer <eike-kernel@xxxxxxxxx> 
wrote:
> > The basic idea is like this:
> > 
> > The kernels PCI core scan through all PCI busses it found, collecting a
> > list of devices. These are determined by reading the PCI config space of
> > the corresponding hardware devices.
> 
> Ok this is the part I want to read in the kernel code (As Greg pointed
> above) which part exactly or what files inside the kernels I should be
> reading to understand this part?

As he said: drivers/pci/

> > Now that he knows for example there is a device with the vendor id 0x8086
> > (Intel) and device id 0x1234 (randomly chosen).
> 
> I think this will happen only once the config space of all devices has
> been scanned via the kernel

Basically: yes. But there are things like PCI hotplug ;)

> >Now the kernel looks if any
> >
> > already loaded driver said "hey, I take this combination". If it doesn't
> > find one it will look into the modules.alias file (which is in
> > /lib/modules/$(uname -r) and is created by depmod) if there is any
> > driver that claims to be responsible for this device. If yes, then the
> > corresponding module is loaded.
> 
> So that way the users of Linux systems when they install Linux they
> must be running a lot of such other modules
> which might not be required.Because the Linux Kernel the is shipped on
> CDROMs contains all the drivers because you do not know
> prior as on which hardware the ISO would be used to install Linux.
> I have read linuxrc script of Suse Linux and also usbfs utility.
> Is this understanding of mine correct.

I don't really get what your exact question is here. But basically: the 
distros ship a ton of modules, they nearly build all possible modules and pack 
them into their installer. Then the kernel will just autodetect which devices 
are there and loads the appropiate modules. So this consumes a lot of 
diskspace (in terms of some years ago, my /lib/modules for the current 
openSUSE x86-32 kernel has 93MB) but only the really needed modules are loaded 
into memory.

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux