wok-next rev 18151

syslinux/taziso/floppyset: add ifmem
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 19 21:57:20 2015 +0200 (2015-06-19)
parents d2af45554821
children a2f7f8eaeaa3
files syslinux/stuff/iso2exe/Makefile syslinux/stuff/iso2exe/bootloader.S syslinux/stuff/iso2exe/ifmem.S syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- a/syslinux/stuff/iso2exe/Makefile	Fri Jun 19 19:56:46 2015 +0200
     1.2 +++ b/syslinux/stuff/iso2exe/Makefile	Fri Jun 19 21:57:20 2015 +0200
     1.3 @@ -4,7 +4,7 @@
     1.4  
     1.5  all: isohybrid.exe iso2exe meminfo.exe tazboot.exe taziso.built
     1.6  
     1.7 -taziso.built: bootloader.bin
     1.8 +taziso.built: bootloader.bin ifmem.bin
     1.9  	./taziso --build
    1.10  	touch taziso.built
    1.11  
    1.12 @@ -61,7 +61,7 @@
    1.13  	$(BCC) $(BCCFLAGS) -A-l -A$*.lst -c -o $@ $<
    1.14  
    1.15  %.bin: %.S
    1.16 -	$(GCC) -D__ASSEMBLY__ -Wa,-acghlnm=$*.lst -c -o $*.o $<
    1.17 +	$(GCC) -D__ASSEMBLY__ -DMULTI_INITRD -Wa,-acghlnm=$*.lst -c -o $*.o $<
    1.18  	objcopy -O binary $*.o $@
    1.19  	chmod +x $@
    1.20  
     2.1 --- a/syslinux/stuff/iso2exe/bootloader.S	Fri Jun 19 19:56:46 2015 +0200
     2.2 +++ b/syslinux/stuff/iso2exe/bootloader.S	Fri Jun 19 21:57:20 2015 +0200
     2.3 @@ -19,7 +19,6 @@
     2.4  /* some extra features */
     2.5  #define CMDLINE			kernel >= 2.4
     2.6  #define OLDCMDLINE		kernel  < 2.4
     2.7 -#define HELP			display version for ? argument
     2.8  #define MORETHAN16M		up to 4Gb RAM, not 16Mb
     2.9  #define KEYBOARDLESS_SUPPORT	scan floppy swap each 5 seconds
    2.10  
    2.11 @@ -28,7 +27,10 @@
    2.12  #define MOVE_CMDLINE
    2.13  #define INITRD_SUPPORT
    2.14  #define INITRD_AUTOADDR
    2.15 -#define MULTI_INITRD		many in one support
    2.16 +#ifndef MULTI_INITRD
    2.17 +#define README_SUPPORT
    2.18 +#define COUNTER
    2.19 +#endif
    2.20  
    2.21  	.code16
    2.22  	.org	0
    2.23 @@ -118,6 +120,18 @@
    2.24  	popw	%ax			# limits = 0
    2.25  	incw	%cx			# cylinder 0, sector 1, clear Z
    2.26  	call	read_first_sectors	# read setup
    2.27 +#ifdef	README_SUPPORT
    2.28 +	xorw	%si, %si
    2.29 +	orw	readme, %si
    2.30 +	jz	readmeend
    2.31 +readmeloop:
    2.32 +	call	puts
    2.33 +	jz	readmeend
    2.34 +	call	wait4key
    2.35 +	cmpb	$27, %al
    2.36 +	jne	readmeloop
    2.37 +readmeend:
    2.38 +#endif
    2.39  loadsys:
    2.40  	movw	$0x200,%si
    2.41  type_of_loader	=	0x10
    2.42 @@ -348,6 +362,18 @@
    2.43  #define FLOPPY_CYLINDERS	80	
    2.44  #define FLOPPY_HEADS		2	
    2.45  
    2.46 +.macro	putsmsg
    2.47 +#ifdef COUNTER
    2.48 +	movw	$msgdigit+1-msg, %bx
    2.49 +nextdigit:
    2.50 +	decw	%bx
    2.51 +	incb	(%bx,%si)
    2.52 +	cmpb	$'9', (%bx,%si)
    2.53 +	ja	nextdigit
    2.54 +#endif
    2.55 +	call	puts
    2.56 +.endm
    2.57 +
    2.58  check_limits:
    2.59  	popw	%dx
    2.60          cmpb    %al, %cl		# max sector known ?
    2.61 @@ -407,7 +433,7 @@
    2.62  dpy_swap_floppy:
    2.63  #ifdef KEYBOARDLESS_SUPPORT
    2.64  	pushw	%bx
    2.65 -	call	puts
    2.66 +	putsmsg
    2.67  	popw	%bx
    2.68  	movw	%si, %bp
    2.69  waitfloppy:
    2.70 @@ -434,7 +460,7 @@
    2.71  	jne	waitfloppy
    2.72  waitfloppydone:
    2.73  #else
    2.74 -	call	puts
    2.75 +	putsmsg
    2.76  	cbw				# %ah = 0, get keyboard character
    2.77  	int	$0x16
    2.78  #endif
    2.79 @@ -495,7 +521,14 @@
    2.80  	.ascii	"B or "
    2.81  #endif
    2.82  swap_floppy:
    2.83 +#ifdef COUNTER
    2.84 +msg:
    2.85 +	.ascii	"Insert floppy disk 00"
    2.86 +msgdigit:
    2.87 +	.ascii	"1."
    2.88 +#else
    2.89  	.ascii	"Next!"
    2.90 +#endif
    2.91  	.byte	7,13,0			# swap detection needs 13, 0
    2.92  #ifdef MULTI_INITRD
    2.93  max_timeouts:
    2.94 @@ -506,4 +539,9 @@
    2.95  	.word	table
    2.96  	.byte	table+4-256
    2.97  #endif
    2.98 +#ifdef	README_SUPPORT
    2.99 +	.org	0x1EF
   2.100 +readme:
   2.101 +	.word	0
   2.102 +#endif
   2.103  	.org	0x1F1
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/syslinux/stuff/iso2exe/ifmem.S	Fri Jun 19 21:57:20 2015 +0200
     3.3 @@ -0,0 +1,55 @@
     3.4 +	.code16
     3.5 +	.org	0
     3.6 +type_of_loader	=	0x10
     3.7 +	
     3.8 +	orw	$0x8020, type_of_loader(%si) # loader type = 0x20 = bootsect-loader
     3.9 +	pushal
    3.10 +	
    3.11 +	movw	$10+16, %cx
    3.12 +fillbuf:
    3.13 +	pushw	$0
    3.14 +	loop	fillbuf
    3.15 +	popal			// clear regiters
    3.16 +maploop:
    3.17 +	movw	%sp, %di	// %es = %ss
    3.18 +	movb	$20, %cl
    3.19 +	movw	$0xE820, %ax
    3.20 +	movl	$0x534d4150, %edx
    3.21 +	int	$0x15
    3.22 +	sbbl	%eax, %edx
    3.23 +	jne	mapdone
    3.24 +	decw	16(%di)	
    3.25 +	jne	notram
    3.26 +	addw	8+2(%di), %bp
    3.27 +notram:
    3.28 +	orw	%bx, %bx
    3.29 +	jnz	maploop
    3.30 +mapdone:
    3.31 +	addw	$20, %sp
    3.32 +	shrw	$20-16,%bp
    3.33 +	jnz	mapdone2
    3.34 +	movb	$0x88, %ah
    3.35 +	int	$0x15
    3.36 +	xchgw	%ax, %bp
    3.37 +	shrw	$10, %bp
    3.38 +mapdone2:
    3.39 +	incw	%bp
    3.40 +// %bp : nb Mb	
    3.41 +	call	here
    3.42 +here:
    3.43 +	popw	%di
    3.44 +	movw	$0x1EE, %si
    3.45 +	lodsw
    3.46 +sizeloop:
    3.47 +	scasw			// %di += 2
    3.48 +	addw	$4, %ax
    3.49 +	cmpb	%al, (%si)	
    3.50 +	jbe	sizedone
    3.51 +	cmpw	%bp, sizes-here(%di)
    3.52 +	jbe	sizeloop
    3.53 +	movb	%al, (%si)
    3.54 +sizedone:
    3.55 +	popal
    3.56 +	lret			// need %si
    3.57 +sizes:
    3.58 +
     4.1 --- a/syslinux/stuff/iso2exe/taziso	Fri Jun 19 19:56:46 2015 +0200
     4.2 +++ b/syslinux/stuff/iso2exe/taziso	Fri Jun 19 21:57:20 2015 +0200
     4.3 @@ -1050,6 +1050,8 @@
     4.4  }
     4.5  
     4.6  if [ "$1" == "--build" ]; then	#install-begin
     4.7 +	uuencode -m - < ifmem.bin | sed -e '/^ifmemcode$/r/dev/stdin' \
     4.8 +	  -e '/^ifmemcode$/d' -i $0
     4.9  	uuencode -m - < bootloader.bin | sed -e '/^bootloader$/r/dev/stdin' \
    4.10  	  -e '/^bootloader$/d' -e '/install-begin$/,/install-end$/d' -i $0
    4.11  	exit
    4.12 @@ -1103,6 +1105,13 @@
    4.13  	echo "$1" | tr [A-Z] [a-z]
    4.14  }
    4.15  
    4.16 +ifmemcode()
    4.17 +{
    4.18 +	uudecode <<EOT
    4.19 +ifmemcode
    4.20 +EOT
    4.21 +}
    4.22 +
    4.23  floppyset()
    4.24  {
    4.25  	gotcdfile isolinux.cfg
    4.26 @@ -1161,6 +1170,12 @@
    4.27  		i=$(($pos + 0x1FC - ($n*4)))
    4.28  		bytes2bin $(($i % 256)) $((i / 256)) 252 | ddq bs=1 \
    4.29  			conv=notrunc seek=494 count=3 of=/tmp/fd$$
    4.30 +		s=$(($i - 2*$(echo "$SIZES" | wc -w)))
    4.31 +		p=$(($s - $(ifmemcode | wc -c)))
    4.32 +		ifmemcode | ddq bs=1 conv=notrunc seek=$p of=/tmp/fd$$
    4.33 +		words2bin $SIZES | ddq bs=1 conv=notrunc seek=$s of=/tmp/fd$$
    4.34 +		bytes2bin 154 $(($p%256)) $(($p/256)) 0 144 | \
    4.35 +		ddq bs=1 conv=notrunc seek=60 of=/tmp/fd$$
    4.36  	fi
    4.37  	for r in $len ; do
    4.38  		words2bin $(($r & 0xFFFF)) $(($r >> 16)) | ddq conv=notrunc \