summaryrefslogtreecommitdiff
path: root/comboot.inc
diff options
context:
space:
mode:
authorhpa <hpa>2002-06-06 02:00:50 +0000
committerhpa <hpa>2002-06-06 02:00:50 +0000
commit702f0b85d3a26cfaab412ec3663f9b0ca50c48b4 (patch)
treeba4f4f478e356d21546c7b141344ff9b628d90e1 /comboot.inc
parentff925de6d538f8f95c375cba28f8616d19aee179 (diff)
downloadsyslinux-702f0b85d3a26cfaab412ec3663f9b0ca50c48b4.tar.gz
Fix COMBOOT return; support DOS system calls 00 and 4C (both are EXIT.)syslinux-1.75-pre3
Diffstat (limited to 'comboot.inc')
-rw-r--r--comboot.inc51
1 files changed, 33 insertions, 18 deletions
diff --git a/comboot.inc b/comboot.inc
index fbda0973..5d7019ed 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