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

syslinux/iso2exe: add win32 stub
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 05 23:32:17 2013 +0100 (2013-02-05)
parents 3d4df3952952
children e487d594117f
line diff
     1.1 --- a/syslinux/stuff/iso2exe/bootiso.S	Sat Dec 22 16:41:33 2012 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/bootiso.S	Tue Feb 05 23:32:17 2013 +0100
     1.3 @@ -3,14 +3,14 @@
     1.4  	.org	0
     1.5  
     1.6  CODESZ	=	0x8000			// 16 sectors = 32Kb
     1.7 -#define EXEADRS(x)	x+0xE0
     1.8 -#define EXESTR(x)	x-0x20
     1.9 +#define EXEADRS(x)	x+0xC0
    1.10 +#define EXESTR(x)	x-0x40
    1.11  
    1.12  	.globl	_start
    1.13  _start:
    1.14  	decw	%bp			// Magic number: MZ
    1.15  	popw	%dx
    1.16 -	jmp	start			// Bytes on last page of file
    1.17 +	jmp	start0			// Bytes on last page of file
    1.18  	.word	(CODESZ+511)/512	// Pages in file
    1.19  	.word	0			// Relocations
    1.20  	.word	(end_header-_start)/16	// Size of header in paragraphs
    1.21 @@ -21,24 +21,16 @@
    1.22  	.word	0			// Checksum
    1.23  	.word	EXEADRS(exestart)	// Initial IP value
    1.24  	.word	0xFFF0			// Initial (relative) CS value
    1.25 -	.word	0x001C			// File address of relocation table
    1.26 +initramfssize:
    1.27 +	.word	0			// File address of relocation table
    1.28 +id:
    1.29  	.word	0			// Overlay number
    1.30 -initramfssize:
    1.31 -	.word	0
    1.32 -id:
    1.33 -	.word	0
    1.34 -end_header:
    1.35 -
    1.36 -chksum:
    1.37 -	.word	0
    1.38 -comstart:
    1.39 -	.word	0
    1.40  
    1.41  /////////////////////// Master Boot Record code //////////////////////////////
    1.42  
    1.43 -start:
    1.44 -	incw	%bp
    1.45 +start0:					// File address of relocation table
    1.46  	pushw	%dx			// restore SP
    1.47 +	incw	%bp			// restore %bp
    1.48  	pushw	$0
    1.49  	popw	%ds
    1.50  	movw	$0x7C00, %bx
    1.51 @@ -48,10 +40,22 @@
    1.52  	pushaw
    1.53  	movw	%sp, %bp
    1.54  	pushw	%es
    1.55 +	cld
    1.56 +	pushw	%ds
    1.57 +	popw	%es
    1.58  	call	setreg
    1.59  	rep
    1.60  	movsw
    1.61 +	movw	$0x80, %dx
    1.62  	ljmp	$0, $0x0600+start2
    1.63 +
    1.64 +	.org	60
    1.65 +	.long	0			// PE header offset
    1.66 +end_header:
    1.67 +chksum:
    1.68 +	.word	0
    1.69 +comstart:
    1.70 +	.word	0
    1.71  	
    1.72  readsector2:
    1.73  	incw	%cx
    1.74 @@ -61,16 +65,12 @@
    1.75  	movw	$0x201, %ax
    1.76  	int	$0x13
    1.77  setreg:
    1.78 -	cld
    1.79 -	pushw	%ds
    1.80 -	popw	%es
    1.81  	movw	%bx, %si
    1.82  	movw	$0x0600, %di
    1.83  	movw	$0x0100, %cx
    1.84  return:
    1.85  	ret
    1.86  start2:
    1.87 -	movw	$0x80, %dx
    1.88  dxloop:
    1.89  	call	readsector1
    1.90  	repe
    1.91 @@ -122,7 +122,7 @@
    1.92  	.ascii	"Invalid: paging + "	// Invalid: paging + real mode.
    1.93  realmodemsg:
    1.94  	.ascii	"real"			// real mode.
    1.95 -// --------------- Must be in 00A0 011F range ------------------------
    1.96 +// --------------- Must be in 00C0 013F range ------------------------
    1.97  mode:
    1.98  	.ascii	" mod"
    1.99  eeol: