Detecting CPU vendor. Support for printing ascii

This commit is contained in:
Dr-Noob
2018-03-30 11:58:27 +02:00
parent 4e1ee88c4c
commit 3e1f6af8ae
8 changed files with 248 additions and 23 deletions

View File

@@ -1,17 +1,22 @@
#include <stdio.h>
#include <string.h>
#include "extended.h"
char* getString_CPUName() {
unsigned eax, ebx, ecx, edx;
char* name = malloc(sizeof(char)*64);
memset(name,0,64);
//First, check we can use extended
eax = 0x80000000;
cpuid(&eax, &ebx, &ecx, &edx);
if(eax < 0x80000001)
return NULL;
if(eax < 0x80000001) {
sprintf(name,"Unknown");
return name;
}
//We can, fetch name
char* name = malloc(sizeof(char)*64);
eax = 0x80000002;
cpuid(&eax, &ebx, &ecx, &edx);