added set_cr3() macro and called it to set the PDBR

git-svn-id: svn://anubis/hos/trunk@40 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
josh 2009-07-04 00:22:18 +00:00
parent e55f2cdfc4
commit 54b42c0226
2 changed files with 6 additions and 0 deletions

View File

@ -134,6 +134,9 @@ void mm_bootstrap()
mm_map(page_base, page_base - KERNEL_OFFSET, 0, 1); mm_map(page_base, page_base - KERNEL_OFFSET, 0, 1);
} }
/* set the page directory base register */
set_cr3(&page_directory);
mm_use_virtual_offset = false; mm_use_virtual_offset = false;
} }

View File

@ -29,5 +29,8 @@ int mm_map(u32_t virtual_address, u32_t physical_address,
u32_t mm_page_alloc(); u32_t mm_page_alloc();
#define set_cr3(address) \
__asm__ __volatile__ ("movl %0, %%cr3" : : "r" (address));
#endif #endif