summaryrefslogtreecommitdiff
path: root/src/stem/mem
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-05 20:49:34 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-05 20:49:34 +0100
commit893244c8b5272df86da5d333332eec26ae8f15f2 (patch)
tree066a20bc1cca70f1aa97df616b2b4fc31d698b40 /src/stem/mem
parentf9fd53ccbb1bb38ed21360179f44b27e2a729701 (diff)
downloadTCE-893244c8b5272df86da5d333332eec26ae8f15f2.tar.gz
TCE-893244c8b5272df86da5d333332eec26ae8f15f2.zip
More work, does not work
Diffstat (limited to 'src/stem/mem')
-rw-r--r--src/stem/mem/mem.c1
-rw-r--r--src/stem/mem/paging.c4
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];