For some reason i386-elf-as doesn't like 512/4, so replace it by 128.
[pintos-anon] / src / threads / loader.S
index 3d440d20d58d2b30c3228c65c278a82cf8d51893..e87a6c6530a3c3b2550b9376c94750d25942d5e3 100644 (file)
@@ -59,6 +59,8 @@
 
 # Code runs in real mode, which is a 16-bit segment.
 
+.globl start
+start:
        .code16
 
 # Disable interrupts.
        cli
        cld
 
-# Set up segment registers and stack.
-# Stack grows downward starting from us.
+# Set up data segments and stack.
 
        subw %ax, %ax
        movw %ax, %es
        movw %ax, %ds
+
+# Stack grows downward starting from us.
+# We don't ever use the stack so this is strictly speaking
+# unnecessary.
+
        movw %ax, %ss
        movw $0x7c00, %sp
        
@@ -247,9 +253,9 @@ read_sector:
 
 # Transfer sector.
 
-       movl $512 / 4, %ecx
+       movl $256, %ecx
        movl $0x1f0, %edx
-       rep insl
+       rep insw
 
 # Next sector.