diff options
author | Marvin Borner | 2020-05-23 17:25:20 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-23 17:25:20 +0200 |
commit | 44f6465b541259c608c043b0c5c8f70ae43b51e2 (patch) | |
tree | 76e884b4dd1901cc6c18b5c2fee297be1f0f610b | |
parent | 9731a7e1fc779db3ae21e0054346cc37eed3508c (diff) |
Better paging directory creator
-rw-r--r-- | src/kernel/memory/paging.c | 10 |
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; } |