From fdb4eb604268f61f0d592b02f026ac257e63f19e 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 8876c70899..3602fb30e8 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 60e964a953..c9280b5687 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 ba5511c4ab..f75e1ace43 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 6558830275..2905d0c129 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 c4b0572d32..608c2d70ff 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 6d3c991857..6ed86f36e2 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 c5694bd98d..8880cd0dd7 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 ad6632bcac..efd835a6cb 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 010dec1119..816d1ba541 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 00ef6c12fb..0731a9cd08 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 532f1b9b89..9d6c7be603 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 9fe1c9f36a..f6106aa927 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 12f460a2e0..b503722c4e 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