Skip to content

Commit

Permalink
Actually scan in the order defined in the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
phaubertin committed Jan 25, 2025
1 parent c62af48 commit 83d5cc5
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions kernel/infrastructure/i686/firmware/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,17 @@ static uint32_t scan_address_range(uint32_t from, uint32_t to) {
* @return address of RSDP if found, PADDR_NULL otherwise
*/
static uint32_t scan_for_rsdp(void) {
uint32_t rsdp = scan_address_range(0x0e0000, 0x100000);
uint32_t ebda = get_bios_ebda_addr();

if(rsdp != PADDR_NULL) {
return rsdp;
}

uint32_t top = 0xa0000 - KB;
uint32_t ebda = get_bios_ebda_addr();

if(ebda == 0 || ebda > top) {
return PADDR_NULL;
if(ebda != 0 && ebda <= 0xa0000 - KB) {
uint32_t rsdp = scan_address_range(ebda, ebda + KB);

if(rsdp != PADDR_NULL) {
return rsdp;
}
}

return scan_address_range(ebda, ebda + KB);
return scan_address_range(0x0e0000, 0x100000);
}

/**
Expand Down

0 comments on commit 83d5cc5

Please sign in to comment.