Compare commits

..

2 Commits

7 changed files with 64 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 .revision = 4
}; };
static volatile struct limine_rsdp_request rsdp_request = {
.id = LIMINE_RSDP_REQUEST,
.revision = 5
};
void _start() { void _start() {
boot_info_T boot_info; boot_info_T boot_info;
@ -85,5 +90,12 @@ void _start() {
log(LOG_INFO, "( LimineEntry ) Found Ramdisk File"); log(LOG_INFO, "( LimineEntry ) Found Ramdisk File");
boot_info.ramdisk_file = 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); 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/time/pit.h"
#include "drivers/graphics/renderer.h" #include "drivers/graphics/renderer.h"
#include "drivers/fs/vfs.h" #include "drivers/fs/vfs.h"
#include "drivers/acpi/acpi.h"
//#include "drivers/ps2/keyboard.h"
#include "proc/scheduler.h" #include "proc/scheduler.h"
#include "platform/syscall.h" #include "platform/syscall.h"
@ -39,6 +41,10 @@ void kernel_init(boot_info_T* boot_info) {
vfs_init(boot_info); vfs_init(boot_info);
acpi_init(boot_info);
// ps2_keyboard_init();
scheduler_init(boot_info); scheduler_init(boot_info);
} }

View File

@ -255,6 +255,9 @@ process_T* scheduler_get_process(pid_t pid) {
uint32_t index_in_chunk = pid % SCHEDULER_PROCESS_CHUNK_SIZE; uint32_t index_in_chunk = pid % SCHEDULER_PROCESS_CHUNK_SIZE;
scheduler_processes_chunk_T* chunk = g_scheduler.processes; scheduler_processes_chunk_T* chunk = g_scheduler.processes;
if (chunk == NULL) {
return NULL;
}
for (uint32_t i = 0; i < num_chunks; i++) { for (uint32_t i = 0; i < num_chunks; i++) {
chunk = chunk->next; chunk = chunk->next;