]> Devi Nivas Git - cs3210-lab1.git/commitdiff
nothing much
authorRobert Morris <rtm@csail.mit.edu>
Thu, 11 Aug 2016 19:41:53 +0000 (15:41 -0400)
committerRobert Morris <rtm@csail.mit.edu>
Thu, 11 Aug 2016 19:41:53 +0000 (15:41 -0400)
initcode.S
proc.c
vm.c

index 109341a44190299c1b94b16df56474f55d51925c..80ac5d8567ea2c105fded78ae43f1300d2762110 100644 (file)
@@ -1,4 +1,5 @@
 # Initial process execs /init.
+# This code runs in user space.
 
 #include "syscall.h"
 #include "traps.h"
diff --git a/proc.c b/proc.c
index 3ac41f65697733f2ef3b6bcbc78f93656d47a5e7..b6dd11f06b3ff4ced263b605ebb98ec8e7e013aa 100644 (file)
--- a/proc.c
+++ b/proc.c
@@ -283,7 +283,7 @@ scheduler(void)
       proc = p;
       switchuvm(p);
       p->state = RUNNING;
-      swtch(&cpu->scheduler, proc->context);
+      swtch(&cpu->scheduler, p->context);
       switchkvm();
 
       // Process is done running for now.
diff --git a/vm.c b/vm.c
index cd36db501fb34c3a076196f4d0dd8d68bc4803cc..dfc5b3cf60e29f50bf89ae591007aa663751e3d4 100644 (file)
--- a/vm.c
+++ b/vm.c
@@ -171,7 +171,7 @@ switchuvm(struct proc *p)
   ltr(SEG_TSS << 3);
   if(p->pgdir == 0)
     panic("switchuvm: no pgdir");
-  lcr3(v2p(p->pgdir));  // switch to new address space
+  lcr3(v2p(p->pgdir));  // switch to process's address space
   popcli();
 }