memdisk: set up a limited-size real-mode stack
authorH. Peter Anvin <hpa@zytor.com>
Mon, 8 Jun 2009 00:06:59 +0000 (17:06 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 8 Jun 2009 00:06:59 +0000 (17:06 -0700)
Limit the size of the real-mode stack.  This should limit the amount
of memory needed for a relocated real-mode code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
memdisk/memdisk16.asm

index b020c70..e8e5d78 100644 (file)
@@ -33,6 +33,9 @@ BOUNCE_SEG    equ (MY_CS+0x1000)
                section .rodata align=16
                section .data   align=16
                section .bss    align=16
+               section .stack  align=16 nobits
+stack          resb 512
+stack_end      equ $
 
 ;; -----------------------------------------------------------------------
 ;;  Kernel image header
@@ -107,7 +110,7 @@ start:
                rep movsd
                mov ds,ax
                mov ss,ax
-               xor esp,esp             ; Stack at top of 64K segment
+               mov esp,stack_end
                jmp MY_CS:.next
 .next: