aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel/main.cpp
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-27 09:21:25 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-27 09:21:25 +0000
commita29e823c6ead21fa7c8f6445411d52f57c4518fb (patch)
tree4e9b9d9fda793b9ecf680e57161c25a971b78f51 /arch/x86_64/src/kernel/main.cpp
parentca17ed52ea768f1e1c837207f7d27afa6ed99cc2 (diff)
downloadteachos-a29e823c6ead21fa7c8f6445411d52f57c4518fb.tar.xz
teachos-a29e823c6ead21fa7c8f6445411d52f57c4518fb.zip
Attempt to start using C++20 algorithm calls.
Diffstat (limited to 'arch/x86_64/src/kernel/main.cpp')
-rw-r--r--arch/x86_64/src/kernel/main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index ad1eb39..3f768ee 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -19,14 +19,19 @@ namespace teachos::arch::kernel
auto memory_information = memory::multiboot::read_multiboot2();
memory::allocator::area_frame_allocator allocator(memory_information);
+ auto test2 = allocator.allocate_frame();
+ auto test1 = test2.value().start_address();
+ auto test3 = test2.value().frame_number;
+
+ if (test1 > test3)
+ {
+ }
+
size_t address = 42 * memory::paging::PAGE_TABLE_ENTRY_COUNT * memory::paging::PAGE_TABLE_ENTRY_COUNT *
memory::allocator::PAGE_FRAME_SIZE; // 42th P3 entry
auto page = memory::paging::virtual_page::containing_address(address);
- auto frame = allocator.allocate_frame();
- exception_handling::assert(frame.has_value(), "[Main] Out of memory exception");
+ memory::paging::map_next_free_page_to_frame(allocator, page, 0U);
auto optional_frame = memory::paging::translate_page(page);
- memory::paging::map_page_to_frame(allocator, page, frame.value(), 0U);
- optional_frame = memory::paging::translate_page(page);
video::vga::text::newline();
video::vga::text::write("Mapped physical frame: ", video::vga::text::common_attributes::green_on_black);
video::vga::text::write_number(optional_frame.value().frame_number,