diff options
author | Marvin Borner | 2020-05-13 23:53:49 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-13 23:53:49 +0200 |
commit | ddcc46555c8b85754fc7e0ed026e836d9197a859 (patch) | |
tree | 20b84bfe6350a41d55ba9a56103a70394ff41c8b /src/kernel/memory/paging.c | |
parent | a9c7529dcca845d98192ece62be70f752972216b (diff) |
Some page directory fixes
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r-- | src/kernel/memory/paging.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c index e3c088a..fb93dc4 100644 --- a/src/kernel/memory/paging.c +++ b/src/kernel/memory/paging.c @@ -14,14 +14,13 @@ void paging_init(struct page_directory *dir, int user) { for (u32 i = 0; i < 1024; i++) { for (u32 j = 0; j < 1024; j++) { - paging_directory->tables[i]->pages[j] = + dir->tables[i]->pages[j] = ((j * 0x1000) + (i * PAGE_SIZE)) | PT_RW | (user ? PT_USER : 0); } } for (u32 i = 0; i < 1024; i++) { - paging_directory->tables[i] = ((u32)paging_directory->tables[i]) | PD_RW | - PD_PRESENT | (user ? PD_USER : 0); + dir->tables[i] = ((u32)dir->tables[i]) | PD_RW | PD_PRESENT | (user ? PD_USER : 0); } } @@ -38,7 +37,7 @@ extern u32 end; void paging_install(u32 multiboot_address) { // Kernel paging - paging_switch_directory(paging_directory); + paging_switch_directory(paging_kernel_directory); paging_init(paging_directory, 0); if (!memory_init(multiboot_address)) |