To: hackers@_ERASE_freebsd.org,current@_ERASE_freebsd.org
Subject: npx probe fails with FreeBSD-1.1.5 & 2 + AMD 486-DX2 + Gigabyte boards.

Warning of 2 problems I am aware of (1 software, 1 hardware):

	A) there is a hardware problem detectable with AMD 486-DX2 +
	   Gigabyte motherboards
	B) there is an npx probe problem (silently fails & hangs)

(A) concerns freebsd owners considering use of these hardware components,
	hence sent to `hackers'.
(B) concerns kernel programmers (who don't all subscribe to `hackers' 
	(David at least)), thus sent to `current'

				=========

To force AMD 486 DX-2 CPUs to boot with `GA-486US Gigabyte' ISA motherboards
originally equipped with an Intel 33MHz 486DX, the patch below was used.

*** /sys/i386/isa/npx.c.old	Sat Jun 11 08:09:00 1994
--- /sys/i386/isa/npx.c	Wed Oct  5 22:28:35 1994
***************
*** 274,281 ****
  			control &= ~(1 << 2);	/* enable divide by 0 trap */
  			fldcw(&control);
  			npx_traps_while_probing = npx_intrs_while_probing = 0;
  			fp_divide_by_0();
! 			if (npx_traps_while_probing != 0) {
  				/*
  				 * Good, exception 16 works.
  				 */
--- 274,290 ----
  			control &= ~(1 << 2);	/* enable divide by 0 trap */
  			fldcw(&control);
  			npx_traps_while_probing = npx_intrs_while_probing = 0;
+ #ifndef AMD_CPU_PLUS_GIGABYTE_MOTHERBOARD
  			fp_divide_by_0();
! #endif
! 			if (
! #ifndef AMD_CPU_PLUS_GIGABYTE_MOTHERBOARD
! 				npx_traps_while_probing != 0
! #else
! 				1
! #endif
! 				) {
  				/*
  				 * Good, exception 16 works.
  				 */

This patch was necessary for both of 
	- 2 ISA `Gigabyte GA-486US' motherboards normally equipped with
	  33 MHz Intel 486 DX cpus, (used previously with FreeBSD-1.1.5
	  by jhs@, & used with FreeBSD 1.1.5 & 2
	  by gj@_ERASE_pcs.dec.com)
	- 2 AMD DX2/66 CPUS used by rgrimes@_ERASE_agora.rain.com, that had checked
	  OK for npx with a non Gigabyte motherboard.

The patch got these AMD + Gigabyte hybrids to boot, but the system crashed
when something like float 1 / 0 was done.

The AMD chips also failed to boot Linux on a `Gigabyte' EISA motherboard,
owned by me@_ERASE_pcs.dec.com, that normally can run FreeBSD 1 & 2 & Linux OK.

Hardware:
	The fact that the AMD CPUs tested OK elsewhere, is no proof they're
	within specification, the same applies to the motherboards, the fact 
	that they work with Intel cpus does not prove they're in spec. either. 
	Either these AMD cpus or Gigagbyte motherboards, or both, may be 
	marginal, or even somewhat out of spec., but still work with other 
	combinations.

	(Anyone who doesnt understand this matter of `in spec.' should 
	consider fan-outs, rise/fall times (including how clean the 
	transition), dynamic association of rise times between adjacent pins,
	loading on power bus affecting individual signal pin performance both
	on board & within CPU etc.)

	As to which of these CPUs or motherboards are `at fault', one should
	attach equal suspicion to both, until (if ever) someone with truly
	bounteous time & very expensive oscilloscope etc, has the patience
	to check all combinations (yup, IE Never ;-)
	I have inadequate test resources or incentive to test this further,
	but am taking time to warn prospective Gigagbyte &/or AMD owners,
	before now finally abandoning this fruitless exercise.

The FreeBSD npx probe crashing _Silently_ is a problem easily solved
by announcement before probe starts, as previously discussed.

I do not urge the above patch to be included in generic sources,
(though no doubt config "options AMD_CPU_PLUS_GIGABYTE_MOTHERBOARD" would work )
but Do seek to inform:
	- kernel hackers of this silent npx probe hang problem
	- Prospective purchasers of Gigabyte boards or AMD CPUs 
	  (particularly in combination).

Julian Stacey
