+--------------------------+ | CMSC 442 | | PROJECT 3: USER PROGRAMS | | DESIGN DOCUMENT | +--------------------------+ ---- GROUP ---- >> Fill in the names and email addresses of your group members. FirstName LastName Process Management FirstName LastName Filesystem Access FirstName LastName System Accounting ---- PRELIMINARIES ---- >> If you have any preliminary comments on your submission, please give them >> here. Please cite any offline or online sources you consulted while >> preparing your submission, other than the Pintos documentation, course text, >> lecture notes, and course staff. ARGUMENT PASSING ================ ---- DATA STRUCTURES ---- >> A1: Copy here the declaration of each new or changed `struct' or >> `struct' member, global or static variable, `typedef', or >> enumeration. Identify the purpose of each in 25 words or less. ---- ALGORITHMS ---- >> A2: Briefly describe how you implemented argument parsing. How do >> you arrange for the elements of argv[] to be in the right order? >> How do you avoid overflowing the stack page? ---- RATIONALE ---- >> A3: Why does Pintos implement strtok_r() but not strtok()? (Hint: Read the >> man page for both functions on any Linux system and think about how they are >> different) >> A4: In Pintos, the kernel separates commands into a executable name >> and arguments. In Unix-like systems, the shell does this >> separation. Identify at least two advantages of the Unix approach. A. B. SYSTEM CALLS ============ ---- DATA STRUCTURES ---- >> B1: Copy here the declaration of each new or changed `struct' or >> `struct' member, global or static variable, `typedef', or >> enumeration. Identify the purpose of each in 25 words or less. ---- ALGORITHMS ---- >> B2: Describe your code for reading and writing user data from the >> kernel. >> B3: Suppose a system call causes a full page (4,096 bytes) of data >> to be copied from user space into the kernel. What is the least >> and the greatest possible number of inspections of the page table >> (e.g. calls to pagedir_get_page()) that might result? What about >> for a system call that only copies 2 bytes of data? Is there room >> for improvement in these numbers, and how much? >> B4: Briefly describe your implementation of the "wait" system call and how >> it interacts with process termination. Identify any particular semaphore >> patterns you used. >> B5: Any access to user program memory at a user-specified address >> can fail due to a bad pointer value. Such accesses must cause the >> process to be terminated. System calls are fraught with such >> accesses, e.g. a "write" system call requires reading the system >> call number from the user stack, then each of the call's three >> arguments, then an arbitrary amount of user memory, and any of >> these can fail at any point. >> This poses a design and error-handling problem: how do you best avoid >> obscuring the primary function of code in a morass of error-handling? >> Furthermore, when an error is detected, how do you ensure that all >> temporarily allocated resources (locks, buffers, etc.) are freed? In a few >> paragraphs, describe the strategy or strategies you adopted for managing >> these issues. Give an example. ---- SYNCHRONIZATION ---- >> B6: The "exec" system call returns -1 if loading the new executable >> fails, so it cannot return before the new executable has completed >> loading. How does your code ensure this? How is the load >> success/failure status passed back to the thread that calls "exec"? >> B7: Consider parent process P with child process C. How do you >> ensure proper synchronization and avoid race conditions when P >> calls wait(C) before C exits? After C exits? How do you ensure >> that all resources are freed in each case? How about when P >> terminates without waiting, before C exits? After C exits? Are >> there any special cases? ---- RATIONALE ---- >> B8: Why did you choose to implement access to user memory from the >> kernel in the way that you did? >> B9: What advantages or disadvantages can you see to your design >> for file descriptors? >> B10: The default tid_t to pid_t mapping is the identity mapping. >> If you changed it, what advantages are there to your approach? Open and Close ================ ---- DATA STRUCTURES ---- >> C1: Describe how file descriptors are associated with open files. >> Are file descriptors unique within the entire OS or just within a >> single process? ---- ALGORITHMS ---- >> C2: Briefly describe how you implemented the open function. How do you >> ensure file descriptors map to a single file? >> C3: Briefly describe how you implemented the close function. How do you >> ensure file descriptors can be reused by the operating system? ---- RATIONALE ---- >> C4: In your solution, what happens if the same file is opened twice by >> different threads? >> C5: Are there any limitations to your approach? (For example, is there a >> maximum number of files that can be open at one time? A maximum number of >> files a single thread can have open at one time?) Console Read and Write ====================== ---- DATA STRUCTURES ---- >> D1: Did you add or modify any data structures in your implementation of Console I/O? ---- ALGORITHMS ---- >> D2: Briefly describe how you implemented writing to the console. >> D3: Briefly describe how you implemented reading from the console. ---- RATIONALE ---- >> D4: How does your code ensure that strings are written atomically (that is, >> that lines of output from separate threads are not intermingled in the >> output)? >> D5: Are there any limitations to your approach? (For example, is there a >> maximum size string that can be written atomically?) System Auditing ================ ---- DATA STRUCTURES ---- >> E1: What data structures did you add or modify in order to implement >> thread_bytes_read(), thread_bytes_written(), and thread_files_open()? >> Describe each of your changes and its rationale in 25 words or less. ---- ALGORITHMS ---- >> E2: Describe your implementation of bytes_read(). >> E3: Describe your implementation of bytes_written(). >> E4: Describe your implementation of files_open(). >> E5: Describe your implementation of current_time(). >> E6: Describe what testing you did to verify that the new system calls work. ---- RATIONALE ---- >> E7: Does your approach have any limitations? Is there any circumstance in >> which your implementation could produce unexpected results? SURVEY QUESTIONS ================ >> About how many hours did our group spend on this project? How many hours >> would you say you personally spent? >> How has your use of git and docker changed since the beginning of the >> Pintos project? >> How evenly are you distributing tasks throughout your group? Do you have >> strong group communication? Are there things you need to improve in this >> area? >> Did you find that working on a particular part of the assignment gave you >> greater insight into some aspect of OS design? >> Is there some particular fact or hint we should give students in >> future semesters to help them solve the problems? >> Any other comments?