Randomize the bits that bitmap_scan() returns, to make student errors
[pintos-anon] / src / threads / loader.S
index fc834ffa45642eaba3203ab7f3c844f3305d11b5..ca79cdfda730cf75ba173750feb1aa76d0776bc2 100644 (file)
@@ -138,7 +138,9 @@ start:
 
 # Add PDEs to point to PTEs for the first 64 MB of RAM.
 # Also add identical PDEs starting at LOADER_PHYS_BASE.
-# See [IA32-v3] section 3.7.6 for a description of the bits in %eax.
+# See [IA32-v3a] section 3.7.6 "Page-Directory and Page-Table Entries"
+# for a description of the bits in %eax.
+       
 
        movl $0x11007, %eax
        movl $0x11, %ecx
@@ -150,7 +152,8 @@ start:
        loop 1b
 
 # Set up one-to-map linear to physical map for the first 64 MB of RAM.
-# See [IA32-v3] section 3.7.6 for a description of the bits in %eax.
+# See [IA32-v3a] section 3.7.6 "Page-Directory and Page-Table Entries"
+# for a description of the bits in %eax.
 
        movw $0x1100, %ax
        movw %ax, %es
@@ -217,6 +220,17 @@ start:
 
        movl $1, %ebx
        movl $LOADER_KERN_BASE + LOADER_PHYS_BASE, %edi
+
+# Disable interrupt delivery by IDE controller, because we will be
+# polling for data.
+# (If we don't do this, Bochs 2.2.6 will never deliver any IDE
+# interrupt to us later after we reset the interrupt controller during
+# boot, even if we also reset the IDE controller.)
+
+       movw $0x3f6, %dx
+       movb $0x02, %al
+       outb %al, %dx
+       
 read_sector:
 
 # Poll status register while controller busy.