From 9c0f3dd996cced2d41474e38c2a69c9d47ae2ffe Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 14 Apr 2023 13:30:21 +0300 Subject: [PATCH] Kernel: Move kmalloc and MMU to Memory directory --- BAN/include/BAN/New.h | 2 +- kernel/CMakeLists.txt | 2 +- kernel/arch/i386/IDT.cpp | 2 +- kernel/arch/i386/MMU.cpp | 4 ++-- kernel/arch/x86_64/IDT.cpp | 2 +- kernel/arch/x86_64/MMU.cpp | 4 ++-- kernel/include/kernel/{ => Memory}/MMU.h | 0 kernel/include/kernel/{ => Memory}/kmalloc.h | 0 kernel/kernel/ACPI.cpp | 2 +- kernel/kernel/APIC.cpp | 2 +- kernel/kernel/{ => Memory}/kmalloc.cpp | 3 +-- kernel/kernel/Process.cpp | 2 +- kernel/kernel/Terminal/VesaTerminalDriver.cpp | 2 +- kernel/kernel/Thread.cpp | 2 +- kernel/kernel/kernel.cpp | 4 ++-- 15 files changed, 16 insertions(+), 17 deletions(-) rename kernel/include/kernel/{ => Memory}/MMU.h (100%) rename kernel/include/kernel/{ => Memory}/kmalloc.h (100%) rename kernel/kernel/{ => Memory}/kmalloc.cpp (99%) diff --git a/BAN/include/BAN/New.h b/BAN/include/BAN/New.h index 8876c708..3602fb30 100644 --- a/BAN/include/BAN/New.h +++ b/BAN/include/BAN/New.h @@ -1,7 +1,7 @@ #pragma once #if defined(__is_kernel) - #include + #include #else #include #endif diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 60e964a9..c9280b56 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -26,7 +26,7 @@ set(KERNEL_SOURCES kernel/Input/PS2Keymap.cpp kernel/InterruptController.cpp kernel/kernel.cpp - kernel/kmalloc.cpp + kernel/Memory/kmalloc.cpp kernel/PCI.cpp kernel/PIC.cpp kernel/PIT.cpp diff --git a/kernel/arch/i386/IDT.cpp b/kernel/arch/i386/IDT.cpp index ba5511c4..f75e1ace 100644 --- a/kernel/arch/i386/IDT.cpp +++ b/kernel/arch/i386/IDT.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include diff --git a/kernel/arch/i386/MMU.cpp b/kernel/arch/i386/MMU.cpp index 65588302..2905d0c1 100644 --- a/kernel/arch/i386/MMU.cpp +++ b/kernel/arch/i386/MMU.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include #include diff --git a/kernel/arch/x86_64/IDT.cpp b/kernel/arch/x86_64/IDT.cpp index c4b0572d..608c2d70 100644 --- a/kernel/arch/x86_64/IDT.cpp +++ b/kernel/arch/x86_64/IDT.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include diff --git a/kernel/arch/x86_64/MMU.cpp b/kernel/arch/x86_64/MMU.cpp index 6d3c9918..6ed86f36 100644 --- a/kernel/arch/x86_64/MMU.cpp +++ b/kernel/arch/x86_64/MMU.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #define PAGE_SIZE 0x1000 #define PAGE_MASK ~(PAGE_SIZE - 1) diff --git a/kernel/include/kernel/MMU.h b/kernel/include/kernel/Memory/MMU.h similarity index 100% rename from kernel/include/kernel/MMU.h rename to kernel/include/kernel/Memory/MMU.h diff --git a/kernel/include/kernel/kmalloc.h b/kernel/include/kernel/Memory/kmalloc.h similarity index 100% rename from kernel/include/kernel/kmalloc.h rename to kernel/include/kernel/Memory/kmalloc.h diff --git a/kernel/kernel/ACPI.cpp b/kernel/kernel/ACPI.cpp index c5694bd9..8880cd0d 100644 --- a/kernel/kernel/ACPI.cpp +++ b/kernel/kernel/ACPI.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #define RSPD_SIZE 20 #define RSPDv2_SIZE 36 diff --git a/kernel/kernel/APIC.cpp b/kernel/kernel/APIC.cpp index ad6632bc..efd835a6 100644 --- a/kernel/kernel/APIC.cpp +++ b/kernel/kernel/APIC.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include diff --git a/kernel/kernel/kmalloc.cpp b/kernel/kernel/Memory/kmalloc.cpp similarity index 99% rename from kernel/kernel/kmalloc.cpp rename to kernel/kernel/Memory/kmalloc.cpp index 010dec11..816d1ba5 100644 --- a/kernel/kernel/kmalloc.cpp +++ b/kernel/kernel/Memory/kmalloc.cpp @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include #include @@ -128,7 +128,6 @@ void kmalloc_initialize() { if (mmmt->base_addr <= s_kmalloc_info.base && s_kmalloc_fixed_info.end <= mmmt->base_addr + mmmt->length) { - dprintln("Total usable RAM: {}.{} MB", mmmt->length / MB, mmmt->length % MB); valid = true; break; } diff --git a/kernel/kernel/Process.cpp b/kernel/kernel/Process.cpp index 00ef6c12..0731a9cd 100644 --- a/kernel/kernel/Process.cpp +++ b/kernel/kernel/Process.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/kernel/kernel/Terminal/VesaTerminalDriver.cpp b/kernel/kernel/Terminal/VesaTerminalDriver.cpp index 532f1b9b..9d6c7be6 100644 --- a/kernel/kernel/Terminal/VesaTerminalDriver.cpp +++ b/kernel/kernel/Terminal/VesaTerminalDriver.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/kernel/kernel/Thread.cpp b/kernel/kernel/Thread.cpp index 9fe1c9f3..f6106aa9 100644 --- a/kernel/kernel/Thread.cpp +++ b/kernel/kernel/Thread.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/kernel/kernel/kernel.cpp b/kernel/kernel/kernel.cpp index 12f460a2..b503722c 100644 --- a/kernel/kernel/kernel.cpp +++ b/kernel/kernel/kernel.cpp @@ -7,9 +7,9 @@ #include #include #include -#include #include -#include +#include +#include #include #include #include