duguosheng/6.S081-All-in-one

the trace function in lab 2 misses modifications to fork

Closed this issue · 1 comments

as the info in the lab2, the trace should add some modification in the fork() function, which doesn't show in your document.

diff --git a/kernel/proc.c b/kernel/proc.c
index 6afafa1..01c178a 100644
--- a/kernel/proc.c
+++ b/kernel/proc.c
@@ -268,6 +268,10 @@ fork(void)
   }
 
   // Copy user memory from parent to child.
+
+  // add mask
+  np->mask = p->mask;
+
   if(uvmcopy(p->pagetable, np->pagetable, p->sz) < 0){
     freeproc(np);
     release(&np->lock);

but over all, thx for your effort!

做实验的时候没有写lab1-3的解析文档,当回过头去写的时候漏掉了一些内容. 谢谢你的指正,已添加^_^