[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pc386 on 386sx
- Date: Thu, 29 Jul 1999 09:04:41 -0700
- From: erik.ivanenko at utoronto.ca (erik.ivanenko)
- Subject: pc386 on 386sx
VALETTE Eric wrote:
> >>>>> "erik" == erik ivanenko <erik.ivanenko at utoronto.ca> writes:
> erik> Note that the test in cpuModel.S did not have to be commented out!
> I did wrote this one inspired from linux code... My feeling is that
> if cpuModel.S finds the right type of processor, then as the resultis stored in
> global variable, then theses variables could be used.
> An explanation (I have no ix86sx book so I can't check) is that
> the FP coproc may need to be resetted to enable to redo the fninit...
I do have such a book, but it does not explain fninit. It DOES explain how the
EM bit works.
>From the i386sx programmers reference:
" The EM bit determines whether coprocessor functions are to be emulated. If the
EM bit is set when an ESC instruction is executed, the coprocessor-not-available
exception is generated. The exception handler then can emulate the coprocessor
Also from the i386sx programmers reference:
"This exception occurs in either of two conditions:
o The processor executes an ESC instruction while the EM bit is set. In this
case, the exception handler should emulate the instruction which caused the
exception. The TS bit may also be set.
o The processor executes either the WAIT instruction or an ESC instruction when
both the MP and TS bits are set. In this case, the exception handler should
update the state of the coprocessor, if necessary."
Clearly, by setting the EM bit, cpuModel.S assumes that the FP unit is emulated
in software -- just like Linux does it.
> erik> Why should this instruction fail in CPU_Initialize for these cpu's? It
> erik> is fine for the i386ex. In all cases, the RTEMS_CPU_MODEL is i386_nofp.
> At least you could use this to surround the code by ifdef...
> -- eric
The difference between the i386ex and pc386 is that the EM bit never gets set by
the i386ex code.So, the "co-processor not available" exception is not raised on
the fninit in CPU_Initialize.
If the Linux style of initialization will be used, then the EM bit could be
tested in CPU_Initialize.
But setting the EM bit may not be the best approach.....
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 291 bytes
Desc: Card for Erik Ivanenko
Url : http://rtems.rtems.org/pipermail/rtems-users/attachments/19990729/65905ec1/attachment.vcf