;; 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
; then do a hard reboot.
;
kaboom:
- lss sp,[cs:Stack]
+ lss sp,[cs:StackPtr]
mov ax,cs
mov ds,ax
mov es,ax
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
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
; 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
+