pagetable lab initialized
This commit is contained in:
@@ -75,17 +75,17 @@ exec(char *path, char **argv)
|
||||
p = myproc();
|
||||
uint64 oldsz = p->sz;
|
||||
|
||||
// Allocate two pages at the next page boundary.
|
||||
// Allocate some pages at the next page boundary.
|
||||
// Make the first inaccessible as a stack guard.
|
||||
// Use the second as the user stack.
|
||||
// Use the rest as the user stack.
|
||||
sz = PGROUNDUP(sz);
|
||||
uint64 sz1;
|
||||
if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE, PTE_W)) == 0)
|
||||
if((sz1 = uvmalloc(pagetable, sz, sz + (USERSTACK+1)*PGSIZE, PTE_W)) == 0)
|
||||
goto bad;
|
||||
sz = sz1;
|
||||
uvmclear(pagetable, sz-2*PGSIZE);
|
||||
uvmclear(pagetable, sz-(USERSTACK+1)*PGSIZE);
|
||||
sp = sz;
|
||||
stackbase = sp - PGSIZE;
|
||||
stackbase = sp - USERSTACK*PGSIZE;
|
||||
|
||||
// Push argument strings, prepare rest of stack in ustack.
|
||||
for(argc = 0; argv[argc]; argc++) {
|
||||
|
||||
Reference in New Issue
Block a user