Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 1995 11:13:05 -0400 (EDT)
From:      A boy and his worm gear <wpaul@skynet.ctr.columbia.edu>
To:        jan@physik.TU-Berlin.DE (Jan Riedinger)
Cc:        bugs@freebsd.org, wpaul@skynet.ctr.columbia.edu (A boy and his worm gear)
Subject:   Re: my bug report (2.1-Snap)
Message-ID:  <199508091513.LAA26036@skynet.ctr.columbia.edu>
In-Reply-To: <199508090058.CAA17627@marie.physik.tu-berlin.de> from "Jan Riedinger" at Aug 9, 95 02:58:36 am

next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the world, Jan Riedinger had to walk
into mine and say:
 
> Hello!
> 
> I forgot something. Because the npx driver doesn't work for my board
> (the boot procedure hangs after probing npx), I have to disable npx.
> Maybe this causes the "undefined symbol '_hw_float'" error.

Bruce has already explained that disabling the npx driver doesn't
actually work. However, I have something I'd like you to try for me,
just for kicks, if it wouldn't be too much trouble.

My 80387 math chip gives me grief too. In fact, it's given me grief
as far back as FreeBSD 1.1. (It would have given me grief with
386BSD 0.1 too, except I didn't have a math chip then. :) Originally, I 
had to rip the math chip out of my machine just to get bootstrapped, and 
then later I came up with a workaround for the hangs. I must emphasize 
the term workaround: the hardware problem is still there and can still be 
triggered from userland with an appropriately written program. Here's a
small context diff for /sys/i386/isa/npx.c:

*** npx.c.orig	Wed Aug  9 10:49:32 1995
--- npx.c	Wed Aug  9 10:48:52 1995
***************
*** 68,74 ****
--- 68,78 ----
  #define	fnclex()		__asm("fnclex")
  #define	fninit()		__asm("fninit")
  #define	fnop()			__asm("fnop")
+ #ifdef SKYNET
+ #define	fnsave(addr)		__asm("fnsave %0; fninit" : "=m" (*(addr)))
+ #else
  #define	fnsave(addr)		__asm("fnsave %0" : "=m" (*(addr)))
+ #endif
  #define	fnstcw(addr)		__asm("fnstcw %0" : "=m" (*(addr)))
  #define	fnstsw(addr)		__asm("fnstsw %0" : "=m" (*(addr)))
  #define	fp_divide_by_0()	__asm("fldz; fld1; fdiv %st,%st(1); fnop")

(SKYNET is the name of the config file for my machine -- this is a
machine-specific hack after all. :) You can change it to something
else, otherwise use 'options SKYNET' in your config.)

I changed the fnsave() macro so that an fninit instruction is executed
immediately after the fnsave. fnsave is supposed to do an fninit after
it saves the FPU state anyway, so technically it shouldn't make any 
difference. But on my system (a 386sx/16), the FPU will only work
correctly if I add this hack. There's a good chance it won't help you
at all, but I'd be very interested to know if it does.

Note that this does not really fix the problem: it is still possible
for a user to write a program with an embedded __asm() directive that
executes an fnsave instruction without doing the fninit afterwards.
Such a program will still hang your system. Well, if you're having
the same problem that I am, that is.

-Bill

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~T~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Bill Paul            (212) 854-6020 | System Manager
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Møøse Illuminati: ignore it and be confused, or join it and be confusing!
~~~~~~ "Welcome to All Things BSDish! If it's not BSDish, it's crap!" ~~~~~~~



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508091513.LAA26036>