wok diff linld/stuff/src/_BEG.ASM @ rev 19873

linld/tazboot: fix 286 case
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Mar 31 09:17:01 2017 +0200 (2017-03-31)
parents 7c4116e3377f
children 766a40e6c5e0
line diff
     1.1 --- a/linld/stuff/src/_BEG.ASM	Wed Mar 15 12:56:01 2017 +0100
     1.2 +++ b/linld/stuff/src/_BEG.ASM	Fri Mar 31 09:17:01 2017 +0200
     1.3 @@ -35,14 +35,31 @@
     1.4  ;***************************************************************
     1.5  
     1.6  ; Check for oldies
     1.7 +		ifndef	EXTRA
     1.8  		push	sp
     1.9  		pop	ax
    1.10 +		sub	ax,sp
    1.11 +		 ifndef	NO386
    1.12  		mov	bx,offset msg_badcpu
    1.13 -		sub	ax,sp
    1.14 -		ifndef	NO386
    1.15                  jnz	no_vcpi   	;it is a 86/186 not a 286+
    1.16 +		 else
    1.17 +                jnz	endcpu   	;it is a 86/186 not a 286+
    1.18 +		 endif
    1.19  		else
    1.20 -		jnz	endcpu
    1.21 +		pushf
    1.22 +		mov	bh, 0F0h
    1.23 +		push	bx		; < 286 : flags[12..15] are forced 1
    1.24 +		popf			; = 286 : flags[12..15] are forced 0
    1.25 +		pushf			; > 286 : only flags[15] is forced 0
    1.26 +		pop	dx
    1.27 +		popf
    1.28 +		add	dh,bh		; NS=386+, NC=286
    1.29 +		 ifndef	NO386
    1.30 +		mov	bx,offset msg_badcpu
    1.31 +                js	no_vcpi   	;it is a 386+
    1.32 +		 else
    1.33 +                js	endcpu   	;it is a 386+
    1.34 +		 endif
    1.35  		endif
    1.36                  p386
    1.37  		ifdef	EXTRA
    1.38 @@ -233,7 +250,9 @@
    1.39          segment _DATA byte public use16 'DATA'
    1.40          global  _data_start:byte
    1.41          label   _data_start byte
    1.42 +		ifndef	NO386
    1.43  msg_badcpu      db      "I need 386+ CPU in real mode or under VCPI manager"
    1.44 +		endif
    1.45          global  _vcpi:byte
    1.46  _vcpi		db	0
    1.47  msg_badmapping  db      "VCPI: low 640k: need 1:1 mapping",0