Skip to content

Commit

Permalink
feat: working on vmm
Browse files Browse the repository at this point in the history
Signed-off-by: Zone.N <[email protected]>
  • Loading branch information
MRNIU committed Aug 30, 2024
1 parent fa85cbd commit 939f3aa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/kernel/virtual_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ VirtualMemoryManager::VirtualMemoryManager(uint32_t, uint8_t*) {
get_mmap((pt_t)kernel_pgd, kBasicInfo.GetInstance().kernel_addr, &pa);
klog::Debug("res: %d, pa 0x%X\n", res, pa);

klog::Debug("cr0: 0x%X\n", cpu::kAllCr.cr0.Read());
klog::Debug("cr3: 0x%X\n", cpu::kAllCr.cr3.Read());

klog::Debug("kernel_pgd: 0x%X\n", kernel_pgd);
klog::Debug("*kernel_pgd: 0x%X\n", *((uint64_t*)kernel_pgd));
klog::Debug("**kernel_pgd: 0x%X\n", *((uint64_t*)*((uint64_t*)kernel_pgd)));
klog::Debug("**kernel_pgd: 0x%X\n",
*((uint64_t*)*((uint64_t*)*((uint64_t*)kernel_pgd))));

// 分配一页用于保存页目录
// pt_t pgd_kernel = (pt_t)AllocKernelPage();
// memset(pgd_kernel, 0, PhysicalMemoryManager::kPageSize);
Expand Down

0 comments on commit 939f3aa

Please sign in to comment.