added mm_early_vpage_alloc(); kernel still crashing...

git-svn-id: svn://anubis/hos/trunk@98 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
josh committed 2010-01-28 04:22:02 +00:00
1 parent 5ac343a2e8
commit d41ffbbedc
3 files changed
+22 -3

No files matched your search

+15
View File
@@ -131,6 +131,8 @@ void mm_bootstrap()
/* move the heap back to after the page allocation pages */
mm_heap_base = (u32_t) &page_alloc_pages[last_page_alloc_page + 1];
/* ok, now mm_early_vpage_alloc() should be functional */
/* allocate the page directory */
u32_t page_directory_phys = mm_early_page_alloc();
early_page_directory_ptr = (pagedirectory_t *)
@@ -359,6 +361,19 @@ u32_t mm_page_alloc()
return page_address;
}
/**************************************************************************
* This function allocates a virtual page. It should only be called *
* during the bootstrap process, before the kernel begins its normal *
* operation. It adjusts the heap pointer to push it back beyond any *
* bootstrap pages allocated. *
*************************************************************************/
u32_t mm_early_vpage_alloc()
{
u32_t vaddress = mm_heap_base;
mm_heap_base += PAGE_SIZE;
return vaddress;
}
void mm_print_memory_map()
{
kprintf("Bootloader provided memory map:\n");
+1
View File
@@ -56,6 +56,7 @@ int mm_map(u32_t virtual_address, u32_t physical_address,
u32_t mm_early_page_alloc();
u32_t mm_page_alloc();
u32_t mm_early_vpage_alloc();
void mm_print_memory_map();