From c6629ba11c17601695b0542d7d1d1bf5dc036d84 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 24 Jul 2025 15:37:36 +0000 Subject: build: clean up configuration --- arch/x86_64/src/io.cpp | 36 ------------------------- arch/x86_64/src/memory.cpp | 66 ---------------------------------------------- arch/x86_64/src/system.cpp | 12 --------- 3 files changed, 114 deletions(-) delete mode 100644 arch/x86_64/src/io.cpp delete mode 100644 arch/x86_64/src/memory.cpp delete mode 100644 arch/x86_64/src/system.cpp (limited to 'arch/x86_64/src') diff --git a/arch/x86_64/src/io.cpp b/arch/x86_64/src/io.cpp deleted file mode 100644 index eab6473..0000000 --- a/arch/x86_64/src/io.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "kapi/io.hpp" - -#include "x86_64/vga/text.hpp" - -namespace teachos::io -{ - - auto init() -> void - { - x86_64::vga::text::clear(); - x86_64::vga::text::cursor(false); - } - - auto print(std::string_view text) -> void - { - x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black); - } - - auto println(std::string_view text) -> void - { - x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::green_on_black); - x86_64::vga::text::newline(); - } - - auto print_error(std::string_view text) -> void - { - x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black); - } - - auto println_error(std::string_view text) -> void - { - x86_64::vga::text::write(text, x86_64::vga::text::common_attributes::red_on_black); - x86_64::vga::text::newline(); - } - -} // namespace teachos::io diff --git a/arch/x86_64/src/memory.cpp b/arch/x86_64/src/memory.cpp deleted file mode 100644 index d1c1f03..0000000 --- a/arch/x86_64/src/memory.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "kapi/memory.hpp" - -#include "kapi/system.hpp" - -#include "x86_64/boot/boot.hpp" -#include "x86_64/boot/ld.hpp" -#include "x86_64/memory/address.hpp" -#include "x86_64/memory/region_allocator.hpp" - -#include - -#include - -namespace teachos::memory -{ - using namespace x86_64::memory; - using namespace x86_64::boot; - - namespace - { - auto constinit is_initialized = std::atomic_flag{}; - - auto create_memory_information() -> region_allocator::memory_information - { - auto const & mbi = multiboot_information_pointer.get(); - auto map = mbi->memory_map(); - - return {std::make_pair(physical_address{&_start_physical}, physical_address{&_end_physical}), - std::make_pair(physical_address{std::bit_cast(&mbi)}, - physical_address{std::bit_cast(&mbi) + mbi->size_bytes()}), - map}; - }; - } // namespace - - auto init() -> void - { - if (is_initialized.test_and_set()) - { - system::panic("[x86_64] Memory management has already been initialized."); - } - - auto memory_map = multiboot_information_pointer->maybe_memory_map(); - if (!memory_map) - { - system::panic("[x86_64] No memory map available."); - } - - auto mem_info = create_memory_information(); - auto allocator = region_allocator{mem_info}; - - static_cast(allocator); - - // kernel::cpu::set_cr0_bit(kernel::cpu::cr0_flags::WRITE_PROTECT); - // kernel::cpu::set_efer_bit(kernel::cpu::efer_flags::NXE); - - // paging::kernel_mapper kernel(allocator, memory_information); - // kernel.remap_kernel(); - // video::vga::text::write("Kernel remapping successful", video::vga::text::common_attributes::green_on_black); - // video::vga::text::newline(); - - // remap_heap(heap::KERNEL_HEAP_START, heap::KERNEL_HEAP_SIZE); - // video::vga::text::write("Heap remapping successful", video::vga::text::common_attributes::green_on_black); - // video::vga::text::newline(); - } - -} // namespace teachos::memory diff --git a/arch/x86_64/src/system.cpp b/arch/x86_64/src/system.cpp deleted file mode 100644 index 2d4c3fe..0000000 --- a/arch/x86_64/src/system.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "kapi/system.hpp" - -namespace teachos::system -{ - - auto halt() -> void - { - asm volatile("1: hlt\njmp 1b"); - __builtin_unreachable(); - } - -} // namespace teachos::system -- cgit v1.2.3