From: Ben Pfaff Date: Tue, 20 Dec 2005 23:21:15 +0000 (+0000) Subject: Clarifications. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=commitdiff_plain;h=1c07a79a63dbbd1f4047bf32046518de6f879d50 Clarifications. Pointer to instructions for debugging user programs. --- diff --git a/doc/debug.texi b/doc/debug.texi index 8fbc7d5..ce3e4bd 100644 --- a/doc/debug.texi +++ b/doc/debug.texi @@ -314,6 +314,7 @@ a bug in the original Pintos code. The first and second are quite likely, and you should seriously consider both. We hope that the third is less likely, but it is also possible. +@anchor{Debugging User Programs} You can also use @command{gdb} to debug a user program running under Pintos. Start by issuing this @command{gdb} command to load the program's symbol table: diff --git a/doc/userprog.texi b/doc/userprog.texi index 8773209..92959ec 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -638,15 +638,15 @@ The file defines other syscalls. Ignore them for now. You will implement some of them in project 3 and the rest in project 4, so be sure to design your system with extensibility in mind. -To implement syscalls, you need to provide ways to copy data -from user virtual address space into the kernel and vice versa. +To implement syscalls, you need to provide ways to read and write data +in user virtual address space. You need this ability before you can even obtain the system call number, because the system call number is on the user's stack in the user's virtual address space. This can be a bit tricky: what if the user provides an invalid pointer, a pointer into kernel memory, or a block partially in one of those regions? You should handle these cases by -terminating the user process. We recommend +terminating the user process. We recommend writing and testing this code before implementing any other system call functionality. @@ -783,6 +783,10 @@ user program C library does not have a @func{malloc} implementation. Modify @file{src/examples/Makefile}, then run @command{make}. +@item Can I run user programs under a debugger? + +Yes, with some limitations. @xref{Debugging User Programs}. + @item What's the difference between @code{tid_t} and @code{pid_t}? A @code{tid_t} identifies a kernel thread, which may have a user