get rsdp
This commit is contained in:
Binary file not shown.
@@ -119,8 +119,18 @@ typedef struct {
|
||||
EFI_MEMORY_DESCRIPTOR* mMap;
|
||||
UINTN mMapSize;
|
||||
UINTN mMapDescriptorSize;
|
||||
void* rsdp;
|
||||
} BootInfo;
|
||||
|
||||
UINTN strcmp(CHAR8* a, CHAR8* b, UINTN length) {
|
||||
for (UINTN i = 0; i < length; i++) {
|
||||
if (*a != *b) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
EFI_STATUS efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable) {
|
||||
|
||||
// sets up UEFI environment to be able to use
|
||||
@@ -225,6 +235,20 @@ EFI_STATUS efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable) {
|
||||
|
||||
}
|
||||
|
||||
// look for the acpi2 table
|
||||
EFI_CONFIGURATION_TABLE* configTable = SystemTable->ConfigurationTable;
|
||||
void* rsdp = NULL;
|
||||
EFI_GUID Acpi2TableGuid = ACPI_20_TABLE_GUID;
|
||||
for (UINTN index = 0; index < SystemTable->NumberOfTableEntries; index++) {
|
||||
if (CompareGuid(&configTable[index].VendorGuid, &Acpi2TableGuid)) {
|
||||
if (strcmp((CHAR8*)"RSD PTR ", (CHAR8*)configTable->VendorTable, 8)) {
|
||||
rsdp = (void*)configTable->VendorTable;
|
||||
}
|
||||
}
|
||||
|
||||
configTable++;
|
||||
}
|
||||
|
||||
// Run the kernel's main function! :D
|
||||
void (*KernelStart)(BootInfo*) = ((__attribute__((sysv_abi)) void (*)(BootInfo*) ) header.e_entry);
|
||||
|
||||
@@ -234,6 +258,7 @@ EFI_STATUS efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable) {
|
||||
bootInfo.mMap = Map;
|
||||
bootInfo.mMapSize = MapSize;
|
||||
bootInfo.mMapDescriptorSize = DescriptorSize;
|
||||
bootInfo.rsdp = rsdp;
|
||||
|
||||
SystemTable->BootServices->ExitBootServices(ImageHandle, MapKey);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,17 @@
|
||||
extern "C" void _start(BootInfo* bootInfo) {
|
||||
KernelInfo kernelInfo = InitializeKernel(bootInfo);
|
||||
PageTableManager* pageTableManager = kernelInfo.pageTableManager;
|
||||
|
||||
GlobalRenderer->Print(to_hstring((uint64_t)bootInfo->rsdp));
|
||||
GlobalRenderer->Next();
|
||||
GlobalRenderer->PutChar(*(uint8_t*)bootInfo->rsdp);
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 1));
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 2));
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 3));
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 4));
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 5));
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 6));
|
||||
GlobalRenderer->PutChar(*((uint8_t*)bootInfo->rsdp + 7));
|
||||
|
||||
while (true) {
|
||||
ProcessMousePacket();
|
||||
|
||||
@@ -19,6 +19,7 @@ struct BootInfo {
|
||||
EFI_MEMORY_DESCRIPTOR* mMap;
|
||||
uint64_t mMapSize;
|
||||
uint64_t mMapDescriptorSize;
|
||||
void* rsdp;
|
||||
};
|
||||
|
||||
extern uint64_t _KernelStart;
|
||||
|
||||
Reference in New Issue
Block a user