x
Loading
 Loading
Hello, Guest | Login | Register

The Internals of Linux 2.2’s PCI Interface

Peripheral Component Interconnect (PCI) is a widely used bus standard that provides several advantages over other bus standards, such as EISA. Standard on most Pentium motherboards, PCI is a fast, wide (32-bit and 64-bit), and processor-independent bus. When PCI support was first added to Linux, the kernel interface was a wrapper to the PCI BIOS32 functions. There were several problems with this approach:

Peripheral Component Interconnect (PCI) is a widely used bus standard that provides several advantages over other bus standards, such as EISA. Standard on most Pentium motherboards, PCI is a fast, wide (32-bit and 64-bit), and processor-independent bus. When PCI support was first added to Linux, the kernel interface was a wrapper to the PCI BIOS32 functions. There were several problems with this approach:

* PCI BIOS is found only on PC-class machines.

* The PCI BIOS itself represents only certain constructs, and there are non-PC machines that have PCI setups that cannot be described by the PCI BIOS.

* One or two machines have 32-bit PCI BIOS functions that don’t quite do what they are supposed to.

Linux 2.2 provides a generic PCI interface. The Linux x86 kernel actually tries to drive the hardware directly, but if it finds something it doesn’t understand, it may call PC BIOS32 functions.

Drivers can continue to use the old PCI interface but will need updating for future kernels. If the driver is intended to work cross platform, then it really should be updated.

Most of the functions map very simply from the old format to the new one. The PCI BIOS is based on the idea of bus, device, and function numbers. The new code uses pci_ bus and pci_dev structures. The first new PCI function is:

pci_present() 

This function checks whether one or more PCI buses were found on the machine. The older kernels had…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Helpful Tools for Software Developers
  2. The Github Hall of Fame
  3. Book'em, Github.
  4. This Week on Github: Stupid Ruby Tricks
  5. A Veritable Scatter Shot!
Follow Linux Magazine
Rackspace