X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=solutions%2Fp3.patch;h=69e7d4baf30d179658f9beedb48be58f62a10e9f;hb=f7bc12fb5e4c3eb3ebb633f99b8b266622fc57f7;hp=b285d50be4ff2a7f51f7f7b8488627048e18c0c1;hpb=e482d5037939113b0e4e51acbf1ec8e0c4989a62;p=pintos-anon diff --git a/solutions/p3.patch b/solutions/p3.patch index b285d50..69e7d4b 100644 --- a/solutions/p3.patch +++ b/solutions/p3.patch @@ -633,7 +633,7 @@ diff -u src/userprog/process.c~ src/userprog/process.c ASSERT (file != NULL); ASSERT (phdr != NULL); -@@ -360,69 +471,129 @@ load_segment (struct file *file, const s +@@ -360,73 +471,129 @@ load_segment (struct file *file, const s return false; } @@ -728,8 +728,12 @@ diff -u src/userprog/process.c~ src/userprog/process.c } -/* Adds a mapping from user virtual address UPAGE to kernel -- virtual address KPAGE to the page table. Fails if UPAGE is -- already mapped or if memory allocation fails. */ +- virtual address KPAGE to the page table. +- UPAGE must not already be mapped. +- KPAGE should probably be a page obtained from the user pool +- with palloc_get_page(). +- Returns true on success, false if UPAGE is already mapped or +- if memory allocation fails. */ +/* Sets up command line arguments in KPAGE, which will be mapped + to UPAGE in user space. The command line arguments are taken + from CMD_LINE, separated by spaces. Sets *ESP to the initial