PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Macintosh System Gestalt

When it builds the device tree, the Macintosh ROM installs a node at its root, called the gestalt node, that contains information about the Macintosh system on which it is running. The names of the properties of this node are the standard Macintosh gestalt selectors, as described in Inside Macintosh: Operating System Utilities. This book is described in Supplementary Documents. Some of the available Gestalt properties of interest to PCI drivers are shown in Table 10-2.

Table 10-2 Gestalt properties 

Name

Description

"fpu " Floating-point unit type
"hdwr" Low-level hardware configuration attributes
"kbd " Keyboard type
"lram" Logical RAM size
"mach" Macintosh model code
"mmu " Memory management unit type
"nreg" Name Registry version
"pgsz" Logical page size
"proc" Microprocessor type
"prty" Parity attributes
"ram " Physical RAM size
"rom " System ROM size
"romv" System ROM version
"ser " Serial hardware attributes
"snd " Sound attributes
"tv  " TV support version
"vers" Gestalt version
"vm  " Virtual memory attributes

Note

Specific Macintosh computer models may lack some of the gestalt values listed in Table 10-2, so the corresponding properties will not appear in the gestalt node. Macintosh computers introduced after the iMac do not include the gestalt node.

PCI expansion card firmware and driver code can explore the gestalt name entry in the Name Registry to determine the hardware and firmware environment available to it. For example, Listing 10-11 shows typical code to extract the 32-bit value of the Macintosh virtual memory attributes from the "vm  " property of the gestalt name entry.

Listing 10-11 Sample code to fetch virtual memory gestalt

    RegEntryIter            cookie;
    RegEntryID              gestaltEntry;
    RegPropertyValueSize    gestaltEntrySize = sizeof(UInt32);
    Boolean                 done;
    OSErr                   err;

        err = RegistryEntryIterateCreate(&cookie);
    if ( err != noErr )
        return err;

    err = RegistryEntrySearch ( &cookie,
                                kRegIterRoot,
                                &gestaltEntry,
                                &done,
                                "vm ",
                                nil,
                                0 );
    if ( err != noErr )
        return err;

    err = RegistryPropertyGet ( &gestaltEntry,
                                "vm ",
                                &vmIsOn,
                                &gestaltEntrySize );

    if ( err != noErr )
        return err;

    RegistryEntryIterateDispose (&cookie);

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)