From 0a4a533cc1c0e0c7e526f454d29b416bb580df0f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 7 Jun 2009 17:06:59 -0700 Subject: [PATCH] memdisk: set up a limited-size real-mode stack 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 --- memdisk/memdisk16.asm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memdisk/memdisk16.asm b/memdisk/memdisk16.asm index b020c70..e8e5d78 100644 --- a/memdisk/memdisk16.asm +++ b/memdisk/memdisk16.asm @@ -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: -- 2.7.4