Since we might be having COM32 and COM32R in the same filesystem, do
check for the appropriate COM32R magic before doing anything else.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
mov bx,abort_check ; Don't print dots, but allow abort
call load_high
+ mov esi,com32_entry
+ mov edi,trackbuf
+ mov ecx,5
+ call bcopy
+ cmp dword [trackbuf],0xcd4cfeb8
+ jne not_com32r
+ cmp byte [trackbuf+4],0x21
+ jne not_com32r
+
com32_start:
;
; Point the stack to the end of (permitted) high memory
mov dword [PMESP],__stack_end ; Stop use of COM32 stack
sti
jmp enter_command
+
+not_com32r:
+ mov si,KernelCName
+ call writestr
+ mov si,not_com32r_msg
+ call writestr
+ jmp enter_command
+
+ section .data16
+not_com32r_msg db ': not a COM32R image', CR, LF, 0
something like Linux DOSEMU, it is recommended that the code does not
assume CPL 0 unless absolutely necessary.
-It is highly recommended that every COM32R program begins with the byte
-sequence B8 FE 4C CD 21 (mov eax,21cd4cfeh) as a magic number.
+A COM32R program must start with the byte sequence B8 FE 4C CD 21 (mov
+eax,21cd4cfeh) as a magic number.
The COM32R format replaces the earlier COM32 format, which was linked
to a fixed address (0x101000).