# HG changeset patch # User John Tsiombikas # Date 1318419960 -10800 # Node ID 219974492c7d966b7b6c13e3e89d7815d448d4b7 # Parent b45e2d5f0ae1bf51fc0a7e9118234b6cad539ba6 added a comment in clone_vm diff -r b45e2d5f0ae1 -r 219974492c7d src/vm.c --- a/src/vm.c Wed Oct 12 14:39:40 2011 +0300 +++ b/src/vm.c Wed Oct 12 14:46:00 2011 +0300 @@ -777,9 +777,13 @@ } /* for the kernel space we'll just use the same page tables */ - for(i=kstart_dirent; i<1024; i++) { + for(i=kstart_dirent; i<1023; i++) { ndir[i] = pgdir[i]; } + + /* also point the last page directory entry to the page directory address + * since we're relying on recursive page tables + */ paddr = virt_to_phys((uint32_t)ndir); ndir[1023] = paddr | PG_PRESENT;