X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fuserprog%2Faddrspace.c;h=c136ae55d0bef505985e312e6a82b07d8ed0b9f7;hp=eb0de496851a5a340270e8d1cdd38074d677d88e;hb=44d0fa6a2b24a84e5eb0d54959ed91c1d4f15343;hpb=4ba2bcacdde59e70754df916dcee39e45d564441 diff --git a/src/userprog/addrspace.c b/src/userprog/addrspace.c index eb0de49..c136ae5 100644 --- a/src/userprog/addrspace.c +++ b/src/userprog/addrspace.c @@ -3,6 +3,7 @@ #include "debug.h" #include "file.h" #include "filesys.h" +#include "init.h" #include "lib.h" #include "mmu.h" #include "malloc.h" @@ -209,11 +210,6 @@ addrspace_load (struct addrspace *as, const char *filename, file_seek (file, file_ofs); if (file_read (file, &phdr, sizeof phdr) != sizeof phdr) LOAD_ERROR (("error reading program header")); - printk ("%x: %08x, %08x %08x %08x %05x %05x\n", - file_tell (file), - phdr.p_type, - phdr.p_offset, phdr.p_vaddr, phdr.p_paddr, - phdr.p_filesz, phdr.p_memsz); file_ofs += sizeof phdr; switch (phdr.p_type) { @@ -270,4 +266,5 @@ addrspace_activate (struct addrspace *as) if (as->pagedir != NULL) pagedir_activate (as->pagedir); + tss->esp0 = (uint32_t) pg_round_down (as) + PGSIZE; }