*BSD News Article 29656


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!bunyip.cc.uq.oz.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!news.intercon.com!panix!not-for-mail
From: wpaul@panix.com (Bill "This is a close-up?!" Paul)
Newsgroups: comp.os.386bsd.questions
Subject: 387sx/16 FPU -- anyone else have problems with this?
Date: 17 Apr 1994 00:14:14 -0400
Organization: The M00se Illuminati (bl00p!)
Lines: 78
Message-ID: <2oqd2m$nig@panix2.panix.com>
NNTP-Posting-Host: panix2.panix.com
X-Newsreader: TIN [version 1.2 PL2]

Greetings: 

I currently have FreeBSD 1.1-BETA installed and running on a 386sx 16Mhz
machine with an Intel 387sx math co-processor chip. This system has 4 megs
or RAM and a Maxtor 7345AT IDE disk drive. I was able to run Linux on
this system with no problems, but I ran into a serious snag when I tried to
install FreeBSD (the problem cropped up with NetBSD 0.9 as well).
(Note also that I have no SCSI hardware, no ethernet hardware, an ET4000
graphics board, 4 serial ports (COM1-COM4, irqs 4,3,5,9), and one printer
port (lpt0, 0x378, irq 7).)

In a nutshell, neither FreeBSD nor NetBSD would run on my machine with
the math chip installed. Both kernels would load correctly, but each would
hang immediately after the math chip was detected. I would see then
message:

npx0 at 0xf0-0xff irq 13 on motherboard

Then, nothing. Nada. Complete lockup. I had to remove the chip from
the machine in order to install FreeBSD. Once I had it running, I built
a kernel with math emulation and *no* npx support, which allowed me to
boot FreeBSD with the chip still installed. (Even if FreeBSD couldn't
use it, I still needed it for other things, like Linux.)

After a little poking around in /sys/i386/isa/npx.c, I found that the
system was freezing during npxinit() -- it would call npxsave() and then
go off into hyperspace. I tried having npxattach() call npxinit()
with different control words, plus a few other stabs in the dark, with
no success.

Finally, I decided to have a look at the Linux kernel code to see what
it did that made the math chip behave. After some trial and error, I
came up with the following modification:

At line 331 of npx.c (in the function npxattach(), immediately before the
call to npxinit() ), I added the following two lines of code:

        if (npx_exists && npx_irq13)
                __asm("fninit ; fwait");

The test assumes that the problem is unique to my specific situation,
namely that the math chip is using irq 13 error reporting. After I did
this, I was finally able to bring FreeBSD up with the math chip installed.
I am not entirely certain that this is the correct solution to the problem,
however, as I was able to hang the system with the 'paranoia' program,
somewhere around milestone 130 (while checking for overflow exceptions,
I believe). I don't know exactly what's responsible for that, though. The
system didn't die completely: I was still able to shift virtual consoles
using pcvt (which also requires hacking in order to work with 1.1-BETA,
I might add), so keyboard interrupts were still being handled, but nothing
outside of the console driver seemed to work.

Anyway, my question is: has enyone else encountered similar problems when
attempting to use FreeBSD/NetBSD with a 386sx/16 and a 387sx FPU? And, even
better, does anyone have any better solutions? Does anyone know if
FreeBSD 1.1-RELEASE will contain any fixes to npx.c? I plan to beat up on
the system for a while to see if anything (besides paranoia) can kill it in
the meantime (I still have a copy of the 'math emulatiom without npx'
kernel handy just in case), but I'm pretty sure something else needs to
be taken care of before I can really call the system stable. 

Oh, I put together a boot floppy of NetBSD-current about two weeks ago
(thinking maybe the NetBSD people had hacked the npx code differently)
and it exhibited the same problem. This glitch kept me from installing
FreeBSD for many months until I finally decided that it was worth using
even without the FPU.

Feel free to reply via the net or email (my mailbox is always open).

-Bill, who is starting to wonder which is goofier: him, or his hardware.

--
 _      /\      _            Join the
/ \_/\_/  \_/\_/ \  .----.   M00se Illuminati   Bill Paul 
\_____/ () \_____/ (bl00p!)  Face it: wouldn't  <Big City M00se>
     /      \       `----'   you feel much      wpaul@panix.com   -or-
    /  \__/  \    --'        safer?             ghod@drycas.club.cc.cmu.edu
   /__________\