Detecting Hardware: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
m (moved Detecting hardware to Detecting Hardware: Manual of Style)
No edit summary
 
Line 12: Line 12:


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 [["8042"_PS/2_Controller|PS/2 controller]], as the latter is more likely to be emulated through USB Legacy Support.
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 [["8042"_PS/2_Controller|PS/2 controller]], as the latter is more likely to be emulated through USB Legacy Support.

[[Category:Hardware Detection]]

Latest revision as of 17:33, 10 July 2023

This page is a stub.
You can help the wiki by accurately adding more contents 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.