From: Ben Pfaff Date: Sun, 9 Apr 2006 02:21:58 +0000 (+0000) Subject: Fix up solution to work with latest process.c. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fd2be23e4d5255d3e89d4dc07c60e1ddf2aa377;p=pintos-anon Fix up solution to work with latest process.c. --- diff --git a/solutions/p2.patch b/solutions/p2.patch index e1d7274..9022ac9 100644 --- a/solutions/p2.patch +++ b/solutions/p2.patch @@ -313,14 +313,14 @@ diff -u src/userprog/process.c~ src/userprog/process.c to the kernel-only page directory. */ pd = cur->pagedir; @@ -193,7 +284,7 @@ struct Elf32_Phdr + #define PF_W 2 /* Writable. */ #define PF_R 4 /* Readable. */ - static bool load_segment (struct file *, const struct Elf32_Phdr *); -static bool setup_stack (void **esp); +static bool setup_stack (const char *cmd_line, void **esp); - - /* Loads an ELF executable from FILENAME into the current thread. - Stores the executable's entry point into *EIP + static bool validate_segment (const struct Elf32_Phdr *, struct file *); + static bool load_segment (struct file *file, off_t ofs, uint8_t *upage, + bool writable); @@ -209,13 +300,15 @@ static bool setup_stack (void **esp); and its initial stack pointer into *ESP. Returns true if successful, false otherwise. */ @@ -479,11 +479,11 @@ diff -u src/userprog/process.c~ src/userprog/process.c kpage = palloc_get_page (PAL_USER | PAL_ZERO); if (kpage != NULL) { -- success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage); +- success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage, true); - if (success) - *esp = PHYS_BASE; + uint8_t *upage = ((uint8_t *) PHYS_BASE) - PGSIZE; -+ if (install_page (upage, kpage)) ++ if (install_page (upage, kpage, true)) + success = init_cmd_line (kpage, upage, cmd_line, esp); else palloc_free_page (kpage);