feature (acpi): requesting RSDP from bootloader

This commit is contained in:
antifallobst 2023-03-11 10:36:55 +01:00
parent a4c1d17aac
commit b5e2945165
6 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,10 @@
// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_ACPI_H
#define NOX_ACPI_H
#include "boot/boot_info.h"
void acpi_init(boot_info_T* boot_info);
#endif //NOX_ACPI_H

View File

@ -0,0 +1,24 @@
// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_RSDP_H
#define NOX_RSDP_H
#include "utils/stdtypes.h"
typedef struct {
char signature [8];
uint8_t checksum;
char oem_id;
uint8_t revision;
uint32_t rsdt_address;
} __attribute__((packed)) rsdp_descriptor_v1_T;
typedef struct {
rsdp_descriptor_v1_T descriptor_v1;
uint32_t length;
uint64_t xsdt_address;
uint8_t checksum_extended;
uint8_t reserved [3];
} __attribute__((packed)) rsdp_descriptor_v2_T;
#endif //NOX_RSDP_H

View File

@ -32,6 +32,11 @@ static volatile struct limine_module_request module_request = {
.revision = 4
};
static volatile struct limine_rsdp_request rsdp_request = {
.id = LIMINE_RSDP_REQUEST,
.revision = 5
};
void _start() {
boot_info_T boot_info;
@ -85,5 +90,12 @@ void _start() {
log(LOG_INFO, "( LimineEntry ) Found Ramdisk File");
boot_info.ramdisk_file = ramdisk_file;
if (rsdp_request.response == NULL) {
log(LOG_ERROR, "( LimineEntry ) no RSDP response!");
CORE_HALT_FOREVER
}
log(LOG_INFO, "( LimineEntry ) Found RSDP");
boot_info.rsdp = rsdp_request.response->address;
kmain(boot_info);
}

View File

@ -0,0 +1,8 @@
// This file is part of noxos and licensed under the MIT open source license
#include "drivers/acpi/acpi.h"
#include "utils/logger.h"
void acpi_init(boot_info_T* boot_info) {
log(LOG_DEBUG, "Initializing ACPI - RSDP: 0x%x", boot_info->rsdp);
}

View File

@ -0,0 +1 @@
// This file is part of noxos and licensed under the MIT open source license

View File

@ -12,6 +12,8 @@
#include "drivers/time/pit.h"
#include "drivers/graphics/renderer.h"
#include "drivers/fs/vfs.h"
#include "drivers/acpi/acpi.h"
//#include "drivers/ps2/keyboard.h"
#include "proc/scheduler.h"
#include "platform/syscall.h"
@ -39,6 +41,10 @@ void kernel_init(boot_info_T* boot_info) {
vfs_init(boot_info);
acpi_init(boot_info);
// ps2_keyboard_init();
scheduler_init(boot_info);
}