diff options
Diffstat (limited to 'src/stem/mem')
-rw-r--r-- | src/stem/mem/mem.c | 1 | ||||
-rw-r--r-- | src/stem/mem/paging.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/stem/mem/mem.c b/src/stem/mem/mem.c index 02b3ac5..c96a29d 100644 --- a/src/stem/mem/mem.c +++ b/src/stem/mem/mem.c @@ -35,6 +35,7 @@ static void get_free_pages() { freepages[freepagecount].virt = i; freepages[freepagecount].phys = frame_alloc() * 0x1000; page_map(pagedir_getPage(kernel_pagedir, i, 0), i, 0, 0); + freepagecount++; } else { if (mem_placementAddr & 0xFFFFF000) { mem_placementAddr &= 0xFFFFF000; diff --git a/src/stem/mem/paging.c b/src/stem/mem/paging.c index 4d98e75..9b9c989 100644 --- a/src/stem/mem/paging.c +++ b/src/stem/mem/paging.c @@ -76,6 +76,10 @@ struct page_directory *pagedir_new() { pd->tablesPhysical = kmalloc_page(&pd->physicalAddr); pd->mappedSegs = 0; + for (i = 0; i < 1024; i++) { + pd->tables[i] = 0; pd->tablesPhysical[i] = 0; + } + for (i = 768; i < 1024; i++) { pd->tables[i] = kernel_pagedir->tables[i]; pd->tablesPhysical[i] = kernel_pagedir->tablesPhysical[i]; |