From a6e11d7e4ea387262eff09797850ed745f8634be Mon Sep 17 00:00:00 2001 From: antifallobst Date: Thu, 27 Apr 2023 00:18:05 +0200 Subject: [PATCH] feature (sysconfig): implemented basic system configuration --- inc/boot/config.h | 16 ++++++++++++++++ src/boot/config.c | 10 ++++++++++ src/boot/kmain.c | 11 +++++------ 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 inc/boot/config.h create mode 100644 src/boot/config.c diff --git a/inc/boot/config.h b/inc/boot/config.h new file mode 100644 index 0000000..13dd990 --- /dev/null +++ b/inc/boot/config.h @@ -0,0 +1,16 @@ +// This file is part of noxos and licensed under the MIT open source license + +#ifndef NOXOS_CONFIG_H +#define NOXOS_CONFIG_H + +#include "utils/stdtypes.h" + +typedef struct { + bool ps2_acpi_validation; +} sysconfig_T; + +void sysconfig_default_init(); + +extern sysconfig_T* g_sysconfig; + +#endif //NOXOS_CONFIG_H diff --git a/src/boot/config.c b/src/boot/config.c new file mode 100644 index 0000000..f179a5f --- /dev/null +++ b/src/boot/config.c @@ -0,0 +1,10 @@ +// This file is part of noxos and licensed under the MIT open source license + +#include "boot/config.h" + +sysconfig_T G_sysconfig; +sysconfig_T* g_sysconfig = &G_sysconfig; + +void sysconfig_default_init() { + g_sysconfig->ps2_acpi_validation = true; +} \ No newline at end of file diff --git a/src/boot/kmain.c b/src/boot/kmain.c index 7e5b3ee..75a88dc 100644 --- a/src/boot/kmain.c +++ b/src/boot/kmain.c @@ -4,6 +4,7 @@ #include "utils/core.h" #include "utils/memory.h" #include "boot/boot_info.h" +#include "boot/config.h" #include "platform/interrupts.h" #include "platform/gdt.h" #include "mm/page_frame.h" @@ -14,11 +15,9 @@ #include "drivers/fs/vfs.h" #include "drivers/acpi/acpi.h" #include "drivers/pci.h" -//#include "drivers/ps2/keyboard.h" +#include "drivers/ps2/controller.h" #include "proc/scheduler.h" -#include "platform/syscall.h" - void limine_terminal_print(boot_info_T* boot_info, string_t string) { boot_info->terminal->write(boot_info->terminal->terminals[0], string, string_length(string)); } @@ -42,11 +41,13 @@ void kernel_init(boot_info_T* boot_info) { vfs_init(boot_info); + sysconfig_default_init(); + acpi_init(boot_info); pci_init(); -// ps2_keyboard_init(); + ps2_controller_init(); scheduler_init(boot_info); } @@ -60,8 +61,6 @@ void kmain(boot_info_T boot_info) { log(LOG_INFO, "!=====[ Kernel Initialized ]=====!\n"); - DEBUG("test %d", 1312); - pci_device_T* ahci_controller = pci_manager_find_device(PCI_CLASS_MASS_STORAGE_CONTROLLER, PCI_SUBCLASS_SERIAL_ATA_CONTROLLER, 1); CORE_HALT_FOREVER