summaryrefslogtreecommitdiff
path: root/bootother.S
diff options
context:
space:
mode:
authorrsc <rsc>2009-03-08 21:41:30 +0000
committerrsc <rsc>2009-03-08 21:41:30 +0000
commitb7f653dc49dd4af29a3b7bdd66cd712bea166623 (patch)
treee3bc07bdacacf2a7e311f3a87bbad243e5ba79d7 /bootother.S
parent8220135362c02b5e4a5532a561c6c1bd4b4d1540 (diff)
downloadxv6-labs-b7f653dc49dd4af29a3b7bdd66cd712bea166623.tar.gz
xv6-labs-b7f653dc49dd4af29a3b7bdd66cd712bea166623.tar.bz2
xv6-labs-b7f653dc49dd4af29a3b7bdd66cd712bea166623.zip
xv6: boot loader adjustments
do Bochs breakpoint and spin in bootasm.S. not needed in bootmain too. fix readseg bug (rounding of va). zero segments when memsz > filesz. no need to clear BSS in kernel main. make bootother.S like bootasm.S
Diffstat (limited to 'bootother.S')
-rw-r--r--bootother.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/bootother.S b/bootother.S
index 39b284d..cb3ff4c 100644
--- a/bootother.S
+++ b/bootother.S
@@ -61,7 +61,17 @@ protcseg:
movl start-4, %esp
movl start-8, %eax
- jmp *%eax
+ call *%eax
+
+ # If bootmain returns (it shouldn't), trigger a Bochs
+ # breakpoint if running under Bochs, then loop.
+ movw $0x8a00, %ax # 0x8a00 -> port 0x8a00
+ movw %ax, %dx
+ outw %ax, %dx
+ movw $0x8e00, %ax # 0x8e00 -> port 0x8a00
+ outw %ax, %dx
+spin:
+ jmp spin
# Bootstrap GDT
.p2align 2 # force 4 byte alignment