PCI Function Number for SATA AHCI Controller

I am debugging the second stage bootloader for a PC with a SATA AHCI controller. I can list the PCI bus and find the hard drive. So far, so good. Now, lspci in my notebook (Dell Inspiron 1525) shows me:

-[0000:00]-+-1f.0 Intel Corporation 82801HEM (ICH8M) LPC Interface Controller +-1f.1 Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller +-1f.2 Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller \-1f.3 Intel Corporation 82801H (ICH8 Family) SMBus Controller 

My question is: does SATA AHCI controller always work 2 on any PC? If not, how did I find it?

I do not pretend to be a general; loading my laptop will be quite good, without compromise in further refinements.

+4
source share
1 answer

Corresponding SATA AHCI controllers should always have a subclass of class 1 (storage controller) 6 (Serial ATA) and interface 1 (AHCI). Therefore, the right strategy is to list all PCI devices and compare their class, subclass, and interface to identify those that implement AHCI. Please note that there may be more than one, depending on the motherboard, and whether any other AHCI cards are connected to it.

You might also want your code to match the AHCI controller with a vendor and device identifier, as some early AHCI controllers do not have an appropriate set of classes / subclasses / interfaces.

+1
source

Source: https://habr.com/ru/post/1443035/


All Articles