News:

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

CPU identification code

Started by Antariy, September 05, 2010, 09:34:41 PM

Previous topic - Next topic

Antariy

Quote from: dedndave on September 09, 2010, 01:14:26 PM
CPUID leaf 80000000h returns the largest supported extended leaf.
To ID the Pentium 1/Pro/2/3's, use the Processor Signature from leaf 00000001h EAX register.
The Intel document 241618.PDF has quite a few errors in the Signature table.
I have corrected most, if not all, of these errors in the Signature table pic...

http://www.4shared.com/file/WHXNrzwq/Signature.html

If you read the footnotes, it points you to the individual update PDF's for the Pentium 1/Pro/2/3 Family/Models.
This is primarily where I got the correct info, along with sites like cpuworld, etc, that have partial CPUID dumps.

You may also want the Brand Index and L2 Cache type to identify specific chips.
The Family and Model values are combined in the low-order byte of the 00000001h leaf EAX Signature (AL).
For later 486's that support CPUID, the Family bits are 0100.
For the Pentium I's, the Family bits are 0101.
All the Pentium Pro/2/3's are in Family 0110 - use the low 4 bits (Model) to sort them out.

Update: As I recall, all Intel CPU's prior to family 6, model 0Bh do not support Brand String.
All Intel CPU's from family 6, model 0Bh and up do support Brand String.
I think nearly all AMD chips do support Brand String.

The AMD CPUID document is...

http://support.amd.com/us/Processor_TechDocs/25481.pdf

Thanks Dave, I know what does CPUID EAX=80000000h :P

I make this code not for all possible CPUs, this code just for using in us testbeds. So, it don't show many things, and not support many CPUs (Transmeta, VIA etc). This is simple code, I don't trying make something all-embracing.

In short words, all pre-PIV CPUs of Intel don't have brand name string. Maybe last revisions of PIII (crutches like 2.5GHz upclock) have brand-name, because released after first PIV.

I think, I used simplest and reliable method of detection for Intel's CPUs generation and extensions.
If I implement AMDs bits which Rockoon gives to me, then I'll based checking for AMD with CPUID EAX=0 and return ECX="DMAc" :P


Dave, thanks for info and links, I downloaded AMDs PDF.



Alex

Antariy

On page: "http://software.intel.com/en-us/articles/multi-core-detect/" I found this quote for Dave, because he is not believe to me, what Prescott may be not HTT even if HTT bit is set. Since Dave cannot see my system (Dave, come to me :), I give this link and quote.
Quote
Logical Processors per Package (CPUID.1.EBX[23:16]) — Indicates the maximum number of logical processors in a physical package. This represents the hardware capability of the processor as manufactured, and does not necessarily equate to the number of logical processors enabled by the platform bios or operating system.

Method which I used in cores.zip and suggest to Gunther for checking for real HTT support is reliable. These bits shows number of logical CPUs (if CPU have 2 physical cores - this is equal to 2 logical, at least).
So, I only shift by 16 bits, and mask bh. In ebx (bl) - count of cores. If HTT (#28 of EDX) bit is set, but cores count is 1 - then CPU don't support HTT. Because BIOS is not have meaning on results of CPUID EAX=1 EBX[23:16] (read quote or link).



Alex

FORTRANS

Edit:  wrong information, sorry.

SRN

Antariy

Quote from: FORTRANS on September 10, 2010, 12:40:20 PM
Edit:  wrong information, sorry.

SRN

:eek

I not saw your initial post, Steve! :)



Alex

FORTRANS

Hi,

   It was about testing the CPUID instruction to see if extended
functions existed on older processors like the PII and PIII.  And
it was wrong when I double checked the Intel document.  So,
rather than trying to explain or correct it, I just edited it away.

Regards,

Steve

Antariy

Quote from: FORTRANS on September 10, 2010, 10:01:06 PM
Hi,

   It was about testing the CPUID instruction to see if extended
functions existed on older processors like the PII and PIII.  And
it was wrong when I double checked the Intel document.  So,
rather than trying to explain or correct it, I just edited it away.

Regards,

Steve


No problem, Steve.
In manual, which I have, Intel suggest test for 80000000h - if returned this value, then no brand string. But I'm using more reliable - add eax,eax (to drop higher bit and leave only little bits). I expect, what CPUID must return 0 or 80000000h if CPU have not extended functions, but Intel make some mess :) So, I checked for SSE2, too.

Thanks for testing and help - maybe not many PIII CPUs have that behaviour - so, your test is VERY helpful.



Alex

Antariy

Dave (dedndave), thanks, I downloaded Signature.zip also.



Alex