aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarvin Borner2020-05-23 17:25:20 +0200
committerMarvin Borner2020-05-23 17:25:20 +0200
commit44f6465b541259c608c043b0c5c8f70ae43b51e2 (patch)
tree76e884b4dd1901cc6c18b5c2fee297be1f0f610b /src
parent9731a7e1fc779db3ae21e0054346cc37eed3508c (diff)
Better paging directory creator
Diffstat (limited to 'src')
-rw-r--r--src/kernel/memory/paging.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c
index 96fa584..917a186 100644
--- a/src/kernel/memory/paging.c
+++ b/src/kernel/memory/paging.c
@@ -48,12 +48,14 @@ void paging_install()
info("Malloc test succeeded!");
}
-u32 *paging_make_directory(int user)
+u32 **paging_make_directory(int user)
{
- u32 *dir = valloc(1024 * 1024 * 32);
- u32 *tables = valloc(1024 * 1024 * 32);
+ u32 **dir = valloc(1024 * 32);
+ dir[0] = valloc(1024 * 1024 * 32);
+ for (int i = 1; i < 1024; i++)
+ dir[i] = dir[0] + i * 1024;
- paging_init(dir, tables, user);
+ paging_init(dir, user);
return dir;
}