cpu type over 486 & speed
cpu type over 486 & speed
Is there a way to find the cpu type over 80486. All the algorithms I found checks cpu type up to 486 and then gives the cpuid result. how can I find type of Cpu, such as Pentium II, Pentium III, Celeron, AMD..??
And as a second question, how can I measure the speed of CPU??
Thanks for any help, example, advice or web addr...
Even for good google search keys except: cpu,type,speed:))
And as a second question, how can I measure the speed of CPU??
Thanks for any help, example, advice or web addr...
Even for good google search keys except: cpu,type,speed:))
Re:cpu type over 486 & speed
I wonder if intel manual includes AMD specific information. But as I learnt, some AMD processors supports CPUID instruction.slacker wrote: look at cpuid in intel manual
And what about speed?how would you measure the speed of CPU?
Re:cpu type over 486 & speed
i doubt Intel would carry such knowledge of AMD. try amd's website.
-GT
-GT
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:cpu type over 486 & speed
the CPUID instruction is generic. It will help you defining the CPU manufacturer (as it's returned in texto by the processor whether it's GenuineIntel or AuthenticAMD ) and various misc. info like does it support MMX, SSE, PGE, etc.
Now, if you have 486 only, CPUID will raise a InvalidOpcode exception, because it's an instruction that has been introduced on the Pentium only. (i.e. supported on all Pentium compatible processors, including AMD K6 and K7 family)
To determine your processor speed, the best way is to combine the use of a timer interrupt and the use of RDTSC instruction (also pentium-specific) or a counting loop that consumes a well-known amount of CPU cycles.
You should find more infos about this in this thread and in this other one
Now, if you have 486 only, CPUID will raise a InvalidOpcode exception, because it's an instruction that has been introduced on the Pentium only. (i.e. supported on all Pentium compatible processors, including AMD K6 and K7 family)
To determine your processor speed, the best way is to combine the use of a timer interrupt and the use of RDTSC instruction (also pentium-specific) or a counting loop that consumes a well-known amount of CPU cycles.
You should find more infos about this in this thread and in this other one
Re:cpu type over 486 & speed
Later 486 chips do support CPUID, so check the ID bit in EFLAGS (was it EFLAGS? or was it some other register? -- check in Intel manual).
CPUID can also give you the CPU speed in MHz. Alternatively, there was a thread in alt.os.development recently about Pype.Clicker's way of doing it.
CPUID can also give you the CPU speed in MHz. Alternatively, there was a thread in alt.os.development recently about Pype.Clicker's way of doing it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:cpu type over 486 & speed
i gave a quick look at http://grafi.ii.pw.edu.pl/gbm/x86/cpuid ... tidroutine , but i don't see any information about speed. Other documents give a table of stepping information and the speed of the processor, but just relying on that table cannot take into account over/underclocked processors.
Or is it something i'm just missing ?
Or is it something i'm just missing ?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:cpu type over 486 & speed
from the above link:Tim Robinson wrote: Later 486 chips do support CPUID, so check the ID bit in EFLAGS (was it EFLAGS? or was it some other register? -- check in Intel manual).
Checking for CPUID support
This is quite easy. Try to change the value of CPUID bit (bit 21) in EFLAGS. If the bit can be toggled, CPUID is supported and shall be used for precise identification. On Cyrix chips the bit cannot be toggled if not explicitly allowed - please use this link ....(not ready yet)
Re:cpu type over 486 & speed
Is there a common-loop-pattern? I may use RDTSC but I dont want the procedure to be pentium specific..Pype.Clicker wrote: a counting loop that consumes a well-known amount of CPU cycles.
Re:cpu type over 486 & speed
Is it possible to calculate the total cycle to execute this loop once? I think the total cycle is not the sum of each instructions execute cycles, due to the pipeline. Arent I right?For instance, you have IRQ0@1KHz, and some code looking like
here:
inc [counter]
cmp [done],1
jne here
cpu_speed = [counter] * $x
using $x cpu cycles for each loop.
Re:cpu type over 486 & speed
On any CPU that doesn't have RDTSC, you can count instruction cycles. On more modern pipelined CPUs you have to rely on RDTSC to count cycles.