summaryrefslogtreecommitdiff
path: root/comboot.inc
diff options
context:
space:
mode:
authorhpa <hpa>2003-11-24 02:44:42 +0000
committerhpa <hpa>2003-11-24 02:44:42 +0000
commit43cf4dda600db1ccd05d9788c7b1da0cde7c0413 (patch)
tree0c69eaa8d2e0f49bc4ea8770762a97d4552771ad /comboot.inc
parent4a10396ab1f114fc37fa8f276e047fe3c283671c (diff)
downloadsyslinux-2.08-pre1.tar.gz
Fix COMBOOT/COM32 command-line generation.syslinux-2.08-pre1
Add test programs.
Diffstat (limited to 'comboot.inc')
-rw-r--r--comboot.inc34
1 files changed, 21 insertions, 13 deletions
diff --git a/comboot.inc b/comboot.inc
index 454d42c0..c8dbff11 100644
--- a/comboot.inc
+++ b/comboot.inc
@@ -75,16 +75,15 @@ is_comboot_image:
cmp ax,0ff00h ; Max size in bytes
jae comboot_too_large
+ push si ; Save file handle
+
+ call make_plain_cmdline
+
call comboot_setup_api
mov cx,comboot_seg
mov es,cx
- mov bx,100h ; Load at <seg>:0100h
-
- mov cx,[ClustPerMoby] ; Absolute maximum # of clusters
- call getfssec
-
xor di,di
mov cx,64 ; 256 bytes (size of PSP)
xor eax,eax ; Clear PSP
@@ -104,23 +103,32 @@ is_comboot_image:
%endif
%endif
; Copy the command line from high memory
+ mov si,cmd_line_here
mov cx,125 ; Max cmdline len (minus space and CR)
- mov si,[CmdOptPtr]
mov di,081h ; Offset in PSP for command line
mov al,' ' ; DOS command lines begin with a space
stosb
-comboot_cmd_cp: es lodsb
+.loop: es lodsb
and al,al
- jz comboot_end_cmd
+ jz .done
stosb
- loop comboot_cmd_cp
-comboot_end_cmd: mov al,0Dh ; CR after last character
+ loop .loop
+.done:
+
+ mov al,0Dh ; CR after last character
stosb
- mov al,126 ; Include space but not CR
- sub al,cl
- mov [es:80h], al ; Store command line length
+ mov ax,di
+ sub al,82h ; Include space but not CR
+ mov [es:80h],al ; Store command line length
+
+ ; Now actually load the file...
+ pop si ; File handle
+ mov bx,100h ; Load at <seg>:0100h
+ mov cx,[ClustPerMoby] ; Absolute maximum # of clusters
+ call getfssec
+ ; And invoke the program...
mov [SavedSSSP],sp
mov [SavedSSSP+2],ss ; Save away SS:SP