Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

john903

macrumors member
Original poster
Apr 11, 2008
66
0
How do obtain the values found in About This Mac -> More Info... such as Model Name or Processor Name in a carbon application?
 

zaney

macrumors regular
Apr 6, 2008
105
0
Middle of a field, UK
I've never written a Carbon app, but I seem to remember reading somewhere that you can launch Apple System Profiler, and get the information via Apple events.
I can't help you out more myself, but it might give you a new direction for google searches.
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
Austin, TX
Use sysctl APIs:

Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysctl.h>

int main() {
	int hertz;
	size_t size = sizeof(int);
	int mib[2] = {CTL_HW, HW_CPU_FREQ};
	
	sysctl(mib, 2, &hertz, &size, NULL, 0);
	printf("%d\n", hertz);
	return EXIT_SUCCESS;
}
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
I'm still digging through the output, but did a ktrace on SystemProfiler. So far this file:
"/System/Library/SystemProfiler/SPPlatformReporter.spreporter/Contents/Resources/SPMachineTypes.plist"
is where the machine descriptions come from. Still trying to see where it gets the key. ktrace output might not be enough, but I was thinking it might point to the framework or frameworks that are used.

-Lee

Also got the output of Strings from the SPPlatformReporter binary, some method and property names in there, it looks like. It might at least help your googling:
@12@0:4@8
@12@0:4S8
@8@0:4
base2SizeString
numberWithUnsignedLongLong:
dictionaryWithContentsOfFile:
pathForResource:eek:fType:
bundleForClass:
class
stringWithUTF8String:
numberWithInt:
self
UTF8String
componentsSeparatedByString:
length
release
stringWithCString:
bytes
setObject:forKey:
stringValue
dictionary
stringWithFormat:
addEntriesFromDictionary:
objectAtIndex:
addObject:
objectForKey:
updateDictionary:
marketingStringForMHz:
bootromDictionary
cpuDictionary
AMSDictionary
SMCDictionary
BMCDictionary
platformDictionary
NSDictionary
NSBundle
NSNumber
NSMutableDictionary
NSString
NSObject
SPReporter
SPPlatformReporter
_items
IOPlatformExpertDevice
serial-number
IOPlatformSerialNumber
serial_number
sales_order_number
IODeviceTree:/rom
version
%@.%@.%@
boot_rom_version
cpu_type
IOResources
IOSMSClass
IOI2CMotionSensor
PMUMotionSensor
ams-active
MMM_state
MMM_enabled
MMM_disabled
ams-application-version
MMM_version
%d.%d
MMM_entry
AppleSMC
smc-version
SMC_version
AppleKCS
BMC Revision
LOM_revision
_name
hardware_overview
hw.physicalcpu
number_processors
machine_model
plist
SPMachineTypes
machine_name
hw.cpufrequency_max
current_processor_speed
machdep.cpu.logical_per_core
hw.logicalcpu
platform_cpu_htt
htt_enabled
htt_disabled
physical_memory
hw.cacheconfig
packages
l2_cache_share
l2_cache
l3_cache_size
bus_speed
%d MHz
%.*f GHz
Intel Core Solo
Intel Core Duo
Intel Core 2 Solo
Intel Core 2 Duo
Single-Core Intel Xeon
Dual-Core Intel Xeon
Unknown Intel Xeon
Quad-Core Intel Xeon
PowerPC
PowerPC 601
PowerPC 602
PowerPC 603
PowerPC 603e
PowerPC 603ev
PowerPC 604
PowerPC 604e
PowerPC 620
PowerPC G3
PowerPC 750
PowerPC G4
PowerPC 7400
PowerPC 7450
PowerPC G5
PowerPC 970
MHzFormat
GHzFormat
IntelSpeedAndTypeFormat
Intel1xCPUFormat
Intel2xCPUFormat
Intel3xCPUFormat
Intel4xCPUFormat
IntelNxCPUFormat
UnknownCPUKind
%1$@ %2$@
2 x %@
3 x %@
4 x %@
%1$d x %2$@
Unknown
AppleSystemInfo
/System/Library/CoreServices/
machdep.cpu.brand_string
Xeon
hw.cpufrequency
ASI_CopyComputerModelName
/System/Library/SystemProfiler/SPPlatformReporter.spreporter
Localizable
ASI_NumberOfCPUs
IODeviceTree:/efi
hw.cpufamily
machdep.cpu.cores_per_package
ASI_CopyCPUKind
IODeviceTree:/cpus/CPU0@0
cpu-type
cpu-type data length incorrect size, expect 2, received %d
ASI_BusSpeedInHz
ASI_CopyCPUDescription
ASI_CopyCurrentCPUDescription
ASI_CopyBusSpeedDescription
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.