forked from Bananymous/banan-os
Kernel: RSDP location is now done with virtual addresses
This commit is contained in:
parent
850b7f27a2
commit
e3d3788f28
|
@ -82,7 +82,7 @@ namespace Kernel
|
||||||
static const RSDP* locate_rsdp()
|
static const RSDP* locate_rsdp()
|
||||||
{
|
{
|
||||||
// Look in main BIOS area below 1 MB
|
// Look in main BIOS area below 1 MB
|
||||||
for (uintptr_t addr = 0x000E0000; addr < 0x000FFFFF; addr += 16)
|
for (uintptr_t addr = P2V(0x000E0000); addr < P2V(0x000FFFFF); addr += 16)
|
||||||
if (is_rsdp(addr))
|
if (is_rsdp(addr))
|
||||||
return (const RSDP*)addr;
|
return (const RSDP*)addr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -120,8 +120,8 @@ namespace Kernel
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const RSDT* rsdt = (const RSDT*)(uintptr_t)rsdp->rsdt_address;
|
const RSDT* rsdt = (const RSDT*)(uintptr_t)rsdp->rsdt_address;
|
||||||
PageTable::kernel().identity_map_page((uintptr_t)rsdt, PageTable::Flags::Present);
|
PageTable::kernel().identity_map_page((vaddr_t)rsdt, PageTable::Flags::Present);
|
||||||
BAN::ScopeGuard _([rsdt] { PageTable::kernel().unmap_page((uintptr_t)rsdt); });
|
BAN::ScopeGuard _([rsdt] { PageTable::kernel().unmap_page((vaddr_t)rsdt); });
|
||||||
|
|
||||||
if (memcmp(rsdt->signature, "RSDT", 4) != 0)
|
if (memcmp(rsdt->signature, "RSDT", 4) != 0)
|
||||||
return BAN::Error::from_error_code(ErrorCode::ACPI_RootInvalid);
|
return BAN::Error::from_error_code(ErrorCode::ACPI_RootInvalid);
|
||||||
|
|
Loading…
Reference in New Issue