24

Detecting the CPU model has been easy since Intel added the CPUID instruction to their Pentium processors (and some late 486s). However, earlier CPUs did not have this feature, so software had to rely on the slight differences between models.

This page by R. Collins explains quite well how to create a detection algorithm, however it doesn't explain how to tell apart some of the models (such as DX2 vs DX4), or how to find the specific models of non-Intel CPUs.

Specifically, is it possible to tell apart a i486DX vs i487SX? Or a i486DX vs i486DX2 vs i486DX4? I am trying to create a DOS program that displays as much information about the CPU as possible.

By the way, I am aware of the CPU leaving its stepping information in EDX at reset, just as described in the page, but I would like to know if there are also alternative methods, since some BIOSes are mapped both at 0xFFFFFFF0 and 0xFFEFFFF0, meaning that the A20 gate trick described in the article above won't work.

0

2 Answers 2

28

The most comprehensive pre-CPUID x86 CPU detection code I’m aware of is in TMi0SDGL (Too Much in One So Don’t Get Lost). It includes source code. It will use model-specific MSRs, BIOS services etc. to extract as much information as possible; for example, some BIOSes store the EDX identifier and make it available for later use; and Cyrix CPUs have MSRs storing specific model information.

The library also contains CPU frequency detection code, which is quite reliable for 386- and 486-era CPUs. You can use that to distinguish between some DX, DX2 and DX4 models.

Without their specific identifiers, I don’t think it’s possible to differentiate 486DXs and 487SXs, except 16MHz models which can only be SXs (assuming no underclocking).

As you mention, later 486s, in particular DX4s, do support CPUID so it’s worth checking for that anyway (TMI0SDGL does).

3
  • I thought a 486DX always had an integrated math chip, while the SX didn't? So just check that FNSTSW altered a memory variable, and if it did, it was necessarily a DX. Mar 12 at 15:12
  • 4
    @Arthur the OP is trying to differentiate the 486DX and 487SX, not 486SX. The 487SX is effectively a 486DX. Mar 12 at 17:10
  • Didn't notice that, sorry. Mar 12 at 21:17
20

If your goal is to display as much information as possible, I'd take a look at Chapter 4: System and Equipment Detection of The Undocumented PC by Frank van Gilluwe.

(Starting at page 95 in the first edition (Internet Archive) or at page 129 in the second edition (Internet Archive).)

Aside from the explanatory text, it includes a sample x86 assembly program to retrieve the relevant data which should also be present on the companion floppy (Internet Archive).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .