wok diff syslinux/stuff/iso2exe/bootlinux.c @ rev 17473

syslinux/iso2exe: add 64bits support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 27 17:56:57 2014 +0100 (2014-12-27)
parents 188b82599301
children 054f70cb9bec
line diff
     1.1 --- a/syslinux/stuff/iso2exe/bootlinux.c	Thu Dec 18 20:41:03 2014 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/bootlinux.c	Sat Dec 27 17:56:57 2014 +0100
     1.3 @@ -1,6 +1,9 @@
     1.4  #include <stdio.h>
     1.5  #include "libdos.h"
     1.6  #include "iso9660.h"
     1.7 +#asm
     1.8 +		use16	86
     1.9 +#endasm
    1.10  
    1.11  #define ELKSSIG		0x1E6
    1.12  #define SETUPSECTORS	0x1F1
    1.13 @@ -47,8 +50,10 @@
    1.14  		mov	ax, _iselks
    1.15  		dec	ax
    1.16  		je	fakerealmode	// elks may run on a 8086
    1.17 +		use16	286
    1.18  		smsw	ax		// 286+
    1.19  		and	ax, #1		// 0:realmode	1:vm86
    1.20 +		use16	86
    1.21  fakerealmode:
    1.22  #endasm
    1.23  } 
    1.24 @@ -95,20 +100,23 @@
    1.25  		  movw
    1.26  		jmp	movedone
    1.27  movehiz:				// 30
    1.28 +		use16	286		// more than 1Mb => 286+
    1.29  		mov	cx, #9		// 2E..1E
    1.30  zero1:
    1.31  		push	ax
    1.32  		loop	zero1
    1.33 -		push	dword [si]	// 1A mem.base
    1.34 +		push	word [si+2]
    1.35 +		push	word [si]	// 1A mem.base
    1.36  		push	#-1		// 18
    1.37  		push	ax		// 16
    1.38 -		cwde
    1.39 -		cdq
    1.40 -		mov	dx, ds
    1.41 -		shl	edx, #4
    1.42 -		mov	ax, #_buffer
    1.43 -		add	edx, eax
    1.44 -		push	edx		// 12 linear_address(buffer)
    1.45 +		mov	ax, ds
    1.46 +		mov	dx, ax
    1.47 +		shl	ax, #4
    1.48 +		shr	dx, #12
    1.49 +		add	ax, #_buffer
    1.50 +		adc	dx, #0
    1.51 +		push	dx
    1.52 +		push	ax
    1.53  		push	#-1		// 10
    1.54  		mov	cl, #8		// 0E..00
    1.55  zero2:
    1.56 @@ -124,6 +132,7 @@
    1.57  		xchg	[si+0x1F], al	// bits 24..31
    1.58  		int	0x15
    1.59  		add	sp, #0x30
    1.60 +		use16	86
    1.61  movedone:
    1.62  		pop	di
    1.63  		pop	si
    1.64 @@ -427,11 +436,13 @@
    1.65  mvdown:
    1.66  		mov	[si+0x12+2], bx	// srce
    1.67  		mov	[si+0x1A+2], cx	// dest
    1.68 -		pusha			// more than 1Mb => 286+
    1.69 +		use16	286		// more than 1Mb => 286+
    1.70 +		pusha
    1.71  		mov	cx, #0x8000
    1.72  		mov	ah, #0x87
    1.73  		int	0x15
    1.74  		popa
    1.75 +		use16	86
    1.76  		inc	bx
    1.77  		inc	cx
    1.78  		cmp	dl, bl