-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement exit() #8
Comments
@hangpark Currently working on defining parent-child relation. In #ifdef USERPROG
/* Owned by userprog/process.c. */
uint32_t *pagedir; /* Page directory. */
struct file *exec_file; /* File this thread executing. */
struct list child_list; /* Child thread this thread has. */
struct list open_file_list; /* File opened by this thread. */
struct child *identity; /* Contain info about child and exit. */
#endif
/* Owned by thread.c. */
unsigned magic; /* Detects stack overflow. */
};
#ifdef USERPROG
struct child
{
tid_t tid;
int exit_status;
struct list_elem elem;
};
struct opened_file
{
int fd;
struct file *file;
struct list_elem elem;
};
#endif |
@Lment Basically, I think this is good approach. For little comments,
|
|
For the last: If you're correct, then why do you store |
The process definition implementation is now moved to #48. This issue should be implemented based on it. |
Done by PR #50. |
Implement
exit()
.exit()
should be implemented first, since every user program finished in normal way always call exit. This should terminate current running program and return given status to kernel.This would need exit-handler to call
thread_exit()
in threads.c. Since pintos does not support multi-threading, when a thread exits, a process corresponding to that thread should be exited, too. So,thread_exit()
should callprocess_exit()
, which is defined in process.c.structure thread
defined in threads/thread.h should also be changed, to contain info about exiting.The text was updated successfully, but these errors were encountered: