Kernel: Move current page table to Processor

APs can now map kernel page table and print current time!
This commit is contained in:
2024-03-06 02:19:59 +02:00
parent f0105cb7fb
commit 54f64e7618
6 changed files with 55 additions and 38 deletions

View File

@@ -78,5 +78,6 @@ namespace CPUID
void get_features(uint32_t& ecx, uint32_t& edx);
bool is_64_bit();
bool has_nxe();
bool has_pge();
}

View File

@@ -40,7 +40,7 @@ namespace Kernel
static void initialize();
static PageTable& kernel();
static PageTable& current();
static PageTable& current() { return *reinterpret_cast<PageTable*>(Processor::current().m_current_page_table); }
static constexpr vaddr_t fast_page() { return KERNEL_OFFSET; }
@@ -109,6 +109,7 @@ namespace Kernel
vaddr_t reserve_free_contiguous_pages(size_t page_count, vaddr_t first_address, vaddr_t last_address = UINTPTR_MAX);
void load();
void initial_load();
InterruptState lock() const { return m_lock.lock(); }
void unlock(InterruptState state) const { m_lock.unlock(state); }

View File

@@ -87,7 +87,10 @@ namespace Kernel
GDT* m_gdt { nullptr };
IDT* m_idt { nullptr };
void* m_current_page_table { nullptr };
friend class BAN::Vector<Processor>;
friend class PageTable;
};
#else
#error