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

syslinux/iso2exe: full zImage support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Sep 17 11:38:34 2014 +0200 (2014-09-17)
parents ada914860f33
children aa3f469a31d7
line diff
     1.1 --- a/syslinux/stuff/iso2exe/bootiso.S	Tue Apr 02 08:37:23 2013 +0200
     1.2 +++ b/syslinux/stuff/iso2exe/bootiso.S	Wed Sep 17 11:38:34 2014 +0200
     1.3 @@ -127,36 +127,28 @@
     1.4  exestart:
     1.5  	cld
     1.6  	movw	$0x100, %si
     1.7 -	movw	-127(%si), %ax
     1.8 +	movw	-126(%si), %ax
     1.9  	cwd				// clear dx
    1.10  	pushw	%dx			// dos exit
    1.11 -	cmpw	$0x2F20, %ax
    1.12 -	movw	$0x1000+EXESTR(help), %ax
    1.13 -	je	abort
    1.14 -	pushfw			// save flags
    1.15 -		// bits  15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
    1.16 -		// flags  0 NT  IOPL OF DF IF TF SF ZF  0 AF  0 PF  1 CF
    1.17 -	// movb	$0x10, %ah
    1.18 -	pushw	%ax
    1.19 -	popfw			// < 286 : flags[12..15] are forced 1
    1.20 -	pushfw			// = 286 : flags[12..15] are forced 0
    1.21 -	popw	%cx		// > 286 : only flags[15] is forced 0
    1.22 -	popfw			// restore flags
    1.23 -	addb	%ah, %ch	// test F0 and 00 cases
    1.24 -	cmpb	%ah, %ch
    1.25 -	movb	$EXESTR(no386), %al
    1.26 -	jbe	abort		// C=8086/80186, Z=80286
    1.27 +	cmpb	$0x2F, %al
    1.28 +	movw	$0x3000+EXESTR(help), %ax
    1.29 +	jbe	abort
    1.30 +	int	$0x21
    1.31 +	cmpb	$3, %al
    1.32 +	movb	$EXESTR(noDOS3), %al
    1.33 +	jb	abort
    1.34  #if 1
    1.35 -	movw	(%si), %cx
    1.36 -	jcxz	is386
    1.37 +	cmpw	(%si), %dx	// checksum not set
    1.38 +	je	chked
    1.39  #endif
    1.40  	movw	$(EXELOC(0x8000))/2, %cx
    1.41  chklp:
    1.42  	lodsw
    1.43  	addw	%ax, %dx
    1.44  	loop	chklp
    1.45 -	movb	$EXESTR(chkerr), %al
    1.46 -	je	is386		// dx == 0 ?
    1.47 +chked:
    1.48 +	movw	$0x1000+EXESTR(chkerr), %ax
    1.49 +	je	tst386		// dx == 0 ?
    1.50  abort:
    1.51  puts:
    1.52  	movb	$0x80, %ah
    1.53 @@ -171,21 +163,37 @@
    1.54  	int	$0x10
    1.55  	jmp	putslp
    1.56  
    1.57 +tst386:
    1.58 +	pushfw			// save flags
    1.59 +		// bits  15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
    1.60 +		// flags  0 NT  IOPL OF DF IF TF SF ZF  0 AF  0 PF  1 CF
    1.61 +	// movb	$0x10, %ah
    1.62 +	pushw	%ax
    1.63 +	popfw			// < 286 : flags[12..15] are forced 1
    1.64 +	pushfw			// = 286 : flags[12..15] are forced 0
    1.65 +	popw	%bx		// > 286 : only flags[15] is forced 0
    1.66 +	popfw			// restore flags
    1.67 +	addb	%ah, %bh	// test F0 and 00 cases
    1.68 +	cmpb	%ah, %bh
    1.69 +	movb	$EXESTR(no386), %al
    1.70 +#undef NEED386
    1.71 +#ifdef NEED386
    1.72 +	jbe	abort		// C=8086/80186, Z=80286
    1.73 +#else
    1.74 +	jbe	is86		// C=8086/80186, Z=80286
    1.75 +#endif
    1.76  is386:
    1.77 -	movl	%cr0, %eax
    1.78 +	smsww	%ax		// not privileged
    1.79  	andb	$1, %al
    1.80  	jne	tstvcpi
    1.81 +	movl	%cr0, %eax	// privileged
    1.82  	incl	%eax
    1.83  	movb	$EXESTR(rmPaging), %al
    1.84  	js	abort
    1.85  	movb	$EXESTR(realmodemsg), %al
    1.86  realmode:
    1.87 +is86:
    1.88  	call	puts
    1.89 -	movb	$0x30, %ah
    1.90 -	int	$0x21
    1.91 -	cmpb	$3, %al
    1.92 -	movb	$EXESTR(noDOS3), %al
    1.93 -	jb	abort
    1.94  	movw	$0x0100, %di
    1.95  	movw	comstart-end_header(%di), %si		// .com address
    1.96  	pushw	%di
    1.97 @@ -202,7 +210,7 @@
    1.98  	jmp	realmode
    1.99  tstvcpi:
   1.100  	pushw	%ds
   1.101 -	movw	%cx, %ds		// %cx = 0
   1.102 +	movw	%dx, %ds		// %dx = 0
   1.103  	movw	0x67*4+2, %ds
   1.104  	movw	$10, %si
   1.105  	lodsl
   1.106 @@ -241,7 +249,7 @@
   1.107  	.ascii	"No EMM386/VCPI 4"	// No EMM386/VCPI 4.0+
   1.108  	.byte	EXESTR(dot0)
   1.109  chkerr:
   1.110 -	.ascii	"Broken ISO image fil"	// Broken ISO image file.
   1.111 +	.ascii	"Broken ISO9660 fil"	// Broken ISO9660 file.
   1.112  	.byte	EXESTR(eeol)
   1.113  vm86modemsg:
   1.114  	.ascii	"vm86"			// vm86 mode.