*BSD News Article 28147


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!charnel!xmission!u.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (Terry Lambert)
Newsgroups: comp.os.386bsd.development
Subject: Re: Software to distinguish 386SX from 386DX?
Date: 5 Mar 1994 04:34:05 GMT
Organization: Weber State University, Ogden, UT
Lines: 30
Message-ID: <2l923u$hb8@u.cc.utah.edu>
References: <STEVE.94Mar3150456@ray.MorningStar.Com>
NNTP-Posting-Host: cs.weber.edu

In article <STEVE.94Mar3150456@ray.MorningStar.Com> Steve Wilson <steve@MorningStar.Com> writes:
>I have a routine which can distinguish a 386 from a 486, and if it is a
>486 it checks for the presence of a math coprocessor to guess at whether
>it is a 486SX or 486DX.  Now for the tough part...
>
>Is there any way to distinguish a 386SX from a 386DX in software?

One way might be to get the real time clock, and then buzz 100 (or 1000 or
whatever it takes to overcome the resoloution problems and clock speed
differences at the same time) 16 bit object then 32 bit object fetches
and BINVD's, and then see if it's half the speed with one over the square
root of two (or some other likely sigma).

On a DX, the fetches of 32 bit and 16 bit objects should be close to the
same time, while the number of bus fetches on an SX will double for 32
bit objects over 16 bit objects.

The BINVD is to make sure a real bus fetch occurs instead of a fetch from
cache.

Other than that, you could write a detect routine that printed "is your
machine an SX?" on the screen and hung waiting for a "Y" or "N" to be
hit.  8-).  8-).


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.