+--------------------------+ | CS 439 | | PROJECT 2: USER PROGRAMS | | DESIGN DOCUMENT | +--------------------------+ For this design document, please *each* submit the header, but you do not need to fill out the questions. We will cover all questions (in content, if not in form) in the interview. When you have completed the header, submit it to the Canvas assignment Project 2 Design and Documentation. ***Your submission must be a text file and each line must not extend past 80 characters. (Note that rtf files are NOT text files.) ---- Name ---- >> Fill your name, UT EID, CS login, email address, and unique number: Name: EID: CS login: Email: Unique Number: Slip days used on this project: ---- GROUP ---- >> Fill the names, UT EIDs, CS logins, email addresses, and unique numbers >> of your group members. Also fill in each person's ranking on the >> partner evaluation scale, as determined by you. Name: EID: CS login: Email: Unique Number: Name: EID: CS login: Email: Unique Number: Name: EID: CS login: Email: Unique Number: ---- PRELIMINARIES ---- >> If you have any preliminary comments on your submission, notes for the >> TAs, or extra credit, 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', ‘#define’, or >> enumeration that was necessary to implement argument passing. >> 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? Is it enough to limit >> the size of the incoming commandline? Why or Why not? ---- RATIONALE ---- >> A3: Why does Pintos implement strtok_r() but not strtok()? >> A4: In Pintos, the kernel separates commands into an executable name >> and arguments. In Unix-like systems, the shell does this >> separation. Identify at least two advantages of the Unix approach. SYSTEM CALLS ============ ---- DATA STRUCTURES ---- >> B1: Copy here the declaration of each new or changed `struct' or >> `struct' member, global or static variable, `typedef', ‘#define’, or >> enumeration. Identify the purpose of each in 25 words or less. >> B2: Describe how file descriptors are associated with open files. >> Are file descriptors unique within the entire OS or just within a >> single process? ---- ALGORITHMS ---- >> B3: Describe your code for accessing user data in the >> kernel. >> B4: Suppose a system call causes a full page (4,096 bytes) of data >> to be copied from user space into the kernel. Based on your code, >> 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? >> 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 >> sentences, describe the strategy or strategies you adopted for >> managing these issues. Give an example. ---- SYNCHRONIZATION ---- >> B6: Briefly describe your implementation of the "wait" system call >> and how it interacts with process termination. >> B7: Consider parent process P with child process C. Explain how >> how your code ensures synchronization and avoids race conditions >> in each of the following cases: >> a) when P calls wait(C) before C exits? >> b) when P calls wait(C) after C exits? >> c) when P terminates without waiting before C exits? >> d) when P terminates without waiting after C exits? >> e) Are there any special cases? >> B8: 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"? ---- RATIONALE ---- >> 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? SURVEY QUESTIONS ================ Answering these questions is optional, but it will help us improve the course in future semesters. Feel free to tell us anything you want--these questions are just to spur your thoughts. You may also choose to respond anonymously in the course evaluations at the end of the semester. >> In your opinion, was this assignment, or any one of the three problems >> in it, too easy or too hard? Did it take too long or too little time? >> 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? Conversely, did you >> find any of our guidance to be misleading? >> Do you have any suggestions for the TAs to more effectively assist >> students, either for future semesters or the remaining projects? >> Any other comments?