wok-tiny rev 130

linux/bundle: bootloader may want to pull 0
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 18 16:43:36 2017 +0200 (2017-08-18)
parents 6c0be0a0a932
children 12b4e8340345
files linux/stuff/bundle.S
line diff
     1.1 --- a/linux/stuff/bundle.S	Thu Aug 17 18:51:03 2017 +0200
     1.2 +++ b/linux/stuff/bundle.S	Fri Aug 18 16:43:36 2017 +0200
     1.3 @@ -14,6 +14,7 @@
     1.4  
     1.5  	// patch disk parameter table
     1.6  	xorw	%cx, %cx
     1.7 +	pushw	%cx			// bootloader may want to pull 0
     1.8  	movw	$0x78, %bx
     1.9  	movw	%cx, %ds
    1.10  	ldsw	(%bx), %si	
    1.11 @@ -26,7 +27,7 @@
    1.12  	movb	$63, %es:4-12(%di)
    1.13  	movw	%cx, %ds
    1.14  	popw	(%bx)
    1.15 -	movw	%es, 2(%bx)	
    1.16 +	movw	%es, 2(%bx)
    1.17  
    1.18  	// data segments setup
    1.19  	movw	$0x7C0, %ax
    1.20 @@ -79,7 +80,7 @@
    1.21  wait:
    1.22  wait4key:
    1.23  	pushw	%ds
    1.24 -	movw	$0, %ax
    1.25 +	xorw	%ax, %ax
    1.26  	movw	%ax, %ds
    1.27  	movw	$clock, %si
    1.28  #define DELAY 5
    1.29 @@ -144,10 +145,9 @@
    1.30  	jc	menustart
    1.31  
    1.32  	// scan boot code
    1.33 -	movw	%bx, %di
    1.34 +	movw	%bx, %di		// =0x200
    1.35  scanboot:
    1.36  	incw	%di
    1.37 -	cmpw	%bx, %di
    1.38  	je	found
    1.39  	cmpw	$0x5897, -3(%di)	// xchgw %ax, %di; popw	%ax
    1.40  	jne	scanboot
    1.41 @@ -156,6 +156,7 @@
    1.42  found:
    1.43  	pushw	%ds
    1.44  	pushw	%di
    1.45 +	cli
    1.46  	movb	0x1F1(%bx), %al		// setup size
    1.47  	pushw	%ss
    1.48  	popw	%ds
    1.49 @@ -224,10 +225,13 @@
    1.50  
    1.51  getsectors:
    1.52  	tochs		// %di -> %cx, %dx & %bp=sector max
    1.53 -return:
    1.54  	ret
    1.55  #endif
    1.56  
    1.57 +puts:
    1.58 +	lodsb
    1.59 +	orb	%al, %al
    1.60 +	jnz	putcs
    1.61  putcr:
    1.62  	movb	$10, %al
    1.63  putlf:
    1.64 @@ -238,16 +242,8 @@
    1.65  	int	$0x10
    1.66  	cmpb	$13, %al
    1.67  	jz	putlf
    1.68 -	jc	return
    1.69 -puts:
    1.70 -	lodsb
    1.71 -	orb	%al, %al
    1.72 -	jnz	putcs
    1.73 -	jmp	putcr
    1.74 -#ifndef CHECK_FILES
    1.75 -return:
    1.76 +	jnc	puts
    1.77  	ret
    1.78 -#endif
    1.79  
    1.80  #ifdef CHECK_FILES
    1.81  msgok: