kern
changeset 48:4c9c16754b59
fixed the page fault
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 28 Jul 2011 17:56:05 +0300 |
parents | f65b348780e3 |
children | 50730d42d2d3 |
files | src/vm.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/src/vm.c Thu Jul 28 05:43:04 2011 +0300 1.2 +++ b/src/vm.c Thu Jul 28 17:56:05 2011 +0300 1.3 @@ -505,7 +505,7 @@ 1.4 */ 1.5 uint32_t clone_vm(void) 1.6 { 1.7 - int i, dirpg, tblpg, kmem_start_pg; 1.8 + int i, dirpg, tblpg, kstart_dirent; 1.9 uint32_t paddr; 1.10 uint32_t *ndir, *ntbl; 1.11 1.12 @@ -528,10 +528,10 @@ 1.13 */ 1.14 free_phys_page(virt_to_phys(tblpg)); 1.15 1.16 - kmem_start_pg = ADDR_TO_PAGE(KMEM_START); 1.17 + kstart_dirent = ADDR_TO_PAGE(KMEM_START) / 1024; 1.18 1.19 /* user space */ 1.20 - for(i=0; i<kmem_start_pg; i++) { 1.21 + for(i=0; i<kstart_dirent; i++) { 1.22 if(pgdir[i] & PG_PRESENT) { 1.23 paddr = alloc_phys_page(); 1.24 map_page(tblpg, ADDR_TO_PAGE(paddr), 0); 1.25 @@ -547,7 +547,7 @@ 1.26 } 1.27 1.28 /* kernel space */ 1.29 - for(i=kmem_start_pg; i<1024; i++) { 1.30 + for(i=kstart_dirent; i<1024; i++) { 1.31 ndir[i] = *PGTBL(i); 1.32 } 1.33