For DOS Protected Mode version of sensor core software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
811 B

#include <stdio.h>
#include <dos.h>
// Disable warning message "Parameter xxx is never used
#pragma warn –par
// Read north bridge register
unsigned long read_nb(unsigned char idx)
{
unsigned long retval;
_asm mov dx, 0cf8h
__emit__(0x66); __emit__(0xb8);
__emit__(0x00); __emit__(0x00); __emit__(0x00); __emit__(0x80);
_asm mov al, idx
__emit__(0x66); _asm out dx, ax
_asm mov dx, 0cfch
__emit__(0x66); _asm in ax, dx
__emit__(0x66); _asm mov WORD PTR retval, ax
return retval;
}
unsigned int IsVortex86SX()
{
// Vortex86SX: 0x31504d44
// Vortex86DX: 0x32504d44
// Vortex86MX: 0x33504d44
// We check Vortex86SX here
if(0x31504d44L == read_nb(0x90))
return 1;
else
return 0;
}
int main(int argc, char *argv[])
{
if(IsVortex86SX())
printf("Vortex86SX found.");
else
printf("\nVortex86SX not found.");
return 0;
}