wok-current rev 23993

linld: hide -b=<base_himem> argument
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 12 17:26:44 2020 +0000 (2020-12-12)
parents 3d19917d3a03
children e07718b42e73
files linld/stuff/src/CRTL.ASM linld/stuff/src/LINLD.CPP linld/stuff/src/pipehole.awk
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sat Dec 12 10:41:29 2020 +0000
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Sat Dec 12 17:26:44 2020 +0000
     1.3 @@ -393,8 +393,8 @@
     1.4  
     1.5  		ifdef	USE_ARGSTR
     1.6  ;***************************************************************
     1.7 -;_fastcall int argstr(bx:const char *s, ax:const char keywords[], dx:const char **var);
     1.8 -;_fastcall int argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var);
     1.9 +;_fastcall const char ** argstr(bx:const char *s, ax:const char keywords[], dx:const char **var);
    1.10 +;_fastcall unsigned long *argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var);
    1.11  ;***************************************************************
    1.12  	global	@argstr$qpxzcxt1ppxzc:near
    1.13  	proc	@argstr$qpxzcxt1ppxzc near
    1.14 @@ -404,6 +404,7 @@
    1.15  	global	@argnum$qpzcxpxzcpul:near
    1.16  @argnum$qpzcxpxzcpul:
    1.17  		mov	cl,4
    1.18 +		push	bx
    1.19  		xchg	ax,bx			; keywords -> bx
    1.20  		xchg	ax,cx			; s -> cx
    1.21  		cbw				; argstr:0002 argnum:0004
    1.22 @@ -450,22 +451,21 @@
    1.23  		cmp	al,'='
    1.24  		;je	@@found
    1.25  		;cmp	al,0			; eos, si=next argv
    1.26 -		stc
    1.27 +		mov	ax,-1
    1.28  		jne	@@nokeyword
    1.29  @@found:
    1.30 -		mov	[di],si
    1.31  		dec	dx
    1.32  		dec	dx
    1.33  		je	@@done
    1.34  		;mov	bx,si
    1.35  		call	@strtol$qpxzc
    1.36 -		mov	[di],ax
    1.37 +		xchg	ax,si
    1.38  		mov	[di+2],dx
    1.39  @@done:
    1.40 -		clc
    1.41 +		mov	[di],si
    1.42 +		xchg	ax,di
    1.43  @@nokeyword:
    1.44 -		sbb	ax,ax
    1.45 -		pop	di si
    1.46 +		pop	di si bx
    1.47  		ret
    1.48  
    1.49  	endp	@argstr$qpxzcxt1ppxzc
     2.1 --- a/linld/stuff/src/LINLD.CPP	Sat Dec 12 10:41:29 2020 +0000
     2.2 +++ b/linld/stuff/src/LINLD.CPP	Sat Dec 12 17:26:44 2020 +0000
     2.3 @@ -75,12 +75,12 @@
     2.4  	    continue;
     2.5  	}
     2.6  #endif
     2.7 -	if (argstr(*argv,"cl|image|initrd",clp) != -1 && **argv == 'c') continue;
     2.8 +	if (argstr(*argv,"cl|image|initrd",clp) == (int) clp) continue;
     2.9 +	if (argnum(*argv,"root|vga|mem|-b",&root_dev) == (int) &base_himem) continue;
    2.10  	if (fileexist(*argv) != -1) {
    2.11              kernel_name=*argv;
    2.12  	    continue;
    2.13  	}
    2.14 -	argnum(*argv,"root|vga|mem|-b",&root_dev);
    2.15  	*clp = (const char *) buf_cmdline + 1;
    2.16  	strcatb((const char *) buf_cmdline,*argv);
    2.17      }
     3.1 --- a/linld/stuff/src/pipehole.awk	Sat Dec 12 10:41:29 2020 +0000
     3.2 +++ b/linld/stuff/src/pipehole.awk	Sat Dec 12 17:26:44 2020 +0000
     3.3 @@ -38,13 +38,15 @@
     3.4  	if (/image\|initrd/) islinld=3
     3.5  	if (islinld==3) {
     3.6  		if (/bx,word ptr/) { print "; " $0; next }
     3.7 -		if (/short @1@282/) print "	mov	bx,word ptr [si]"
     3.8 -		if (/@fileexist\$qpxzc/) islinld=0
     3.9  	}
    3.10  	if (/fileexist\$qpxzc/) islinld=4
    3.11  	if (islinld==4) {
    3.12 -		if (/ax,-1/) print "	mov	bx,word ptr [si]"
    3.13 -		if (/ax,word ptr/) $0="	xchg	ax,bx"
    3.14 +		if (/ax,-1/) {
    3.15 +			print "	inc	ax"
    3.16 +			print "	mov	ax,word ptr [si]"
    3.17 +			next
    3.18 +		}
    3.19 +		if (/ax,word ptr/) next
    3.20  		if (/\[si\]$/) { islinld=0; print "; " $0; next }
    3.21  	}
    3.22  	if (/buf_cmdline\+1/) {
    3.23 @@ -54,6 +56,7 @@
    3.24  	}
    3.25  	if (islinld==5) {
    3.26  		if (/bx,offset DGROUP:buf_cmdline/) $0="	dec	bx"
    3.27 +		if (/ax,word ptr/) next
    3.28  		if (/call/) islinld=0
    3.29  	}
    3.30  	 } # file == "linld.cpp"