From 702f0b85d3a26cfaab412ec3663f9b0ca50c48b4 Mon Sep 17 00:00:00 2001 From: hpa Date: Thu, 6 Jun 2002 02:00:50 +0000 Subject: [PATCH] Fix COMBOOT return; support DOS system calls 00 and 4C (both are EXIT.) --- NEWS | 6 ++++++ comboot.inc | 51 +++++++++++++++++++++++++++++++++------------------ isolinux.asm | 3 ++- ldlinux.asm | 3 ++- pxelinux.asm | 3 ++- 5 files changed, 45 insertions(+), 21 deletions(-) diff --git a/NEWS b/NEWS index 7675b95..7edf945 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,12 @@ Changes in 1.75: * ISOLINUX: Add a few more workarounds for various broken El Torito BIOSes. * Make sure .depend files aren't accidentally packed... + * ALL: Fix bugs in the extension-detect code; this caused + files like COMBOOT images and CD boot sectors to be + mis-identified as Linux kernels and rejected. + * ALL: Fix the return from COMBOOT. + * ALL: Do some of the early groundwork for supporting DOS + system calls in COMBOOT. Changes in 1.74: * SYSLINUX: fix bug that would cause valid kernel images to be diff --git a/comboot.inc b/comboot.inc index fbda097..5d7019e 100644 --- a/comboot.inc +++ b/comboot.inc @@ -37,12 +37,15 @@ is_comboot_image: ; ; Set up the DOS vectors in the IVT (INT 20h-3fh) ; - mov dword [4*0x20],comboot_return ; INT 20h vector - mov eax,comboot_bogus - mov di,4*0x21 - mov cx,31 ; All remaining DOS vectors + mov di,4*0x20 ; DOS interrupt vectors + mov eax,comboot_return + stosd + mov ax,comboot_int21 + stosd + mov ax,comboot_bogus + mov cx,30 ; All remaining DOS vectors rep stosd - + mov cx,comboot_seg mov es,cx @@ -79,8 +82,7 @@ comboot_end_cmd: mov al,0Dh ; CR after last character mov [es:80h], al ; Store command line length mov [SavedSSSP],sp - mov ax,ss ; Save away SS:SP - mov [SavedSSSP+2],ax + mov [SavedSSSP+2],ss ; Save away SS:SP call vgaclearmode ; Reset video @@ -94,23 +96,36 @@ comboot_end_cmd: mov al,0Dh ; CR after last character ; Proper return vector comboot_return: cli ; Don't trust anyone - lss sp,[cs:SavedSSSP] - mov ds,ax - mov es,ax - sti - cld - jmp cb_enter + xor ax,ax + jmp comboot_exit + +; INT 21h: generic DOS system call +comboot_int21: and ah,ah ; 00 = return + je comboot_return + cmp ah,4Ch ; 4C = return with status + je comboot_return -; Attempted to execute DOS system call + ; Otherwise fall through to comboot_bogus + +; Attempted to execute non-21h DOS system call comboot_bogus: cli ; Don't trust anyone + mov ax,err_notdos + +; +; Generic COMBOOT return to command line code +; +comboot_exit: lss sp,[cs:SavedSSSP] - mov ds,ax - mov es,ax + xor dx,dx + mov ds,dx + mov es,dx sti cld + and ax,ax + je .nomsg mov si,KernelCName call cwritestr - mov si,err_notdos + xchg si,ax call cwritestr - jmp cb_enter +.nomsg: jmp cb_enter diff --git a/isolinux.asm b/isolinux.asm index bfa6b91..3373f59 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -646,7 +646,8 @@ checkerr_msg: db 'Image checksum error, sorry...', CR, LF, 0 err_bootfailed db CR, LF, 'Boot failed: press a key to retry...' bailmsg equ err_bootfailed -crlf_msg db CR, LF, 0 +crlf_msg db CR, LF +null_msg db 0 ; ; El Torito spec packet diff --git a/ldlinux.asm b/ldlinux.asm index 008a82f..955665a 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -1685,7 +1685,8 @@ loading_msg db 'Loading ', 0 dotdot_msg db '.' dot_msg db '.', 0 aborted_msg db ' aborted.' ; Fall through to crlf_msg! -crlf_msg db CR, LF, 0 +crlf_msg db CR, LF +null_msg db 0 crff_msg db CR, FF, 0 syslinux_cfg db 'SYSLINUXCFG' ; diff --git a/pxelinux.asm b/pxelinux.asm index a549432..9615b45 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -2297,7 +2297,8 @@ dotdot_msg db '.' dot_msg db '.', 0 fourbs_msg db BS, BS, BS, BS, 0 aborted_msg db ' aborted.' ; Fall through to crlf_msg! -crlf_msg db CR, LF, 0 +crlf_msg db CR, LF +null_msg db 0 crff_msg db CR, FF, 0 default_str db 'default', 0 default_len equ ($-default_str) -- 2.7.4