mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 15:37:51 -04:00
Continue cpuid implementation
This commit is contained in:
parent
4ba26a4227
commit
540f33935c
@ -22,9 +22,23 @@ void native_cpuid(uint32_t key, uint32_t* eax, uint32_t* ebx, uint32_t* ecx, uin
|
||||
: "0" (*eax), "2" (*ecx));
|
||||
}
|
||||
|
||||
void get_base_info(){
|
||||
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
|
||||
|
||||
native_cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
printf("Stepping: %u\n", eax & 0xF);
|
||||
printf("Model: %u\n", (eax >> 4) & 0xF);
|
||||
printf("Family: %u\n", (eax >> 8) & 0xF);
|
||||
printf("Processor Type: %u\n", (eax >> 12) & 0x3);
|
||||
printf("Extended Model: %u\n", (eax >> 16) & 0xF);
|
||||
printf("Extended Family: %u\n", (eax >> 20) & 0xFF);
|
||||
}
|
||||
|
||||
} //end of anonymous namespace
|
||||
|
||||
int main(){
|
||||
get_base_info();
|
||||
|
||||
exit(0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user