Make sure we have at least 4K for the stack.
authorhpa <hpa>
Mon, 22 Aug 2005 22:07:32 +0000 (22:07 +0000)
committerhpa <hpa>
Mon, 22 Aug 2005 22:07:32 +0000 (22:07 +0000)
isolinux.asm
layout.inc

index d1697d6..f488dba 100644 (file)
@@ -218,9 +218,9 @@ xbs_vgatmpbuf       equ 2*trackbufsize
 ;; CD-ROM sector (2K) of the file, so the number one priority is actually
 ;; loading the rest.
 ;;
-bootsec                equ $
+StackBuf       equ $
 
-StackBuf       equ $-44
+bootsec                equ $
 
 _start:                ; Far jump makes sure we canonicalize the address
                cli
@@ -759,7 +759,7 @@ xint13:             mov byte [RetryCount],retry_count
 ;        then do a hard reboot.
 ;
 kaboom:
-               lss sp,[cs:Stack]
+               lss sp,[cs:StackPtr]
                mov ax,cs
                mov ds,ax
                mov es,ax
@@ -818,7 +818,7 @@ crlf_msg    db CR, LF
 null_msg       db 0
 
                alignb 4, db 0
-Stack          dw _start, 0                    ; SS:SP for stack reset
+StackPtr       dw StackBuf, 0                  ; SS:SP for stack reset
 MaxTransfer    dw 32                           ; Max sectors per transfer
 
 rl_checkpt     equ $                           ; Must be <= 800h
index 6021d69..e3c1fbf 100644 (file)
@@ -25,9 +25,15 @@ BSS_START    equ 0800h
 TEXT_START     equ 7C00h
 
 ; The secondary BSS section, above the text; we really wish we could
-; just make it follow .bcopy32, but it doesn't seem to work that way.
+; just make it follow .bcopy32 or hang off the end,
+; but it doesn't seem to work that way.
 LATEBSS_START  equ 0B000h
 
+; Reserve memory for the stack.  This causes checkov to abort the
+; compile if we violate this space.
+STACK_SIZE     equ 4096
+STACK_START    equ TEXT_START-STACK_SIZE
+
 %ifdef MAP
                [map all MAP]
 %endif
@@ -52,3 +58,7 @@ LATEBSS_START equ 0B000h
                ; NASM BUG: We would like to do follows=.bcopy32
                section .latebss  nobits align=16 start=LATEBSS_START
 
+               ; Reserve space for stack
+               section .stack    nobits align=16 start=STACK_START
+Stack          resb    STACK_SIZE
+