[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is the best way to access the gestalt manager in MCL?
- To: info-mcl@cambridge.apple.com
- Subject: Re: What is the best way to access the gestalt manager in MCL?
- From: jwbaxter@olympus.net (John W. Baxter)
- Date: Mon, 29 Aug 1994 18:34:56 -0700
>At 3:14 AM 8/24/94 -0500, Rob Browning wrote:
> >I just want to be able to ask the machine that MCL is running on two
>questions:
> >
> >1) Which CPU do you have?
> >2) Do you have an FPU?
> >
> >Is there an easy way to do this? Am I best off to learn the gestalt traps
> >and call them directly, or is there a higher level interface?
> >
> >Thanks,
> >
> >--Rob.
>
>There's several ways to get this.
>
>*environs* carries a lot of this junk which gets detected when you launch MCL.
>
>(machine-version) pretty-prints some of it into a string.
>
>(gestalt :|mach|) tells you the machine - look at *known-gestalt-machine-types*
>(gestalt :|proc|) tells you the processor - look at
>*known-gestalt-processor-types*
>(gestalt :|fpu |) tells you which fpu is available - *known-gestalt-fpu-types*
>
>? *environs*
>(:machine-type "Macintosh Quadra 950" :system-version "7.1" :appleevents t
>:processor 68040 :fpu 68040 ...)
>? (machine-version)
>"Macintosh Quadra 950 with 68040, 68040, Apple extended keyboard"
Another interesting Gestalt selector:
(gestalt :|cput|) if defined (it's not on sufficiently early Systems) tells
you the truth about the processor (|mach| tells you a Power Mac has a
68020. But be careful, because Apple managed to put wrong values into a
header file release for the 680x0 return values (off by one). I believe
the following to be correct:
gestaltNativeCPUtype = 'cput'; {Native CPU type}
{Motorola Architecture}
gestaltCPU68000 = $0x001;
gestaltCPU68010 = $0x002;
gestaltCPU68020 = $0x003;
gestaltCPU68030 = $0x004;
gestaltCPU68040 = $0x005;
{PowerPC Architecture}
gestaltCPU601 = $0x101;
gestaltCPU603 = $0x103;
gestaltCPU604 = $0x104;
[From Rene Ros' excellent Gestalt selectors list]
--John
--
jwbaxter@pt.olympus.net (John W. Baxter) Port Ludlow, WA
When was the last time you checked out the ceiling tiles in a building you
were in?