Greetings,
I am in the process of implementing a basic serial driver for my OS. The example code given here, https://wiki.osdev.org/Serial_Ports#Example_Code, has COM1 hard coded to 0x3F8.
My question is where in the UEFI/ACPI tree of tables and pointers to tables (RSDT, etc) can I go to find the actual base address of all the serial / UART controllers with the goal of ( for example ), not having to guess that 0x3F8 is the actual base address and ideally some field in some table can confirm that for me?
Thanks,
Serial Port - UART com1 base address
Re: Serial Port - UART com1 base address
Serial ports are declared with AML as devices with a hardware ID (_HID) of PNP0500 or PNP0501. The I/O base and IRQ line number are given in the resource descriptor (_CRS).
Re: Serial Port - UART com1 base address
I don't trust ACPI for this and use detection. Only a small number of base addresses and IRQs are used in real systems, and the COM port dates back to times when ACPI was non-existent or not working properly. PCI based COM ports can be found though PCI device discovery.
Re: Serial Port - UART com1 base address
That's an understatement! The COM port greatly predates ACPI's predecessor Plug 'n Pray Play.
The wiki's Serial Ports page, Port Addresses section, describes how to probe them. (Note the plural in the page name. Don't get it mixed up with the Serial Port page which has no programming information.)
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie