News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Another CPU ID Program

Started by dedndave, January 03, 2010, 11:26:03 AM

Previous topic - Next topic

hutch--

Michael's result is interesting, I wonder if there is enough data available for the PIII and earlier to determine the processor type ? I remember in the distant past the very early Pentiums and a Cyrix processor and while almost none of them would be running anything later than win9x I never bothered to find out if they could be ID'd or not. I once owned an old AMD running at 550 meg that had problems with win95b and needed a patch but as is probably the case, even if stuff that old would still run, its doubtful that its worth the effort to cater for it.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

they can be identified
although, to cover the entire gambit of old CPUs takes too much code
not much sense to ID anything earlier than a 486
Win98 requires an FPU - Win95 does not
that is a good break-point, i would say
most 386 owners never acquired a 387
386 processors aren't too bad to ID, as there weren't very many models
486 on up has CPUID, to one degree or another

one thing i forgot to put in there was a simple "level of CPUID support" value
that would ID some earlier processors if we had the database (haven't seen info listed that way)
i.e. when you invoke CPUID with a value of EAX=0, it returns (in EAX) the highest level of standard CPUID functions
if the CPU supports CPUID function 5 max, for example, it will return a 5
similarly, with the extended functions, if you invoke CPUID with 80000000h, it returns a value like 80000005h in EAX
i have seen no list organized as "this CPU supports these CPUID functions"
although, one could be created

FORTRANS

Hi,

   I went out to Intel's site and browsed around.  Application
Note AP-485 has a table with family and type values.  It
also has a Brand ID table.  With those one should be able
to identify most processors.  Some are still ambiguous.  Still
it seems a decent document.  So the older processors like
the ones I and Michael posted could be "named" if wanted.

Regards,

Steve N.

dedndave

i plan on doing that, too, Steve
we can at least ID 80386, 80486, Pentium I, II, III that way
thanks for the app-note number
oh - that is 241618.pdf - got that one - although, i think they updated it

FORTRANS

Hi,

   Yeah, I found after about an hour of browsing that I
had an older version already.  (Grumble.)  Intel's search
gave a lot of broken links when searching for the PDF by
its number.  So that's why I posted the AP number.  And
it turned out to have been updated from the one I had
so I figured it wouldn't hurt mention it.

Cheers,

Steve N.

dedndave

that is revision 036 - i was running on 034
not that any 486/older pentium stuff has changed - lol

EDIT - one thing i have to do is to make sure i am only using instructions that will execute on whatever we decide to support
i am sure i am using some 586 instructions (well - addressing modes, at least)
and - i better make sure my conditional branches are short - lol

hutch--

Dave,

I asked the question because to cover the whole range of very old stuff would blow out the detection algo for very little gain. The real uses are to detect instruction sets like MMX, SSE 1/2/3/4/4.1 and the AMD specifics. If its easy to handle the earlier Pentium range then it would make sense but you can open up a Pandoras box to cover all the variations of the old stuff when almost all of it no longer runs.

You could do an OS type specific version for Win2000 or later that did not test the very old stuff and if you felt like it later you could do a true legacy version that plodded through the antiques but a compact and simplified version for the late stuff would be of a lot more use.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

i have been looking at it, Hutch
i am making a table (text file notes) to ID the simple ones
it looks like i should be able to handle the following and create simple strings without too much bloat:

80486
Pentium
Pentium Pro
Pentium II
Pentium III

i think those are the strings i will use, too - nothing fancy
no need to say "Pentium III MMX" because the MMX is already taken care of
80386's and older 80486's that do not support CPUID get nothing - lol

dedndave

Warning

CPUID can cause severe headaches

hutch--

 :bg

> 80386's and older 80486's that do not support CPUID get nothing

Processor too old to indentify  :P
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

you're close, Hutch.....
"programmer to old to process"   :P

when i saw how easy it was to id 80386/80486 - that one went in no prob
but - i have been poking around and trying to ID other vendors
also - i want to do a core and thread count
i figure i may as well do it once, do it right, and be done with it
i think we all take a stab at this one time or another
about half way through, we get side-tracked or decide it isn't worth the effort
so - i'll take one for the team - lol

hutch--

 :bg

CPU does not support MMX or later instructions. (Translation = Antique pile of junk) or (Legacy Hardware of unknown origin) etc ...

Here is another one.

Vendor String Not Available. (ALIAS as above)
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

well - i think i have the framework in place to name all the processors that win95+ can run on
i won't have the names for the earlier Geodes, for example, but i will be able to add them without altering the data structure
it didn't take much in the way of code or data to say "80386" or "80486" - and for those processors, that is all i intend to provide

the hardest group to cover is the Intel Pentium II/III group, which includes a lot of marketing names like Xeon and Celeron
some of those cannot be distinguished
the worst part of that group are the Tualatin cores, which are abundant because they were good performers
as an example, the Pentium III-S is a special server version of the Tualatin that runs at 1.45 V and has a heat spreader package
that processor has found it's way into many laptop and mobile applications and is an old favorite of overclockers
there are also Low Voltage and Ultra Low Voltage versions of that core (1.15 and 1.1 V)
for programming considerations, the name isn't critical, as they all run the same instruction set
but - if you incorrectly identify a processor, someone will say "this routine is broken" - lol
i can avoid some of that
along the way, i have learned a few things, which is always good too   :U

the real reason for going through it was to find out what design criteria were needed to provide the desired results
i wanted a routine that could be expanded on without re-writing it everytime you add a name - lol

Magicle

   EAX: 0
          ECX: 120
          EDX: 00403AB0h
       cbSize: 120
dwCoreAffMask: 00000000000000000000000000000001b
dwIdCpuStatus: 00000000h
    bVendorID: 2
      bFamily: 15
   bExtFamily: 1
       bModel: 2
    bExtModel: 0
        bType: 0
        bStep: 3
     bMmxBits: 00000011b
   w3DNowBits: 0000000000000011b
     wSseBits: 0000000001000111b
   dwMiscBits: 00000000000001001011111111111111b
      szBrand: AMD Phenom(tm) 9850 Quad-Core Processor
     szVendor: AuthenticAMD
        szMmx: MMX+
      sz3DNow: 3DNow!+
        szSse: SSE4a


I am so sad, I can't even figure 10% of that code  :(
Rofl, maybe in 3 years I'll be able to write a code like that as well  :P

dedndave

CPUID is something noone wants to learn - lol
i am currently working on a much better version
i finally tackled the last hurdle, it is just a matter of putting all the pieces together