1
0

Enable the MMU even if the kernel is not loaded in physical memory at

the same place it was linked against.
This commit is contained in:
2012-09-23 01:29:45 -04:00
parent e2a3ab602c
commit d6e3899fc1
4 changed files with 191 additions and 50 deletions

View File

@ -7,8 +7,6 @@
#include <framebuffer.h>
#include <console.h>
extern const unsigned int kernel_end;
struct fb myfb;
void video(void) {
@ -64,7 +62,8 @@ int main(void) {
//setup memory
mm_init();
mm_add_free_region((void*)0x60000000, (void*)0x7FFFFFFF);
lower = (char*) &kernel_end;
mm_add_free_region((void*)0x80000000, (void*)0x800FFFFF);
lower = (char*) &kernel_end_virt;
if ((unsigned int)lower % MM_PAGE_SIZE != 0)
lower += (MM_PAGE_SIZE - ((unsigned int)lower % MM_PAGE_SIZE));
mm_add_free_region((void*)lower, (void*)0x9FFFFFFF); //subtract the memory used by the kernel