How it works?
I'm interesting about linux kernel architecture and there's something i don't understand despite of all reserach i did on the net.
So i hope someone here could give me more informations ...
The cpu and the devices are not connected directly.
There is always a bus controller (PCI, USB, IDE etc ...) connected to the cpu bus.
But how the kernel know what controller is connected and what is the physical adress of the controller?
I mean, when the kernel boot, how it determine that at a certain adress he will find a pci controller wich will be driven by the pci driver?
Linux can be installed on various system so how the kernel do to know when it boot to know what controller are present?
I don't find on the net enough informations about this process.
Thank u for all your information.
There is a PCI BIOS specification for systems that use a BIOS. Linux fires up a PCI driver that searches through a know address range for information on the devices and bridges on the system and gets a structure that is defined in the specification that contains the information needed.
This might help you. There's a section on how the kernel finds its way around the pci buses.
Thanks for these quic answer. Very interesting doc !!!!
So if i understand good the kernel ask to the bios at universal adress if pci controller is present and different informations to load the correct pci driver?
For USB controller is the same is with BIOS?
Linux reads through the PCI address space space and finds the devices that are present. A USB controller would have a header there as well.
How is this done exactly?
Originally Posted by gregm
And, I thought the Linux kernel was (currently) 64-bit, and the BIOS still hasn't changed from 16-bit, and Linux isn't reliant on it in any way....? Wassup? :)
The BIOS is an interface to the hardware - Basic Input Output System. There are other systems - the newer EFI (Extensible Firmware Interface) but there has to be a means for all OS to communicate with the hardware.
There are, I believe, some 32 bit PCI BIOS calls but it's really irrelevant. The fact that a system can use 64 bit registers doesn't preclude it from using 8 bit ones or having larger data sizes (floating point registers are 80 bit). The common char data type is 8 bit on most surviving systems. Integers come in a wide variety of sizes.
But does Linux USE the BIOS? Why? And if it IS, then why do we need hardware drivers for it?
If your system has a BIOS it uses it. Without a BIOS (or EFI etc.) Linux wouldn't know what drivers to load.
I really wish you'd expand on that. There's far more to the whole story than that doc hazel posted. (which was 15 years old, btw!)
Also, I'd really like a clear explanation of all this UEFI business, since you brought it up. Exactly what it is, and how it differs from the BIOS we've known all this time, etc. ..... :)