wok diff syslinux/stuff/iso2exe/bootiso.S @ rev 17496

syslinux/iso2exe: check ISO md5 (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jan 05 12:38:18 2015 +0100 (2015-01-05)
parents 6aed6fc5819d
children 00bb1e4137c6
line diff
     1.1 --- a/syslinux/stuff/iso2exe/bootiso.S	Sat Dec 27 17:56:57 2014 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/bootiso.S	Mon Jan 05 12:38:18 2015 +0100
     1.3 @@ -26,24 +26,23 @@
     1.4  	.word	0			// File address of relocation table
     1.5  id:
     1.6  	.word	0			// Overlay number
     1.7 -fdcnt:
     1.8 +fdcnt:					// File address of relocation table
     1.9  	.byte	0			// Bootstrap floppy sector count
    1.10  
    1.11  /////////////////////// Master Boot Record code //////////////////////////////
    1.12  
    1.13 -start0:					// File address of relocation table
    1.14 -	pushw	%dx			// restore SP
    1.15 +start0:
    1.16 +	pushw	%dx			// restore %sp
    1.17  	incw	%bp			// restore %bp
    1.18 -	pushw	$0
    1.19 -	popw	%ds
    1.20 -	movw	$0x7C00, %bx
    1.21 -	pushfw
    1.22 -	pushw	%ds
    1.23 -	pushw	%bx
    1.24 +	xorw	%bx, %bx
    1.25 +	movw	%bx, %ds
    1.26 +	movb	$0x7C, %bh
    1.27 +	pushw	%bx			// return address
    1.28  	pushaw
    1.29  	movw	%sp, %bp
    1.30 -	pushw	%es
    1.31 +	pushw	%es			// save %es:%di
    1.32  	cld
    1.33 +	sti
    1.34  	pushw	%ds
    1.35  	popw	%es
    1.36  	call	setreg
    1.37 @@ -60,9 +59,11 @@
    1.38  comstart:
    1.39  	.word	0
    1.40  	
    1.41 -readsectorX:
    1.42 -	movb	$0, %cl
    1.43 +	.org	68
    1.44 +readsectorX:				// read isolinux boot sector
    1.45 +	movb	$0xA5, %cl		// patched by installer
    1.46  readsector1:
    1.47 +	andb	$0x83, %dl		// disk and floppy disk
    1.48  	movw	%cx, (%bx)
    1.49  	incw	%cx
    1.50  	movw	$0x201, %ax
    1.51 @@ -73,52 +74,52 @@
    1.52  	movw	$0x0100, %cx
    1.53  return:
    1.54  	ret
    1.55 +dxloop:
    1.56  start2:
    1.57 -dxloop:
    1.58 -	call	readsector1
    1.59 +	call	readsector1		// look for the boot device
    1.60  	repe
    1.61  	cmpsw
    1.62  	je	dxfound
    1.63 -next:
    1.64 -	xorw	%cx, %cx
    1.65 -	xchgw	%ax, %dx
    1.66 -	addb	$0x7D, %al		// try every hard disk
    1.67 -	andb	$0x83, %al		//   and floppy disk
    1.68 -	cmpb	$0x80, %al
    1.69 -	xchgw	%ax, %dx
    1.70 -	jnz	dxloop
    1.71 +	movb	$0, %cl			// ch = 0
    1.72 +	addb	$0x7D, %dl		// try every hard disk
    1.73 +	jno	dxloop
    1.74  dxfound:
    1.75 +	call	readsectorX		// read isolinux boot sector
    1.76  	movw	%dx, 10(%bp)
    1.77  	call	checkboot
    1.78 -	.ascii	"No isolinux mbr."
    1.79 +	.asciz	"No isolinux bs"
    1.80  
    1.81  	.org	0x0080
    1.82  ////////////////////////////// EXE/PE header //////////////////////////////////
    1.83  
    1.84  	.org	0x01A0
    1.85  checkboot:
    1.86 -	call	readsectorX
    1.87 -	lodsw
    1.88 +	cmpw	%cx, (%bx)
    1.89  	popw	%si
    1.90 -	shrw	$1, %ax
    1.91 -	jz	error			// read fail or not isohydrid
    1.92 +	jc	error			// read fail or no isohydrid boot sector
    1.93  	popw	%es
    1.94  	popa
    1.95 -	iret
    1.96 -
    1.97 -error:
    1.98 -	lodsb
    1.99 +putsret:
   1.100 +	ret
   1.101 +putstrlp:
   1.102  	movw	$7, %bx
   1.103  	movb	$0xE, %ah
   1.104  	int	$0x10
   1.105 -	cmp	$'.', %al
   1.106 -	jne	error
   1.107 +error:
   1.108 +	lodsb
   1.109 +	cmp	$1, %al
   1.110 +	jg	putstrlp
   1.111 +	jz	putsret
   1.112 +putstr:
   1.113 +	movb	$0x80, %ah
   1.114 +	xchgw	%ax, %si
   1.115 +	jnc	error
   1.116  halt:
   1.117  	hlt
   1.118  	jmp	halt
   1.119  	.org	0x01BE
   1.120  
   1.121 -	.org	0x7EE0
   1.122 +	.org	0x7F10
   1.123  ////////////////////////////// DOS EXE code ///////////////////////////////////
   1.124  
   1.125  exestart:
   1.126 @@ -137,10 +138,6 @@
   1.127  	cmpb	$3, %al
   1.128  	movb	$EXESTR(noDOS3), %al
   1.129  	jb	abort
   1.130 -#if 1
   1.131 -	cmpw	(%si), %dx	// checksum not set
   1.132 -	je	chked
   1.133 -#endif
   1.134  	movw	$(EXELOC(0x8000))/2, %cx
   1.135  chklp:
   1.136  	lodsw
   1.137 @@ -151,17 +148,8 @@
   1.138  	je	tst386		// dx == 0 ?
   1.139  abort:
   1.140  puts:
   1.141 -	movb	$0x80, %ah
   1.142 -	xchgw	%ax, %si
   1.143 -putslp:
   1.144 -	lodsb
   1.145 -	orb	%al, %al
   1.146 -	jz	moveret
   1.147 -	js	puts
   1.148 -	movw	$7, %bx
   1.149 -	movb	$0xE, %ah
   1.150 -	int	$0x10
   1.151 -	jmp	putslp
   1.152 +	clc
   1.153 +	jmp	putstr
   1.154  
   1.155  tst386:
   1.156  	pushfw			// save flags
   1.157 @@ -200,13 +188,12 @@
   1.158  	movb	$0x7C/2, %ch	// 31K-31.5K, > com length
   1.159  	rep
   1.160  	movsw
   1.161 -moveret:
   1.162  	ret
   1.163  
   1.164  VersionVCPI:
   1.165  	cmpb	$0x40, %dl		// >= 4.0 ?
   1.166  	jb	NoVCPI
   1.167 -	movb	$EXESTR(vm86modemsg), %al
   1.168 +	xchgw	%ax, %si		// movb	$EXESTR(vm86modemsg), %al
   1.169  	jmp	realmode
   1.170  tstvcpi:
   1.171  	pushw	%ds
   1.172 @@ -238,48 +225,42 @@
   1.173  	.byte	0x46			// version
   1.174  	.byte	0
   1.175  
   1.176 +vm86modemsg:
   1.177  // --------------- Must be in 7F40 7FFF range ------------------------
   1.178 -//noloader:
   1.179 -//	.ascii	"No isol"		// No isolinux boot loader
   1.180 -//	.byte	EXESTR(iloader)
   1.181 -no386:
   1.182 -	.ascii	"No 386"		// No 386+
   1.183 -	.byte	EXESTR(plus)
   1.184 +	.ascii	"vm"			// vm86
   1.185 +	.byte	EXESTR(_86)
   1.186  ERRvcpi:
   1.187 -	.ascii	"No EMM386/VCPI 4"	// No EMM386/VCPI 4.0+
   1.188 -	.byte	EXESTR(dot0)
   1.189 +	.ascii	"No VCPI-4.0/EMM"	// No VCPI-4.0/EMM386
   1.190 +	.byte	EXESTR(_386)
   1.191 +noDOS3:
   1.192 +	.ascii	"No DOS 3"		// No DOS 3
   1.193 +	.byte	EXESTR(eol)
   1.194  chkerr:
   1.195 -	.ascii	"Broken ISO9660 fil"	// Broken ISO9660 file.
   1.196 -	.byte	EXESTR(eeol)
   1.197 -vm86modemsg:
   1.198 -	.ascii	"vm86"			// vm86 mode.
   1.199 -	.byte	EXESTR(mode)
   1.200 +	.ascii	"Broken c"		// Broken code
   1.201 +	.byte	EXESTR(ode)
   1.202  rmPaging:
   1.203 -	.ascii	"Invalid: paging + "	// Invalid: paging + real mode.
   1.204 +	.ascii	"Un"			// Unreal mode
   1.205  realmodemsg:
   1.206 -	.ascii	"real"			// real mode.
   1.207 +	.ascii	"real m"		// real mode
   1.208  // --------------- Must be in 7FC0 7FFF range ------------------------
   1.209 -mode:
   1.210 -	.ascii	" mod"
   1.211 +ode:
   1.212 +	.ascii	"od"
   1.213  eeol:
   1.214  	.ascii  "e"
   1.215  	.byte	EXESTR(eol)
   1.216 -noDOS3:
   1.217 -	.ascii	"No DOS 3"		// No DOS 3.0+
   1.218 -dot0:
   1.219 -	.ascii	".0"
   1.220 -plus:
   1.221 -	.ascii	"+"
   1.222 -	.byte	EXESTR(eol2)
   1.223 +no386:
   1.224 +	.ascii	"No "			// No 386
   1.225 +_386:
   1.226 +	.ascii	"3"
   1.227 +_86:
   1.228 +	.ascii	"86"
   1.229 +	.byte	EXESTR(eol)
   1.230  help:
   1.231 -	.ascii	"SliTaz GNU/L"		// SliTaz GNU/Linux boot loader
   1.232 -iloader:
   1.233 -	.ascii	"inux boot loader"
   1.234 +	.ascii	"SliTaz boot loader"	// SliTaz boot loader
   1.235  eol:
   1.236 -	.ascii	"."
   1.237 -eol2:
   1.238 -	.asciz	"\r\n"
   1.239 +	.ascii	"\r\n"
   1.240 +	.byte	1
   1.241  
   1.242 +	.space	16,0			// ISO md5
   1.243  	.org	0x8000
   1.244  ////////////////////////// ISO9660 header /////////////////////////////////////
   1.245 -