[v0.95][x86] Print CPUID 0x1 EAX register with debug flag

This commit is contained in:
Dr-Noob
2021-01-10 22:02:20 +01:00
parent 04f0bfcbde
commit 3bac5cbfe2
2 changed files with 9 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
#include "../arm/midr.h"
#endif
static const char* VERSION = "0.94";
static const char* VERSION = "0.95";
void print_help(char *argv[]) {
printf("Usage: %s [--version] [--help] [--debug] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n", argv[0]);

View File

@@ -891,13 +891,19 @@ char* get_str_fma(struct cpuInfo* cpu) {
return string;
}
/*** DEBUG ***/
void print_debug(struct cpuInfo* cpu) {
uint32_t eax = 0x00000001;
uint32_t ebx = 0;
uint32_t ecx = 0;
uint32_t edx = 0;
cpuid(&eax, &ebx, &ecx, &edx);
printf("%s\n", cpu->cpu_name);
if(cpu->hv->present) printf("- Hypervisor: %s\n", cpu->hv->hv_name);
printf("- Max standard level: 0x%.8X\n", cpu->maxLevels);
printf("- Max extended level: 0x%.8X\n", cpu->maxExtendedLevels);
printf("- CPUID dump: 0x%.8X\n", eax);
free_cpuinfo_struct(cpu);
}