Call serial_flush() in power_off().
[pintos-anon] / src / threads / loader.S
index 704b1d9b2f76a93e3d2e20a31b375562a22f65b9..42f489979dff15704d4cd3efa023c9954f03913b 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include "threads/loader.h"
-#include "threads/mmu.h"
+/*#include "threads/mmu.h"*/
        
 #### Kernel loader.
 
@@ -59,6 +59,8 @@
 
 # Code runs in real mode, which is a 16-bit segment.
 
+.globl start
+start:
        .code16
 
 # Disable interrupts.
        rep stosl
 
 # Set PDEs for 0 and LOADER_PHYS_BASE to point to the page table.
+# See comments near the PG_* macros in paging.h for a description of
+# the values stored here.
 
-       movl $0x11000 | PG_U | PG_W | PG_P, %eax
+       movl $0x11007, %eax
        movl %eax, %es:0
        movl %eax, %es:LOADER_PHYS_BASE >> 20
 
 # Initialize page table.
 
-       movl $PG_U | PG_W | PG_P, %eax
+       movl $7, %eax
        movl $0x400, %ecx
 1:     stosl
        addl $0x1000, %eax
@@ -251,9 +255,9 @@ read_sector:
 
 # Transfer sector.
 
-       movl $512 / 4, %ecx
+       movl $256, %ecx
        movl $0x1f0, %edx
-       rep insl
+       rep insw
 
 # Next sector.