[comp.sys.ibm.pc] Saving 287 state on 286, WAS Re: Replacing an 80386 with an 80486

harlow@plains.UUCP (Jay B. Harlow) (03/03/90)

In article <9729@portia.Stanford.EDU> dhinds@portia.Stanford.EDU (David Hinds) writes:
>In article <1304@watserv1.waterloo.edu>, alexew@watserv1.waterloo.edu (Alex E. Wielhouwer) writes:
>> 
>> Please correct me if I'm wrong, but in a multi-tasking environment, the 
>> floating point registers and stack need to be handled seperately on a
>> '386/'387 system during task swaps, or, in some cases the '387 is ignored.
>> (OS/2?). With a '486 environment, this should be much more efficient, i.e.,
>> faster.
>
>    During task switches, the 386 saves its own context, but does not
>automatically save the floating point processor's context.  It generates
>an interrupt at the first floating point operation following a task switch,
>so the system software can handle switching 387 contexts.  As this feature
>was not present in the 80286, OS/2 probably doesn't know about it.  OS/2
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^    WRONG WRONG WRONG!!!!!!!!!!!

David,
   Like i said above WRONG!!!!!!!!

the 286 has a register called the msw (machine status word) aka CR0
on a 386, (low 16 bits are the same!) on the 386 there is a extra bit
for the type of coprocessor attached (use 287 protocal or 387)
Now I know its the same I have been useing the EM trap (available on
EVEN the 186) which based on the msw bits (emulate or monitor forget
intel terms...) to switch the floating point state.

  SORRY i didn't mean to use documented features that are 'not present'

  ie, processor does task switch, automaticly set ts flag (in msw?), new task
does float inst, ts flag set INT 7!!!! int 7 goes emmm...  clts, this
is a new task, so save current state, load old state
same task does another float inst, la de da no task switch!!!!
and all this on a 286/287!!!!!

I would think the OS/2 (half a os?) problem is it doesn't use
the BUILT in task switching, and so does not use the TS (task switch) flag
to track task switches...  i remember reading someplace useing the
built in task switching can be more expensive time wise then
doing a manual task switch (aka mov saveregs,regs, mov regs,newregs)

well enough 'flaming' ;-)

			Jay
-- 
		Jay B. Harlow	<harlow@plains.nodak.edu>
	uunet!plains!harlow (UUCP)	harlow@plains (Bitnet)

Of course the above is personal opinion, And has no bearing on reality...