cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/01/11:36:01

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>, "Michel Huot" <huotm AT icrdl DOT net>
Subject: RE: 80x87 detection in DJGPP programs
Date: Sat, 1 Aug 1998 16:36:11 +0100
Message-ID: <000001bdbd62$1c795400$ad4e08c3@arthur>
MIME-Version: 1.0
Importance: Normal
In-Reply-To: <35C1E73C.107A@icrdl.net>

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01BDBD6A.7E3DBC00
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

> Arthur wrote:
> > You could use Allegro - it has a global variable which is set to TRUE
> > if you have a FPU
>
> I ve looked at the Allegro code to detect FPU, but this code also crash
> my computer. (SIGFPE) Im wondering if there is a way to intercept or to
> disable the SIGFPE signal, so my program wont crash when i try to detect
> a FPU. Anyone has a clue?

Enclosed is a little sample program I wrote to check out my system. It works on my
system. If you still have a problem mail me, or try the Allegro Mailing List
www.tatula.demon.co.uk/allegro.

HTH

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

------=_NextPart_000_0001_01BDBD6A.7E3DBC00
Content-Type: application/octet-stream;
	name="syscheck.cc"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="syscheck.cc"

#include <allegro.h>
#include <stdio.h>

extern char allegro_id[], cpu_vendor[];
extern int os_type;
extern int cpu_family, cpu_model, cpu_fpu, cpu_mmx, cpu_cpuid;

void print_data();

void print_data()
{
	printf("Allegro ID:          %s\n",allegro_id);

	printf("OS Type:             ");
	
	switch(os_type)
	{
	case OSTYPE_UNKNOWN: printf("MS-DOS\n"); break;
	case OSTYPE_WIN3:    printf("Windows 3\n"); break;
	case OSTYPE_WIN95:   printf("Windows 95\n"); break;
	case OSTYPE_WINNT:   printf("Windows NT\n"); break;
	case OSTYPE_OS2:     printf("OS/2\n"); break;
	case OSTYPE_WARP:    printf("OS/2 Warp 3\n"); break;
	case OSTYPE_DOSEMU:  printf("Linux DOSEMU\n"); break;
	case OSTYPE_OPENDOS: printf("Caldera OpenDOS\n"); break;
	}


	printf("CPU Vendor:          %s\n",cpu_vendor);
	

	printf("CPU TYPE:            ");
	switch(cpu_family)
	{
	case 3:
		printf("386 ");
		switch(cpu_model)
		{
		case 0: printf("DX"); break;
		case 2: printf("SX"); break;
		case 4: printf("SL"); break;
		default:printf("Unknown"); break;
		}
		break;
	case 4: 
		printf("486 ");
		switch(cpu_model)
		{
		case 0:
		case 1: printf("DX"); break;
		case 2: printf("SX"); break;
		case 3: printf("DX or 487SX"); break;
		case 4: printf("SL"); break;
		case 5: printf("SX2"); break;
		case 7: printf("DX2"); break;
		case 8: printf("DX4"); break;
		case 14:printf("Cyrix"); break;
		default:printf("(unknown type)");
		}
		break;
	case 5: 
		printf("Pentium ");
		switch(cpu_model)
		{
		case 1: printf("510\66 or 567\66"); break;
		case 2: printf("P54C"); break;
		case 3: printf("Overdrive"); break;
		case 4: break;
		case 5: printf("DX4 Overdrive"); break;
		case 14:printf("Cyrix"); break;
		default:printf("(unknown type)");
		}
		break;
	case 6: printf("Pentium Pro "); break;
	}
	if(cpu_mmx) printf("MMX");
	printf("\n");

	printf("FPU CHIP:            ");	
	switch(cpu_fpu)
	{
	case TRUE: printf("installed\n"); break;
	default: printf("not installed\n"); break;
	}

	switch(cpu_cpuid)
	{
	case TRUE: printf("Data Accurate\n"); break;
	default: printf("Some Possible Innacuracies\n"); break;
	}	
}

int main()
{
	allegro_init();
	check_cpu();	

	print_data();

	return 0;
}
------=_NextPart_000_0001_01BDBD6A.7E3DBC00--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019