Re: Kernels 2.1 with 386DX/387 IRQ13 PC boxes

Gabriel Paubert (paubert@iram.es)
Thu, 30 Oct 1997 04:24:58 +0100 (MET)


On Wed, 29 Oct 1997, Richard B. Johnson wrote:

> On Wed, 29 Oct 1997, C. Scott Ananian wrote:
>
> > On Tue, 28 Oct 1997 root <root@mangue.ibm.net> wrote:
> >
> > > Now my question : How to test it? How to generate an IRQ13 interrupt?
>
> main() { double zero=0.0 ; double one=1.0; one /= zero; }
>
>

You first have to unmask FP exceptions. By default they are all masked,
and you will never get any interrupt, as you can check with the following
simple code:

main() {
unsigned short cw;
asm("fstcw %0": "=m" (cw):);
printf("Initial FPU CW:%x\n", cw);
}

gives:

Initial FPU CW: 37f

Gabriel.