summaryrefslogtreecommitdiff
path: root/menu/startup.S16
diff options
context:
space:
mode:
authorhpa <hpa>2004-02-03 05:43:51 +0000
committerhpa <hpa>2004-02-03 05:43:51 +0000
commitc9f10f56c574d0dca79045a915ee28885b834af5 (patch)
tree385d5111f5b80428bcdcd1c49a18eaeae53049ef /menu/startup.S16
parent06c1e5db300b4f5abf58d95584ef7e54345de404 (diff)
downloadsyslinux-c9f10f56c574d0dca79045a915ee28885b834af5.tar.gz
Be a bit more paranoid about entry conditions.
Diffstat (limited to 'menu/startup.S16')
-rw-r--r--menu/startup.S1610
1 files changed, 9 insertions, 1 deletions
diff --git a/menu/startup.S16 b/menu/startup.S16
index df821093..6ca7ced0 100644
--- a/menu/startup.S16
+++ b/menu/startup.S16
@@ -2,14 +2,22 @@
.globl _start
_start:
+ /* Make sure stack pointer is normalized */
+ movzwl %sp,%esp
+
+ /* Zero .bss */
movw $__bss_start,%di
xorl %eax,%eax
- movw $_end,%cx
+ movw $(_end+3),%cx
subw %di,%cx
shrw $2,%cx
+ cld
rep ; stosl
+ /* Invoke main() */
calll main
+
+ /* Terminate program (with error code in %al) */
movb $0x4c,%ah
int $0x21
hlt