Page fault on accessing RSDT
Posted: Fri Jan 20, 2023 10:39 am
I am currently working on the ACPI code for my Ordo project. I am able to locate and identify the RSDP structure, and use that to find the RSDT (not the XSDT, as the SeaBIOS used in QEMU only supports ACPI 1.0). However, when I try to access the RSDT structure in order to validate it, I get a page fault.
I have instrumented the code for accessing both the RSDP and the RSDT to show each step, as well as to show the memory map retrieved from the BIOS. Based on this, I have concluded that the RSDT is indeed outside of the free memory, in a section of memory that I don't presently have page mapped (the page definitions in my boot loader can be seen here). This image shows the output with the QEMU memory set to 128M:
I've also checked the same with -m 512M to comfirm that the same behavior applies regardless of the memory map:
I assume that the solution is to add the firmware in question to the paged memory for the kernel, but I am concerned that I might be misreading the situation somehow. I am also not entirely clear how to alter the page mapping in the kernel, given that I am currently using the page map set up in the boot loader. Any advice on this would be appreciated.
I have instrumented the code for accessing both the RSDP and the RSDT to show each step, as well as to show the memory map retrieved from the BIOS. Based on this, I have concluded that the RSDT is indeed outside of the free memory, in a section of memory that I don't presently have page mapped (the page definitions in my boot loader can be seen here). This image shows the output with the QEMU memory set to 128M:
I've also checked the same with -m 512M to comfirm that the same behavior applies regardless of the memory map:
I assume that the solution is to add the firmware in question to the paged memory for the kernel, but I am concerned that I might be misreading the situation somehow. I am also not entirely clear how to alter the page mapping in the kernel, given that I am currently using the page map set up in the boot loader. Any advice on this would be appreciated.