|
@ -382,7 +382,7 @@ do_fork(uint32_t clone_flags, uintptr_t stack, struct trapframe *tf) { |
|
|
* setup the kernel entry point and stack of process |
|
|
* setup the kernel entry point and stack of process |
|
|
* hash_proc: add proc into proc hash_list |
|
|
* hash_proc: add proc into proc hash_list |
|
|
* get_pid: alloc a unique pid for process |
|
|
* get_pid: alloc a unique pid for process |
|
|
* wakup_proc: set proc->state = PROC_RUNNABLE |
|
|
|
|
|
|
|
|
* wakeup_proc: set proc->state = PROC_RUNNABLE |
|
|
* VARIABLES: |
|
|
* VARIABLES: |
|
|
* proc_list: the process set's list |
|
|
* proc_list: the process set's list |
|
|
* nr_process: the number of process set |
|
|
* nr_process: the number of process set |
|
@ -393,7 +393,7 @@ do_fork(uint32_t clone_flags, uintptr_t stack, struct trapframe *tf) { |
|
|
// 3. call copy_mm to dup OR share mm according clone_flag |
|
|
// 3. call copy_mm to dup OR share mm according clone_flag |
|
|
// 4. call copy_thread to setup tf & context in proc_struct |
|
|
// 4. call copy_thread to setup tf & context in proc_struct |
|
|
// 5. insert proc_struct into hash_list && proc_list |
|
|
// 5. insert proc_struct into hash_list && proc_list |
|
|
// 6. call wakup_proc to make the new child process RUNNABLE |
|
|
|
|
|
|
|
|
// 6. call wakeup_proc to make the new child process RUNNABLE |
|
|
// 7. set ret vaule using child proc's pid |
|
|
// 7. set ret vaule using child proc's pid |
|
|
|
|
|
|
|
|
//LAB5 YOUR CODE : (update LAB4 steps) |
|
|
//LAB5 YOUR CODE : (update LAB4 steps) |
|
@ -615,7 +615,7 @@ bad_mm: |
|
|
goto out; |
|
|
goto out; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// do_execve - call exit_mmap(mm)&pug_pgdir(mm) to reclaim memory space of current process |
|
|
|
|
|
|
|
|
// do_execve - call exit_mmap(mm)&put_pgdir(mm) to reclaim memory space of current process |
|
|
// - call load_icode to setup new memory space accroding binary prog. |
|
|
// - call load_icode to setup new memory space accroding binary prog. |
|
|
int |
|
|
int |
|
|
do_execve(const char *name, size_t len, unsigned char *binary, size_t size) { |
|
|
do_execve(const char *name, size_t len, unsigned char *binary, size_t size) { |
|
|