diff options
| author | Fabian Imhof <fabian.imhof@ost.ch> | 2024-10-27 13:29:01 +0000 |
|---|---|---|
| committer | Fabian Imhof <fabian.imhof@ost.ch> | 2024-10-27 13:29:01 +0000 |
| commit | 181f35d20e315947fa3463d6774ca164c6a4bc0d (patch) | |
| tree | 5ca45fbb92d3ae781296feda29dbed996d605199 /arch/x86_64/src/kernel | |
| parent | 1518177efac38961a36db0bc40152d00c38e6281 (diff) | |
| parent | becb1ce0abdaf4e6ad08bb6db7c706dd13a1294b (diff) | |
| download | teachos-181f35d20e315947fa3463d6774ca164c6a4bc0d.tar.xz teachos-181f35d20e315947fa3463d6774ca164c6a4bc0d.zip | |
Merge branch 'feat_memory_manager' of ssh://gitlab.ost.ch:45022/teachos/kernel into feat_memory_manager
Diffstat (limited to 'arch/x86_64/src/kernel')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index ad1eb39..5186c21 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -22,11 +22,8 @@ namespace teachos::arch::kernel 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, |
