Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Legacy Documents > Hardware & Drivers >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Getting the Processor Type and Speed on a PCI Mac


Q: I am trying to write an application that, when run on a PCI Mac, queries the Name Registry database for the processor type and speed. I've been unable to find anything in Inside Macintosh: Designing PCI Cards and Drivers on this topic. Where can I find this information?

A: The Name Registry does not contain this information, but you can obtain it from the Gestalt Manager, just as you did on 68K Macs. This is discussed in Inside Macintosh: Operating System Utilities.

If you have a utility that already does this on a 68K Mac, it should also work on a PCI Mac. The code snippet below shows how to get the processor type:

//    This snippet calls the Gestalt Manager to read the machine type.
#include <stdio.h>
#include <GestaltEqu.h>

// prototypes
void    main(void);
void    main(void)
{
    OSErr iErr = 0;
    OSType selector = 'mach';
    long response = 0;

    printf("DTS Absolutely Free (Gratis) Snippet\n\n");
    iErr = Gestalt(selector,&response);
    if(!iErr)
        printf("The informational selector 'mach' is %ld \n", response);
    else
        printf("Sorry, an error has occurred\n");
}

[Jul 15 1995]