wok-6.x rev 23870

syslinux: update iso2exe.sh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jun 23 08:04:01 2020 +0000 (2020-06-23)
parents 7880bcb5c1e0
children 53914b720f76
files linld/stuff/src/CRTL.ASM linld/stuff/src/ISO9660.CPP linld/stuff/src/pipehole.awk syslinux/stuff/iso2exe/iso2exe.sh
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sun Jun 21 19:06:48 2020 +0000
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Tue Jun 23 08:04:01 2020 +0000
     1.3 @@ -1123,10 +1123,11 @@
     1.4  @@digitok:
     1.5  		cmp	al,cl
     1.6  		jae	@@endstrtol
     1.7 +		cbw
     1.8 +		cwde
     1.9  		xchg	eax,ebx
    1.10  		mul	ecx
    1.11 -		add	eax,ebx
    1.12 -		xchg	eax,ebx
    1.13 +		add	ebx,eax
    1.14  		jmp	@@strtollp
    1.15  @@endstrtol:
    1.16  		mov	cl,10
    1.17 @@ -1154,23 +1155,14 @@
    1.18  		endif
    1.19  		else
    1.20  		ifndef	USE_ARGSTR
    1.21 -		push	si di
    1.22 -		xor	ax,ax
    1.23 -		cwd
    1.24 -		or	bx,bx
    1.25 -		else
    1.26 -		push	di
    1.27 -		xor	ax,ax
    1.28 -		cwd
    1.29 -		or	si,si
    1.30 -		endif
    1.31 -		jz	@@goend
    1.32 -		xchg	ax,di
    1.33 -		ifndef	USE_ARGSTR
    1.34 +		push	si
    1.35  		mov	si,bx
    1.36  		endif
    1.37 +		or	si,si
    1.38 +		jz	@@goend
    1.39  		xor	bx,bx
    1.40  		xor	cx,cx
    1.41 +		xor	dx,dx
    1.42  		lodsb
    1.43  		or	al,20h
    1.44  		cmp	al,'a'
    1.45 @@ -1214,20 +1206,15 @@
    1.46  @@digitok:
    1.47  		cmp	al,cl
    1.48  		jae	@@endstrtol
    1.49 +		cbw
    1.50  
    1.51  		push	ax
    1.52 -		push	dx
    1.53 +		xchg	ax,dx
    1.54 +		mul	cx
    1.55  		xchg	ax,bx
    1.56  		mul	cx
    1.57 -		xchg	ax,bx
    1.58 -		xchg	ax,dx
    1.59 -		xchg	ax,di
    1.60 -		pop	ax
    1.61 -		mul	cx
    1.62 -		add	ax,di
    1.63 -		xchg	ax,dx
    1.64 -		pop	ax
    1.65 -		mov	ah,0
    1.66 +		add	dx,bx
    1.67 +		pop	bx
    1.68  		add	bx,ax
    1.69  		adc	dx,0
    1.70  
    1.71 @@ -1257,9 +1244,7 @@
    1.72  		xchg	ax,bx
    1.73  @@popdisiret:
    1.74  		ifndef	USE_ARGSTR
    1.75 -		pop	di si
    1.76 -		else
    1.77 -		pop	di
    1.78 +		pop	si
    1.79  		endif
    1.80  		endif
    1.81  strtol_ret:
     2.1 --- a/linld/stuff/src/ISO9660.CPP	Sun Jun 21 19:06:48 2020 +0000
     2.2 +++ b/linld/stuff/src/ISO9660.CPP	Tue Jun 23 08:04:01 2020 +0000
     2.3 @@ -36,9 +36,7 @@
     2.4  int isoreaddir(void)
     2.5  {
     2.6  	char *p;
     2.7 -#ifdef __ROCKRIDGE
     2.8 -	char *endname;
     2.9 -#endif
    2.10 +
    2.11  	struct isostate *x=&isostate;
    2.12  
    2.13  	if (x->curdirsize == 0xFFFF) {
    2.14 @@ -65,31 +63,20 @@
    2.15  	//x->filemod = (p[25] & 2) ? 0040755 : 0100755;
    2.16  	//x->filemod = 0100755 - ((p[25] & (char)2) << 13);
    2.17  #ifdef __ROCKRIDGE
    2.18 -	endname = NULL;
    2.19  	// p += 34 + (p[32] & -2); ?
    2.20  	p = x->buffer + 34 + ((p[32] + x->curpos) & -2);
    2.21  	do {
    2.22 -		int len = p[2];
    2.23 -# if 0
    2.24 -		switch (* (short *) p) {
    2.25 -		case 0x5850: // PX
    2.26 -			x->filemod = * (short *) (p + 4);
    2.27 -			break;
    2.28 -		case 0x4D4E: // NM
    2.29 -# else
    2.30 +		register len = p[2];
    2.31  		if (* (short *) p == 0x4D4E) {
    2.32 -# endif
    2.33  			x->filename = p + 5;
    2.34 -			endname = p + len;
    2.35 +			p[len] = 0;
    2.36 +			goto found;
    2.37  		}
    2.38  		p += len;
    2.39 +#ifndef ISOHOOK
    2.40  	} while (x->buffer + x->curpos + x->entrysize - 2 > p);
    2.41 -#ifdef ISOHOOK
    2.42 -	*endname = 0;
    2.43  #else
    2.44 -	if (endname)
    2.45 -		*endname = 0;
    2.46 -	else
    2.47 +	} while (1);
    2.48  #endif
    2.49  #endif
    2.50  #ifndef ISOHOOK
    2.51 @@ -111,6 +98,7 @@
    2.52  		}
    2.53  	}
    2.54  #endif
    2.55 +found:
    2.56  	x->curpos += x->entrysize;
    2.57  	return 0;
    2.58  }
     3.1 --- a/linld/stuff/src/pipehole.awk	Sun Jun 21 19:06:48 2020 +0000
     3.2 +++ b/linld/stuff/src/pipehole.awk	Tue Jun 23 08:04:01 2020 +0000
     3.3 @@ -203,6 +203,13 @@
     3.4  	}
     3.5  	 } # file == "load.cpp"
     3.6  	 if (file == "iso9660.cpp") {
     3.7 +	if (/register len/) isiso=12
     3.8 +	if (isiso == 12) { # ISO9660.LST
     3.9 +		sub(/mov	dx,ax/,"xchg	ax,bx")
    3.10 +		if (/bx,dx/) next
    3.11 +		sub(/i,dx/,"i,bx")
    3.12 +		if (/while/) isiso=0
    3.13 +	}
    3.14  	if (/while \(\*\+\+s/) isiso=11
    3.15  	if (isiso == 11) { # ISO9660.LST
    3.16  		if (/cmp/ || /filename2open/) isiso=0
     4.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Sun Jun 21 19:06:48 2020 +0000
     4.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Tue Jun 23 08:04:01 2020 +0000
     4.3 @@ -252,19 +252,18 @@
     4.4  
     4.5  restore_hybrid_mbr()
     4.6  {
     4.7 -	if [ $(get 0 "$1") -eq 60905 ]; then
     4.8 +	[ $(get 0 "$1") -eq 60905 ] &&
     4.9  		ddn bs=1 if="$1" of="$1" skip=$((0x1BE)) seek=0 count=3
    4.10 -		ddn bs=1 skip=$((0x1BE)) count=66 if="$2" | \
    4.11 -			ddq bs=1 seek=$((0x1BE)) count=66 of="$1"
    4.12 -		if [ -n "$RECURSIVE_PARTITION" ]; then
    4.13 -			for i in 0 1 2 3 ; do
    4.14 -				n=$(get $((0x1C6+16*i)) $1 4)
    4.15 -				[ $n -eq 0 -o $n -gt 64 ] && continue
    4.16 -				store $((0x1C0+16*i)) 1 $1 8
    4.17 -				store $((0x1C6+16*i)) 0 $1 32
    4.18 -				store $((0x1CA+16*i)) $(($(get $((0x1CA+16*i)) $1 4)+$n)) $1 32
    4.19 -			done
    4.20 -		fi
    4.21 +	ddn bs=1 skip=$((0x1BE)) count=66 if="$2" | \
    4.22 +		ddq bs=1 seek=$((0x1BE)) count=66 of="$1"
    4.23 +	if [ -n "$RECURSIVE_PARTITION" ]; then
    4.24 +		for i in 0 1 2 3 ; do
    4.25 +			n=$(get $((0x1C6+16*i)) $1 4)
    4.26 +			[ $n -eq 0 -o $n -gt 64 ] && continue
    4.27 +			store $((0x1C0+16*i)) 1 $1 8
    4.28 +			store $((0x1C6+16*i)) 0 $1 32
    4.29 +			store $((0x1CA+16*i)) $(($(get $((0x1CA+16*i)) $1 4)+$n)) $1 32
    4.30 +		done
    4.31  	fi
    4.32  }
    4.33