From a70ae5ca314985a01b56f2a37550e0aab1b8e9a5 Mon Sep 17 00:00:00 2001 From: Nigel Date: Thu, 1 Sep 2022 16:42:56 +0200 Subject: [PATCH] KERNEL: Mapping the bios region ( below 1Mib) Keyboard.h: remove the incorrect use of typedef PhysicalMemoryManager.cpp: Map the Bios region as used. This prevents us from allocation the area used by the bios --- source/kernel/Drivers/PS-2/keyboard.h | 4 ++-- source/kernel/Memory/PhysicalMemoryManager.cpp | 3 +++ source/kernel/Memory/VirtualMemoryManager.h | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/kernel/Drivers/PS-2/keyboard.h b/source/kernel/Drivers/PS-2/keyboard.h index f832178..f93b0fb 100644 --- a/source/kernel/Drivers/PS-2/keyboard.h +++ b/source/kernel/Drivers/PS-2/keyboard.h @@ -1,14 +1,14 @@ #pragma once #include #include "../../Terminal/kterm.h" -typedef enum ScanCodeSet{ +enum ScanCodeSet { None = 0, ScanCodeSet1 = 1, ScanCodeSet2 = 2, ScanCodeSet3 = 3, }; -typedef enum Modifiers{ +enum Modifiers { LSHIFT = 1, RSHIFT = 2, diff --git a/source/kernel/Memory/PhysicalMemoryManager.cpp b/source/kernel/Memory/PhysicalMemoryManager.cpp index 7551f91..bda801c 100644 --- a/source/kernel/Memory/PhysicalMemoryManager.cpp +++ b/source/kernel/Memory/PhysicalMemoryManager.cpp @@ -53,6 +53,9 @@ void SetupPhysicalMemoryManager( BootInfoBlock* Bootinfo) { printf("kernel size in memory: 0x%x\n", kernel_size); allocate_region((uint32_t)&kernel_begin, kernel_size); + + printf("allocate BIOS region"); + allocate_region (0x0000000, 0x00100000); } // NOTE: This can only give blocks of 4kb at a time! diff --git a/source/kernel/Memory/VirtualMemoryManager.h b/source/kernel/Memory/VirtualMemoryManager.h index 32abf0c..69e146e 100644 --- a/source/kernel/Memory/VirtualMemoryManager.h +++ b/source/kernel/Memory/VirtualMemoryManager.h @@ -8,5 +8,3 @@ void FreePage(uint32_t v_addr); void Map(uint32_t p_addr, uint32_t v_addr); void Unmap (uint32_t v_addr); - -