wok-6.x rev 19401

memtest: DOS shutdown (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 03 13:03:50 2016 +0200 (2016-09-03)
parents 03eb90ac5d1f
children 67179a0300fd
files memtest/stuff/bootloader.S memtest/stuff/pack
line diff
     1.1 --- a/memtest/stuff/bootloader.S	Sat Sep 03 11:26:12 2016 +0200
     1.2 +++ b/memtest/stuff/bootloader.S	Sat Sep 03 13:03:50 2016 +0200
     1.3 @@ -44,7 +44,7 @@
     1.4  comstart:
     1.5  	cld				# assume nothing
     1.6  #ifdef CMDLINE
     1.7 -	movw	%sp, %di
     1.8 +	movw	$stacktop, %di		# cmdline offset at 0x22
     1.9  #else
    1.10  #undef HELP
    1.11  #endif
    1.12 @@ -82,8 +82,6 @@
    1.13  #ifdef CHECK_REALMODE
    1.14  #define PUTS
    1.15  	movw	$EXEADRS(realmode_expected), %si
    1.16 -	//movw	syssize-realmode_expected(%si), %bp
    1.17 -	.byte	0x8B, 0x6C, syssize-realmode_expected
    1.18  	//movb	setup_sects-realmode_expected(%si), %ch
    1.19  	.byte	0x8A, 0x6C, setup_sects-realmode_expected
    1.20  		// bits  15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
    1.21 @@ -93,20 +91,21 @@
    1.22  	popfw			// < 286 : flags[12..15] are forced 1
    1.23  	pushfw			// = 286 : flags[12..15] are forced 0
    1.24  	popw	%dx		// > 286 : only flags[15] is forced 0
    1.25 -	cmpb	%ah, %dh	// test Fx and 0x cases
    1.26 +	cmpb	%ah, %dh	// test Fx and 0x cases: S= < 386, C= < 286
    1.27  jsputs:
    1.28  	js	puts		// S= not 386+
    1.29  	smsww	%dx
    1.30  	shrw	$1, %dx
    1.31 -	jc	puts
    1.32 +	jc	puts		// protected mode: vm86
    1.33  #else
    1.34 -	movw	EXEADRS(syssize), %bp
    1.35  	movb	EXEADRS(setup_sects), %ch
    1.36  #endif
    1.37  	movw	$0x100, %si
    1.38  	rep
    1.39  	  movsw
    1.40  	movw	%ds, %bx
    1.41 +	pushw	%es
    1.42 +	popw	%ss
    1.43  #ifndef SHUTDOWNDOS
    1.44  	ljmp	$INITSEG, $movesys
    1.45  #else
    1.46 @@ -239,13 +238,15 @@
    1.47  	xorw	%si, %si
    1.48  	mov	%si, %ds
    1.49  	popl	4*0x19(%si)
    1.50 +loadsp19:
    1.51 +	pushw	%cs
    1.52 +	popw	%ss
    1.53  	movw	$stacktop-4-16, %sp
    1.54  	popl	4(%si)
    1.55  	popaw
    1.56  #endif
    1.57  movesys:				// %ax = SYSSEG
    1.58 -	pushw	%cs
    1.59 -	popw	%ss
    1.60 +	movw	%cs:syssize, %bp
    1.61  	shrw	$4, %si
    1.62  	addw	%si, %bx
    1.63  	subw	%ax, %bx
     2.1 --- a/memtest/stuff/pack	Sat Sep 03 11:26:12 2016 +0200
     2.2 +++ b/memtest/stuff/pack	Sat Sep 03 13:03:50 2016 +0200
     2.3 @@ -56,7 +56,6 @@
     2.4  
     2.5  HELP="$(unix2dos <<EOT
     2.6  Memtest86+ VERSION is an endless advanced memory diagnostic tool (GPL).
     2.7 -
     2.8  EOT
     2.9  )"
    2.10  main $1 ${2:-$1.packed} "${3:-$HELP}" 2>/dev/null <<EOT