How to know where to find the RSDP on a BIOS system?

172 Views Asked by At

I'm developing a 32-bit operating system on an IA-32 system (emulator: Bochs). I'm trying to implement a graceful shutdown procedure with ACPI. On the OSDev Wiki, it says that it can either be found in the Extended BIOS Data Area (EBDA), or from 0xE0000 to 0xFFFFF. I want to know if there is some way to know for sure if it is in one of these areas or not.

Another question is that do I have to access the EBDA before going into protected mode? I'm not sure whether my ISR code overwrote that part.

1

There are 1 best solutions below

0
LoopNZ On

I wrote this graceful shutdown in assembly on my hobby o/s a couple of years ago and glad to have come across your post because it forced me to re-visit the entire related codes & refresh my memory...

  1. The memory region 0xE0000-0xFFFFF is where you'll find the location of RSDP (Root System Description Pointer) Structure.
  2. To locate where RSDP is; you need to know that it always lies on 16-Byte boundary and its signature in memory is "RSD PTR " and this is where and when things start getting complicated.
  3. Once RSDP is located then a check on its Revision, Checksum etc... then continue to enumerate other DTs (Description Tables), in the case of my o/s ... XSDT,FACP,DSDT,APIC,HPET,MCFG. FACP & DSDT are the places where Port_Address and Sleep_Type are found respectively, this is where and when you're venturing into the world of gobbledygook of ASL (ACPI Source Language) just to get those values!, Once you assign Port_Address to DX register then output the value of Sleep_Type to DX ... the computer is powered down gracefully. The reference I use is ACPI_v64_Jan2021.pdf. It's definitely not the answer you sought but this is the best guide that will lead you to the solution, have fun and good luck.