Detecting Hardware

From OSDev Wiki
(Redirected from Detecting hardware)
Jump to navigation Jump to search

This article is a stub! This page or section is a stub. You can help the wiki by accurately contributing to it.

One of the main roles of an operating system is to detect hardware that can be used.

x86

Typically, on newer x86 hardware there is ACPI, which lets the operating system to detect hardware. If there is no ACPI, then you can't do more than assume that standard buses like PCI exist.

After parsing the ACPI structures, you should enumerate whatever is connected to the buses and controllers found in ACPI. Then you should enumerate whatever is connected to whatever found in the first enumeration. This can include PCI, PS/2 controllers, or whatever.

For example, after scanning the ACPI structures, you will typically find some form of PCI. Then you find USB host controllers connected to PCI. Then you might find external ATA hard disks, SCSI flash drives, or printers, or mice, or whatever, which are connected to USB host controllers.

A rule of thumb when initialising devices is to start from those that are less likely to be emulated, for example you need to initialise USB host controllers before initialising the PS/2 controller, as the latter is more likely to be emulated through USB Legacy Support.