Page 1 of 1
Detect cpu
Posted: Sat Mar 22, 2008 7:32 am
by Pitchu
Hi
While i am passing data about HW to kernel during booting i want to display cpu model like "pentium 4 2.4 ghz.
How to do that?
Posted: Sat Mar 22, 2008 7:35 am
by Combuster
Google for CPUID.
Posted: Sat Mar 22, 2008 2:20 pm
by lukem95
CPUID is what you want (as combuster said).
You could also use ACPI and/or MP tables to get this information, as some CPU's don't support the CPUID instruction.
Posted: Wed Mar 26, 2008 4:31 am
by wilsonsamm
Some people's way of doing it is to see if the leftmost three bits in FLAGS may be set. If they can, then you know that you have at least an i386, but this method is not always reliable.
mov ax,7000h
push ax
popf
pushf
pop ax
and ax,7000h
cmp ax,7000h
je CPU386
halt
CPU386: nop ; if we get here, then we have at least a 386.