]> Devi Nivas Git - cs3210-lab1.git/commitdiff
better comment
authorFrans Kaashoek <kaashoek@mit.edu>
Fri, 26 Aug 2016 12:46:13 +0000 (08:46 -0400)
committerFrans Kaashoek <kaashoek@mit.edu>
Fri, 26 Aug 2016 12:46:13 +0000 (08:46 -0400)
vm.c

diff --git a/vm.c b/vm.c
index d4982ee04acd25a7b2fb4f09fbc4fff798d7bd8c..c8b8d352d720797779dbb67118da73710e6e8508 100644 (file)
--- a/vm.c
+++ b/vm.c
@@ -168,7 +168,9 @@ switchuvm(struct proc *p)
   cpu->gdt[SEG_TSS].s = 0;
   cpu->ts.ss0 = SEG_KDATA << 3;
   cpu->ts.esp0 = (uint)proc->kstack + KSTACKSIZE;
-  cpu->ts.iomb = (ushort) 0xFFFF;  // forbid I/O instructions from user space
+  // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
+  // forbids I/O instructions (e.g., inb and outb) from user space
+  cpu->ts.iomb = (ushort) 0xFFFF;
   ltr(SEG_TSS << 3);
   if(p->pgdir == 0)
     panic("switchuvm: no pgdir");