X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fuserprog.texi;h=aaf75e2aead1b749589d786f55e7ef12555d592f;hb=3edcfedb8e62970f3293fa676b6691f8658c3c11;hp=0872f798bd170d4319bdaf9a434b5cf156970c45;hpb=bbbad85235aaccd0d295e012133bca03918be6e5;p=pintos-anon diff --git a/doc/userprog.texi b/doc/userprog.texi index 0872f79..aaf75e2 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -204,7 +204,7 @@ commands for copying files out of a VM are similar, but substitute @option{-g} for @option{-p}. Incidentally, these commands work by passing special commands -@command{put} and @command{get} on the kernel's command line and copying +@command{extract} and @command{append} on the kernel's command line and copying to and from a special simulated ``scratch'' disk. If you're very curious, you can look at the @command{pintos} script as well as @file{filesys/fsutil.c} to learn the implementation details. @@ -443,7 +443,7 @@ put_user (uint8_t *udst, uint8_t byte) { int error_code; asm ("movl $1f, %0; movb %b2, %1; 1:" - : "=&a" (error_code), "=m" (*udst) : "r" (byte)); + : "=&a" (error_code), "=m" (*udst) : "q" (byte)); return error_code != -1; } @end verbatim @@ -1090,10 +1090,11 @@ pointers. Then, push the address of each string plus a null pointer sentinel, on the stack, in right-to-left order. These are the elements of -@code{argv}. The order ensures that @code{argv[0]} is at the lowest -virtual address. Word-aligned accesses are faster than unaligned -accesses, so for best performance round the stack pointer down to a -multiple of 4 before the first push. +@code{argv}. The null pointer sentinel ensures that @code{argv[argc]} +is a null pointer, as required by the C standard. The order ensures +that @code{argv[0]} is at the lowest virtual address. Word-aligned +accesses are faster than unaligned accesses, so for best performance +round the stack pointer down to a multiple of 4 before the first push. Then, push @code{argv} (the address of @code{argv[0]}) and @code{argc}, in that order. Finally, push a fake ``return address'': although the