Index: trunk/i386/libsaio/fake_efi.h =================================================================== --- trunk/i386/libsaio/fake_efi.h (revision 2283) +++ trunk/i386/libsaio/fake_efi.h (revision 2284) @@ -1,5 +1,28 @@ /* - * Copyright 2007 David F. Elliott. All rights reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * Copyright 2007 David F. Elliott. + * All rights reserved. + * */ #ifndef __LIBSAIO_FAKE_EFI_H @@ -9,5 +32,5 @@ #define MAX_CONFIGURATION_TABLE_ENTRIES 10 extern void setupFakeEfi(void); - + #endif /* !__LIBSAIO_FAKE_EFI_H */ Index: trunk/i386/libsaio/smbios.c =================================================================== --- trunk/i386/libsaio/smbios.c (revision 2283) +++ trunk/i386/libsaio/smbios.c (revision 2284) @@ -9,6 +9,8 @@ #include "boot.h" #include "bootstruct.h" #include "smbios_getters.h" +// Bungo +#include "convert.h" #ifndef DEBUG_SMBIOS #define DEBUG_SMBIOS 0 @@ -28,236 +30,379 @@ //------------------------------------------------------------------------------------------------------------------------- // SMBIOS Plist Keys //------------------------------------------------------------------------------------------------------------------------- -/* BIOS Information */ -#define kSMBBIOSInformationVendorKey "SMbiosvendor" -#define kSMBBIOSInformationVersionKey "SMbiosversion" -#define kSMBBIOSInformationReleaseDateKey "SMbiosdate" -/* System Information */ -#define kSMBSystemInformationManufacturerKey "SMmanufacturer" -#define kSMBSystemInformationProductNameKey "SMproductname" -#define kSMBSystemInformationVersionKey "SMsystemversion" -#define kSMBSystemInformationSerialNumberKey "SMserial" -#define kSMBSystemInformationFamilyKey "SMfamily" +/* ======================= + BIOS Information (Type 0) + ========================= */ +#define kSMBBIOSInformationVendorKey "SMbiosvendor" // Apple Inc. +#define kSMBBIOSInformationVersionKey "SMbiosversion" // MP31.88Z.006C.B05.0802291410 +#define kSMBBIOSInformationReleaseDateKey "SMbiosdate" // 02/29/08 +// Bungo +#define kSMBBIOSInformationReleaseKey "SMbiosrelease" // BIOS Revision +// example: BIOS Revision: 1.23 --> 2 bytes: Major=0x01, Minor=0x17 --> after swap: 0x1701hex = 5889dec (SMBIOS_spec_DSP0134_2.7.1) -/* Base Board */ -#define kSMBBaseBoardManufacturerKey "SMboardmanufacturer" -#define kSMBBaseBoardProductKey "SMboardproduct" +/* ========================= + System Information (Type 1) + =========================== */ +#define kSMBSystemInformationManufacturerKey "SMmanufacturer" // Apple Inc. +#define kSMBSystemInformationProductNameKey "SMproductname" // MacPro3,1 +#define kSMBSystemInformationVersionKey "SMsystemversion" // 1.0 +#define kSMBSystemInformationSerialNumberKey "SMserial" // Serial number +//Bungo +#define kSMBSystemInformationUUIDKey "SMsystemuuid" // ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }' +#define kSMBSystemInformationSKUNumberKey "SMskunumber" // System SKU# -/* Processor Information */ +#define kSMBSystemInformationFamilyKey "SMfamily" // MacPro + +/* ========================================= + Base Board (or Module) Information (Type 2) + =========================================== */ +#define kSMBBaseBoardManufacturerKey "SMboardmanufacturer" // Apple Inc. +#define kSMBBaseBoardProductKey "SMboardproduct" // Mac-F2268DC8 +// Bungo +#define kSMBBaseBoardVersionKey "SMboardversion" // MacPro3,1 +#define kSMBBaseBoardSerialNumberKey "SMboardserial" // C02140302D5DMT31M +#define kSMBBaseBoardAssetTagNumberKey "SMboardassettag" // Base Board Asset Tag# +#define kSMBBaseBoardLocationInChassisKey "SMboardlocation" // Part Component +#define kSMBBaseBoardTypeKey "SMboardtype" // 10 (Motherboard) all model, 11 (Processor+Memory Module) MacPro + +// Bungo +/* ======================= + System Enclosure (Type 3) + ========================= */ +#define kSMBSystemEnclosureManufacturerKey "SMchassismanufacturer" // Apple Inc. +#define kSMBSystemEnclosureTypeKey "SMchassistype" // 7 Desktop +#define kSMBSystemEnclosureVersionKey "SMchassisversion" // Mac-F42C88C8 +#define kSMBSystemEnclosureSerialNumberKey "SMchassisserial" // Serial number +#define kSMBSystemEnclosureAssetTagNumberKey "SMchassisassettag" // Pro-Enclosure + +/* ============================ + Processor Information (Type 4) + ============================== */ +// Bungo +#define kSMBProcessorInformationSocketKey "SMcpusocket" +#define kSMBProcessorInformationManufacturerKey "SMcpumanufacturer" +#define kSMBProcessorInformationVersionKey "SMcpuversion" +// #define kSMBProcessorInformationExternalClockKey "SMexternalclock" #define kSMBProcessorInformationMaximumClockKey "SMmaximalclock" +// Bungo +#define kSMBProcessorInformationCurrentClockKey "SMcurrentclock" +#define kSMBProcessorInformationUpgradeKey "SMcpuupgrade" +#define kSMBProcessorInformationSerialNumberKey "SMcpuserial" +#define kSMBProcessorInformationAssetTagNumberKey "SMcpuassettag" +#define kSMBProcessorInformationPartNumberKey "SMcpupartnumber" -/* Memory Device */ -#define kSMBMemoryDeviceDeviceLocatorKey "SMmemdevloc" -#define kSMBMemoryDeviceBankLocatorKey "SMmembankloc" -#define kSMBMemoryDeviceMemoryTypeKey "SMmemtype" -#define kSMBMemoryDeviceMemorySpeedKey "SMmemspeed" -#define kSMBMemoryDeviceManufacturerKey "SMmemmanufacturer" -#define kSMBMemoryDeviceSerialNumberKey "SMmemserial" -#define kSMBMemoryDevicePartNumberKey "SMmempart" +/* ===================== + Memory Device (Type 17) + ======================= */ +#define kSMBMemoryDeviceDeviceLocatorKey "SMmemdevloc" // +#define kSMBMemoryDeviceBankLocatorKey "SMmembankloc" // +#define kSMBMemoryDeviceMemoryTypeKey "SMmemtype" // +#define kSMBMemoryDeviceMemorySpeedKey "SMmemspeed" // +#define kSMBMemoryDeviceManufacturerKey "SMmemmanufacturer" // +#define kSMBMemoryDeviceSerialNumberKey "SMmemserial" // +#define kSMBMemoryDevicePartNumberKey "SMmempart" // -/* Apple Specific */ -#define kSMBOemProcessorTypeKey "SMcputype" -#define kSMBOemProcessorBusSpeedKey "SMbusspeed" +/* =========================================== + Memory SPD Data (Apple Specific - Type 130) + ============================================= */ +/* ============================================ + OEM Processor Type (Apple Specific - Type 131) + ============================================== */ +#define kSMBOemProcessorTypeKey "SMoemcputype" // Bungo: renamed from SMcputype + +/* ================================================= + OEM Processor Bus Speed (Apple Specific - Type 132) + =================================================== */ +#define kSMBOemProcessorBusSpeedKey "SMoemcpubusspeed" // Bungo: renamed from SMbusspeed + //------------------------------------------------------------------------------------------------------------------------- // Default SMBIOS Data //------------------------------------------------------------------------------------------------------------------------- /* Rewrite: use a struct */ -#define kDefaultVendorManufacturer "Apple Inc." -#define kDefaultBIOSReleaseDate "11/06/2009" -#define kDefaultSerialNumber "SOMESRLNMBR" -#define kDefaultBoardProduct "Mac-F4208DC8" -#define kDefaultSystemVersion "1.0" +#define kDefaultVendorManufacturer "Apple Inc." +#define kDefaultBIOSReleaseDate "11/06/2009" +#define kDefaultSerialNumber "SOMESRLNMBR" +#define kDefaultskuNumber "Default System SKU#" +#define kDefaultBoardProduct "Mac-F4208DC8" +#define kDefaultBoardType "10" // 0xA +#define kDefaultSystemVersion "1.0" -// defaults for a Mac mini -#define kDefaultMacminiFamily "Macmini" -#define kDefaultMacmini "Macmini1,1" -#define kDefaultMacminiBIOSVersion " MM21.88Z.009A.B00.0903051113" +//Bungo +/* 256 = 0x0100 -> swap bytes: 0x0001 -> Release: 0.1 (see SMBIOS spec. table Type 0) */ +#define kDefaultBIOSRelease 256 +#define KDefaultBoardSerialNumber "C02140302D5DMT31M" // new C07019501PLDCVHAD - C02032101R5DC771H +#define KDefaultBoardAssetTagNumber "Pro-Enclosure" // ErmaC +#define kDefaultLocatioInChassis "Part Component" // ErmaC + +// defaults for a Mac mini +#define kDefaultMacminiFamily "Macmini" +#define kDefaultMacmini "Macmini1,1" +#define kDefaultMacminiBIOSVersion " MM21.88Z.009A.B00.0903051113" + // defaults for a MacBook -#define kDefaultMacBookFamily "MacBook" -#define kDefaultMacBook "MacBook4,1" -#define kDefaultMacBookBIOSVersion " MB41.88Z.0073.B00.0903051113" +#define kDefaultMacBookFamily "MacBook" +#define kDefaultMacBook "MacBook4,1" +#define kDefaultMacBookBIOSVersion " MB41.88Z.0073.B00.0903051113" // defaults for a MacBook Pro -#define kDefaultMacBookProFamily "MacBookPro" -#define kDefaultMacBookPro "MacBookPro4,1" -#define kDefaultMacBookProBIOSVersion " MBP41.88Z.0073.B00.0903051113" +#define kDefaultMacBookProFamily "MacBookPro" +#define kDefaultMacBookPro "MacBookPro4,1" +#define kDefaultMacBookProBIOSVersion " MBP41.88Z.0073.B00.0903051113" // defaults for an iMac -#define kDefaultiMacFamily "iMac" -#define kDefaultiMac "iMac8,1" -#define kDefaultiMacBIOSVersion " IM81.88Z.00C1.B00.0903051113" +#define kDefaultiMacFamily "iMac" +#define kDefaultiMac "iMac8,1" +#define kDefaultiMacBIOSVersion " IM81.88Z.00C1.B00.0903051113" // defaults for an iMac11,1 core i3/i5/i7 -#define kDefaultiMacNehalem "iMac11,1" -#define kDefaultiMacNehalemBIOSVersion " IM111.88Z.0034.B00.0903051113" +#define kDefaultiMacNehalem "iMac11,1" +#define kDefaultiMacNehalemBIOSVersion " IM111.88Z.0034.B00.0903051113" // defaults for an iMac12,1 -#define kDefaultiMacSandy "iMac12,1" -#define kDefaultiMacSandyBIOSVersion " IM121.88Z.0047.B00.1102091756" +#define kDefaultiMacSandy "iMac12,1" +#define kDefaultiMacSandyBIOSVersion " IM121.88Z.0047.B00.1102091756" // defaults for a Mac Pro -#define kDefaultMacProFamily "MacPro" -#define kDefaultMacPro "MacPro3,1" -#define kDefaultMacProBIOSVersion " MP31.88Z.006C.B05.0903051113" +#define kDefaultMacProFamily "MacPro" +#define kDefaultMacPro "MacPro3,1" +#define kDefaultMacProBIOSVersion " MP31.88Z.006C.B05.0903051113" // defaults for a Mac Pro 4,1 core i7/Xeon -#define kDefaultMacProNehalem "MacPro4,1" -#define kDefaultMacProNehalemBIOSVersion " MP41.88Z.0081.B04.0903051113" +#define kDefaultMacProNehalem "MacPro4,1" +#define kDefaultMacProNehalemBIOSVersion " MP41.88Z.0081.B04.0903051113" // defaults for a Mac Pro 5,1 core i7/Xeon -#define kDefaultMacProWestmere "MacPro5,1" -#define kDefaultMacProWestmereBIOSVersion " MP51.88Z.007F.B00.1008031144" -#define kDefaulMacProWestmereBIOSReleaseDate "08/03/10" +#define kDefaultMacProWestmere "MacPro5,1" +#define kDefaultMacProWestmereBIOSVersion " MP51.88Z.007F.B03.1010071432" +#define kDefaultMacProWestmereBIOSReleaseDate "10/07/2010" //------------------------------------------------------------------------------------------------------------------------- #define getFieldOffset(struct, field) ((uint8_t)(uint32_t)&(((struct *)0)->field)) -typedef struct { +typedef struct +{ SMBStructHeader *orig; SMBStructHeader *new; } SMBStructPtrs; -struct { +/* ======================= + BIOS Information (Type 0) + ========================= */ +typedef struct +{ char *vendor; char *version; char *releaseDate; -} defaultBIOSInfo; + uint16_t release; // Bungo +} defaultBIOSInfo_t; -struct { +defaultBIOSInfo_t defaultBIOSInfo; + +/* ========================= + System Information (Type 1) + =========================== */ +typedef struct +{ char *manufacturer; char *productName; char *version; char *serialNumber; + char *skuNumber; char *family; -} defaultSystemInfo; +} defaultSystemInfo_t; -struct { +defaultSystemInfo_t defaultSystemInfo; + +/* ========================================= + Base Board (or Module) Information (Type 2) + =========================================== */ +typedef struct +{ char *manufacturer; char *product; -} defaultBaseBoard; +} defaultBaseBoard_t; +defaultBaseBoard_t defaultBaseBoard; -typedef struct { +typedef struct +{ uint8_t type; - SMBValueType valueType; + SMBValueType valueType; uint8_t fieldOffset; char *keyString; bool (*getSMBValue)(returnType *); - char **defaultValue; + // Bungo + // char **defaultValue; + void *defaultValue; } SMBValueSetter; SMBValueSetter SMBSetters[] = { - //------------------------------------------------------------------------------------------------------------------------- - // BIOSInformation - //------------------------------------------------------------------------------------------------------------------------- - {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, vendor), kSMBBIOSInformationVendorKey, - NULL, &defaultBIOSInfo.vendor }, + /* ======================= + BIOS Information (Type 0) + ========================= */ + { kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, vendor), + kSMBBIOSInformationVendorKey, NULL, &defaultBIOSInfo.vendor }, // SMbiosvendor - Apple Inc. - {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, version), kSMBBIOSInformationVersionKey, - NULL, &defaultBIOSInfo.version }, + { kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, version), + kSMBBIOSInformationVersionKey, NULL, &defaultBIOSInfo.version }, // SMbiosversion - MP31.88Z.006C.B05.0802291410 - {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, releaseDate), kSMBBIOSInformationReleaseDateKey, - NULL, &defaultBIOSInfo.releaseDate }, + { kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, releaseDate), + kSMBBIOSInformationReleaseDateKey, NULL, &defaultBIOSInfo.releaseDate }, // SMbiosdate - 02/29/08 - //------------------------------------------------------------------------------------------------------------------------- - // SystemInformation - //------------------------------------------------------------------------------------------------------------------------- - {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, manufacturer), kSMBSystemInformationManufacturerKey, - NULL, &defaultSystemInfo.manufacturer }, + // Bungo + { kSMBTypeBIOSInformation, kSMBWord, getFieldOffset(SMBBIOSInformation, releaseMajor), + kSMBBIOSInformationReleaseKey, NULL, &defaultBIOSInfo.release }, // SMbiosrelease - 256 + // - {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, productName), kSMBSystemInformationProductNameKey, - NULL, &defaultSystemInfo.productName }, + /* ========================= + System Information (Type 1) + =========================== */ + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, manufacturer), + kSMBSystemInformationManufacturerKey, NULL, &defaultSystemInfo.manufacturer }, // SMmanufacturer - Apple Inc. - {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, version), kSMBSystemInformationVersionKey, - NULL, &defaultSystemInfo.version }, + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, productName), + kSMBSystemInformationProductNameKey, NULL, &defaultSystemInfo.productName }, // SMproductname - MacPro3,1 - {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, serialNumber), kSMBSystemInformationSerialNumberKey, - NULL, &defaultSystemInfo.serialNumber }, + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, version), + kSMBSystemInformationVersionKey, NULL, &defaultSystemInfo.version }, // SMsystemversion - 1.0 - {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, skuNumber), NULL, - NULL, NULL }, + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, serialNumber), + kSMBSystemInformationSerialNumberKey, NULL, &defaultSystemInfo.serialNumber }, // SMserial - Serial number - {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, family), kSMBSystemInformationFamilyKey, - NULL, &defaultSystemInfo.family }, + // Bungo + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, skuNumber), + kSMBSystemInformationSKUNumberKey, NULL, &defaultSystemInfo.skuNumber}, // SMskunumber - System SKU# + // - //------------------------------------------------------------------------------------------------------------------------- - // BaseBoard - //------------------------------------------------------------------------------------------------------------------------- - {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, manufacturer), kSMBBaseBoardManufacturerKey, - NULL, &defaultBaseBoard.manufacturer }, + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, family), + kSMBSystemInformationFamilyKey, NULL, &defaultSystemInfo.family}, // SMfamily - MacPro - {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, product), kSMBBaseBoardProductKey, - NULL, &defaultBaseBoard.product }, - {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, version), NULL, NULL, NULL}, + /* ========================================= + Base Board (or Module) Information (Type 2) + =========================================== */ + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, manufacturer), + kSMBBaseBoardManufacturerKey, NULL, &defaultBaseBoard.manufacturer }, // SMboardmanufacturer - Apple Inc. - {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, serialNumber), NULL, NULL, NULL}, + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, product), + kSMBBaseBoardProductKey, NULL, &defaultBaseBoard.product}, // SMboardproduct - Mac-F2268DC8 - {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, assetTagNumber), NULL, NULL, NULL}, + // Bungo + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, version), + kSMBBaseBoardVersionKey, NULL, NULL}, // SMboardproductname - MacPro3,1 - {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, locationInChassis), NULL, NULL, NULL}, + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, serialNumber), + kSMBBaseBoardSerialNumberKey, NULL, NULL}, // SMboardserial - C02140302D5DMT31M + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, assetTagNumber), kSMBBaseBoardAssetTagNumberKey, + NULL, NULL }, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, locationInChassis), kSMBBaseBoardLocationInChassisKey, + NULL, NULL }, + + {kSMBTypeBaseBoard, kSMBByte, getFieldOffset(SMBBaseBoard, boardType), kSMBBaseBoardTypeKey, + NULL, NULL }, + // Bungo + /* ======================= + System Enclosure (Type 3) + ========================= */ + {kSMBTypeSystemEnclosure, kSMBString, getFieldOffset(SMBSystemEnclosure, manufacturer), kSMBSystemEnclosureManufacturerKey, + NULL, &defaultBaseBoard.manufacturer }, - //------------------------------------------------------------------------------------------------------------------------- - // ProcessorInformation - //------------------------------------------------------------------------------------------------------------------------- - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, socketDesignation), NULL, NULL, NULL}, + {kSMBTypeSystemEnclosure, kSMBByte, getFieldOffset(SMBSystemEnclosure, type), kSMBSystemEnclosureTypeKey, + NULL, NULL }, - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, manufacturer), NULL, NULL, NULL}, + {kSMBTypeSystemEnclosure, kSMBString, getFieldOffset(SMBSystemEnclosure, version), kSMBSystemEnclosureVersionKey, + NULL, &defaultBaseBoard.product }, - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, processorVersion), NULL, NULL, NULL}, + {kSMBTypeSystemEnclosure, kSMBString, getFieldOffset(SMBSystemEnclosure, serialNumber), kSMBSystemEnclosureSerialNumberKey, + NULL, NULL }, - {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, externalClock), kSMBProcessorInformationExternalClockKey, - getProcessorInformationExternalClock, NULL}, + {kSMBTypeSystemEnclosure, kSMBString, getFieldOffset(SMBSystemEnclosure, assetTagNumber), kSMBSystemEnclosureAssetTagNumberKey, + NULL, NULL }, - {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, maximumClock), kSMBProcessorInformationMaximumClockKey, - getProcessorInformationMaximumClock, NULL}, + /* ============================ + Processor Information (Type 4) + ============================== */ + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, socketDesignation), + kSMBProcessorInformationSocketKey, NULL, NULL}, // SMcpusocket - - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, serialNumber), NULL, NULL, NULL}, + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, manufacturer), + kSMBProcessorInformationManufacturerKey, NULL, NULL}, // SMcpumanufacturer - Intel(R) Corporation - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, assetTag), NULL, NULL, NULL}, + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, processorVersion), + kSMBProcessorInformationVersionKey, NULL, NULL}, // SMcpuversion - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, partNumber), NULL, NULL, NULL}, + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, externalClock), + kSMBProcessorInformationExternalClockKey, getProcessorInformationExternalClock, NULL}, // SMcpuexternalclock - //------------------------------------------------------------------------------------------------------------------------- - // Memory Device - //------------------------------------------------------------------------------------------------------------------------- - {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, deviceLocator), kSMBMemoryDeviceDeviceLocatorKey, - NULL, NULL}, + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, maximumClock), + kSMBProcessorInformationMaximumClockKey, getProcessorInformationMaximumClock, NULL}, // SMcpumaxspeed - {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, bankLocator), kSMBMemoryDeviceBankLocatorKey, - NULL, NULL}, + // Bungo + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, currentClock), + kSMBProcessorInformationCurrentClockKey, NULL, NULL}, // SMcpucurrentspeed - {kSMBTypeMemoryDevice, kSMBByte, getFieldOffset(SMBMemoryDevice, memoryType), kSMBMemoryDeviceMemoryTypeKey, - getSMBMemoryDeviceMemoryType, NULL}, + {kSMBTypeProcessorInformation, kSMBByte, getFieldOffset(SMBProcessorInformation, processorUpgrade), + kSMBProcessorInformationUpgradeKey, NULL, NULL}, // SMcpuupgrade + // - {kSMBTypeMemoryDevice, kSMBWord, getFieldOffset(SMBMemoryDevice, memorySpeed), kSMBMemoryDeviceMemorySpeedKey, - getSMBMemoryDeviceMemorySpeed, NULL}, + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, serialNumber), + NULL, NULL, NULL}, - {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, manufacturer), kSMBMemoryDeviceManufacturerKey, - getSMBMemoryDeviceManufacturer, NULL}, + // Bungo + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, assetTag), + kSMBProcessorInformationAssetTagNumberKey, NULL, NULL}, // SMcpuassettag - {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, serialNumber), kSMBMemoryDeviceSerialNumberKey, - getSMBMemoryDeviceSerialNumber, NULL}, + // - {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, assetTag), NULL, NULL, NULL}, + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, partNumber), + NULL, NULL, NULL}, - {kSMBTypeMemoryDevice, kSMBWord, getFieldOffset(SMBMemoryDevice, errorHandle), NULL, getSMBMemoryDeviceMemoryErrorHandle, NULL}, + /* ===================== + Memory Device (Type 17) + ======================= */ + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, deviceLocator), + kSMBMemoryDeviceDeviceLocatorKey, NULL, NULL}, - {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, partNumber), kSMBMemoryDevicePartNumberKey, - getSMBMemoryDevicePartNumber, NULL}, + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, bankLocator), + kSMBMemoryDeviceBankLocatorKey, NULL, NULL}, + {kSMBTypeMemoryDevice, kSMBByte, getFieldOffset(SMBMemoryDevice, memoryType), + kSMBMemoryDeviceMemoryTypeKey, getSMBMemoryDeviceMemoryType, NULL}, + {kSMBTypeMemoryDevice, kSMBWord, getFieldOffset(SMBMemoryDevice, memorySpeed), + kSMBMemoryDeviceMemorySpeedKey, getSMBMemoryDeviceMemorySpeed, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, manufacturer), + kSMBMemoryDeviceManufacturerKey, getSMBMemoryDeviceManufacturer, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, serialNumber), + kSMBMemoryDeviceSerialNumberKey, getSMBMemoryDeviceSerialNumber, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, assetTag), + NULL, NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBWord, getFieldOffset(SMBMemoryDevice, errorHandle), + NULL, getSMBMemoryDeviceMemoryErrorHandle, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, partNumber), + kSMBMemoryDevicePartNumberKey, getSMBMemoryDevicePartNumber, NULL}, + // + //------------------------------------------------------------------------------------------------------------------------- // Apple Specific //------------------------------------------------------------------------------------------------------------------------- + // OEM Processor Type (Apple Specific - Type 131) {kSMBTypeOemProcessorType, kSMBWord, getFieldOffset(SMBOemProcessorType, ProcessorType), kSMBOemProcessorTypeKey, getSMBOemProcessorType, NULL}, + // OEM Processor Bus Speed (Apple Specific - Type 132) {kSMBTypeOemProcessorBusSpeed, kSMBWord, getFieldOffset(SMBOemProcessorBusSpeed, ProcessorBusSpeed), kSMBOemProcessorBusSpeedKey, getSMBOemProcessorBusSpeed, NULL} }; @@ -271,24 +416,29 @@ static uint8_t stringIndex; // increament when a string is added and set the field value accordingly static uint8_t stringsSize; // add string size -static SMBWord tableLength = 0; -static SMBWord handle = 0; +static SMBWord tableLength = 0; +static SMBWord handle = 0; static SMBWord maxStructSize = 0; static SMBWord structureCount = 0; +bool useSMBIOSdefaults = true; // Bungo + /* Rewrite this function */ void setDefaultSMBData(void) { - defaultBIOSInfo.vendor = kDefaultVendorManufacturer; - defaultBIOSInfo.releaseDate = kDefaultBIOSReleaseDate; + defaultBIOSInfo.vendor = kDefaultVendorManufacturer; + defaultBIOSInfo.releaseDate = kDefaultBIOSReleaseDate; - defaultSystemInfo.manufacturer = kDefaultVendorManufacturer; - defaultSystemInfo.version = kDefaultSystemVersion; - defaultSystemInfo.serialNumber = kDefaultSerialNumber; + defaultBIOSInfo.release = kDefaultBIOSRelease; // Bungo - defaultBaseBoard.manufacturer = kDefaultVendorManufacturer; - defaultBaseBoard.product = kDefaultBoardProduct; + defaultSystemInfo.manufacturer = kDefaultVendorManufacturer; + defaultSystemInfo.version = kDefaultSystemVersion; + defaultSystemInfo.serialNumber = kDefaultSerialNumber; + defaultSystemInfo.skuNumber = kDefaultskuNumber; // Bungo + defaultBaseBoard.manufacturer = kDefaultVendorManufacturer; + defaultBaseBoard.product = kDefaultBoardProduct; + if (platformCPUFeature(CPU_FEATURE_MOBILE)) { if (Platform.CPU.NoCores > 1) @@ -306,22 +456,22 @@ } else { - switch (Platform.CPU.NoCores) + switch (Platform.CPU.NoCores) { - case 1: + case 1: defaultBIOSInfo.version = kDefaultMacminiBIOSVersion; - defaultSystemInfo.productName = kDefaultMacmini; + defaultSystemInfo.productName = kDefaultMacmini; defaultSystemInfo.family = kDefaultMacminiFamily; break; case 2: defaultBIOSInfo.version = kDefaultiMacBIOSVersion; - defaultSystemInfo.productName = kDefaultiMac; + defaultSystemInfo.productName = kDefaultiMac; defaultSystemInfo.family = kDefaultiMacFamily; break; default: { - switch (Platform.CPU.Family) + switch (Platform.CPU.Family) { case 0x06: { @@ -352,7 +502,7 @@ case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) defaultBIOSInfo.version = kDefaultMacProWestmereBIOSVersion; - defaultBIOSInfo.releaseDate = kDefaulMacProWestmereBIOSReleaseDate; + defaultBIOSInfo.releaseDate = kDefaultMacProWestmereBIOSReleaseDate; defaultSystemInfo.productName = kDefaultMacProWestmere; defaultSystemInfo.family = kDefaultMacProFamily; break; @@ -366,9 +516,9 @@ break; } default: - defaultBIOSInfo.version = kDefaultMacProBIOSVersion; + defaultBIOSInfo.version = kDefaultMacProBIOSVersion; defaultSystemInfo.productName = kDefaultMacPro; - defaultSystemInfo.family = kDefaultMacProFamily; + defaultSystemInfo.family = kDefaultMacProFamily; break; } break; @@ -391,19 +541,22 @@ current = structHeader->handle; } - sprintf(key, "%s%d", keyString, idx); - - if (value) - { - if (getIntForKey(key, (int *)&(value->dword), SMBPlist)) - return true; - } - else - { - if (getValueForKey(key, string, &len, SMBPlist)) - return true; - } - + sprintf(key, "%s%d", keyString, idx); + + if (value) + { + if (getIntForKey(key, (int *)&(value->dword), SMBPlist)) + { + return true; + } + } + else + { + if (getValueForKey(key, string, &len, SMBPlist)) + { + return true; + } + } return false; } @@ -412,9 +565,11 @@ uint8_t *stringPtr = (uint8_t *)structHeader + structHeader->length; if (!field) + { return NULL; + } - for (field--; field != 0 && strlen((char *)stringPtr) > 0; + for (field--; field != 0 && strlen((char *)stringPtr) > 0; field--, stringPtr = (uint8_t *)((uint32_t)stringPtr + strlen((char *)stringPtr) + 1)); return (char *)stringPtr; @@ -425,7 +580,10 @@ int strSize; if (!field) + { return; + } + if (!string) { *field = 0; @@ -436,7 +594,9 @@ // remove any spaces found at the end while ((strSize != 0) && (string[strSize - 1] == ' ')) + { strSize--; + } if (strSize == 0) { @@ -459,31 +619,49 @@ int val; if (numOfSetters <= idx) + { return false; + } switch (SMBSetters[idx].valueType) { case kSMBString: + { if (SMBSetters[idx].keyString) { if (getValueForKey(SMBSetters[idx].keyString, &string, &len, SMBPlist)) + { break; + } else + { if (structPtr->orig->type == kSMBTypeMemoryDevice) // MemoryDevice only + { if (getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, &string, NULL)) + { break; + } + } + } + } if (SMBSetters[idx].getSMBValue) + { if (SMBSetters[idx].getSMBValue((returnType *)&string)) + { break; - if ((SMBSetters[idx].defaultValue) && *(SMBSetters[idx].defaultValue)) + // if ((SMBSetters[idx].defaultValue) && *(SMBSetters[idx].defaultValue)) Bungo + } + } + if (useSMBIOSdefaults && (SMBSetters[idx].defaultValue) && *(char *)(SMBSetters[idx].defaultValue)) { - string = *(SMBSetters[idx].defaultValue); + // string = *(SMBSetters[idx].defaultValue); Bungo + string = (char *)(SMBSetters[idx].defaultValue); break; } string = getSMBStringForField(structPtr->orig, *(uint8_t *)value); break; - + } case kSMBByte: case kSMBWord: case kSMBDWord: @@ -492,8 +670,12 @@ { parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist); if (!parsed) + { if (structPtr->orig->type == kSMBTypeMemoryDevice) // MemoryDevice only + { parsed = getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, NULL, (returnType *)&val); + } + } if (parsed) { switch (SMBSetters[idx].valueType) @@ -514,21 +696,41 @@ } if (SMBSetters[idx].getSMBValue) + { if (SMBSetters[idx].getSMBValue(value)) + { return true; -#if 0 - if (*(SMBSetters[idx].defaultValue)) + } + } +// #if 0 Bungo: enables code below + // if (*(SMBSetters[idx].defaultValue)) Bungo + if (useSMBIOSdefaults && (SMBSetters[idx].defaultValue)) { - value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue); - return true; + // value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue); Bungo + switch (SMBSetters[idx].valueType) + { + case kSMBByte: + value->byte = *(uint8_t *)(SMBSetters[idx].defaultValue); + break; + case kSMBWord: + value->word = *(uint16_t *)(SMBSetters[idx].defaultValue); + break; + case kSMBDWord: + default: + value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue); + break; + } + return true; } -#endif +// #endif Bungo break; } - if (SMBSetters[idx].valueType == kSMBString && string) + // if (SMBSetters[idx].valueType == kSMBString && string) Bungo: use null string too -> "Not Specified" + if (SMBSetters[idx].valueType == kSMBString) + { setSMBStringForField(structPtr->new, string, &value->byte); - + } return true; } @@ -629,7 +831,7 @@ SMBWord structSize; int i; - /* http://forge.voodooprojects.org/p/chameleon/issues/361/ */ + /* http://forge.voodooprojects.org/p/chameleon/issues/361/ */ bool forceFullMemInfo = false; if (structPtr->orig->type == kSMBTypeMemoryDevice) @@ -645,16 +847,20 @@ stringsSize = 0; if (handle < structPtr->orig->handle) + { handle = structPtr->orig->handle; + } memcpy((void *)structPtr->new, structPtr->orig, structPtr->orig->length); for (i = 0; i < numOfSetters; i++) + { if ((structPtr->orig->type == SMBSetters[i].type) && (SMBSetters[i].fieldOffset < structPtr->orig->length)) { setterFound = true; setSMBValue(structPtr, i, (returnType *)((uint8_t *)structPtr->new + SMBSetters[i].fieldOffset)); } + } if (setterFound) { @@ -662,8 +868,9 @@ for (; ((uint16_t *)ptr)[0] != 0; ptr++); if (((uint16_t *)ptr)[0] == 0) + { ptr += 2; - + } structSize = ptr - (uint8_t *)structPtr->new; } else @@ -672,7 +879,9 @@ for (; ((uint16_t *)ptr)[0] != 0; ptr++); if (((uint16_t *)ptr)[0] == 0) + { ptr += 2; + } structSize = ptr - (uint8_t *)structPtr->orig; memcpy((void *)structPtr->new, structPtr->orig, structSize); @@ -683,7 +892,9 @@ tableLength += structSize; if (structSize > maxStructSize) + { maxStructSize = structSize; + } structureCount++; } @@ -707,16 +918,20 @@ break; default: + { /* Add */ setSMBStruct(structPtr); break; + } } ptr = (uint8_t *)((uint32_t)structPtr->orig + structPtr->orig->length); for (; ((uint16_t *)ptr)[0] != 0; ptr++); if (((uint16_t *)ptr)[0] == 0) + { ptr += 2; + } structPtr->orig = (SMBStructHeader *)ptr; } @@ -729,37 +944,104 @@ addSMBEndOfTable(structPtr); } +// Bungo: does fix system uuid in SMBIOS istead of in EFI only +uint8_t *FixSystemUUID() +{ + uint8_t *ptr = (uint8_t *)neweps->dmi.tableAddress; + SMBStructHeader *structHeader = (SMBStructHeader *)ptr; + int i, isZero, isOnes; + uint8_t FixedUUID[UUID_LEN] = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; + const char *sysId = getStringForKey(kSMBSystemInformationUUIDKey, SMBPlist); + uint8_t *ret = (uint8_t *)getUUIDFromString(sysId); + + for (;(structHeader->type != kSMBTypeSystemInformation);) // find System Information Table (Type 1) in patched SMBIOS + { + ptr = (uint8_t *)((uint32_t)structHeader + structHeader->length); + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + { + ptr += 2; + } + + structHeader = (SMBStructHeader *)ptr; + } + + ptr = ((SMBSystemInformation *)structHeader)->uuid; + + if (!sysId || !ret) // no or bad custom UUID,... + { + sysId = 0; + ret = ((SMBSystemInformation *)structHeader)->uuid; // ...try bios dmi info UUID extraction + } + + for (i=0, isZero=1, isOnes=1; inew = (SMBStructHeader *)buffer; - getBoolForKey(kSMBIOSdefaults, &setSMB, &bootInfo->chameleonConfig); - if (setSMB) - setDefaultSMBData(); - + // getBoolForKey(kSMBIOSdefaults, &setSMB, &bootInfo->chameleonConfig); Bungo + getBoolForKey(kSMBIOSdefaults, &useSMBIOSdefaults, &bootInfo->chameleonConfig); + // if (setSMB) + setDefaultSMBData(); + // Bungo + setupNewSMBIOSTable(origeps, structPtr); neweps = (SMBEntryPoint *)AllocateKernelMemory(sizeof(SMBEntryPoint)); if (!neweps) + { + free(buffer); + free(structPtr); return; + } bzero(neweps, sizeof(SMBEntryPoint)); neweps->anchor[0] = '_'; @@ -783,17 +1065,26 @@ neweps->dmi.bcdRevision = 0x24; if (!neweps->dmi.tableAddress) + { + free(buffer); + free(structPtr); return; + } memcpy((void *)neweps->dmi.tableAddress, buffer, tableLength); + // Bungo + Platform.UUID = FixSystemUUID(); // Fix System UUID + neweps->dmi.checksum = 0; neweps->dmi.checksum = 0x100 - checksum8(&neweps->dmi, sizeof(DMIEntryPoint)); - neweps->checksum = 0; - neweps->checksum = 0x100 - checksum8(neweps, sizeof(SMBEntryPoint)); + neweps->checksum = 0; + neweps->checksum = 0x100 - checksum8(neweps, sizeof(SMBEntryPoint)); free(buffer); + free(structPtr); + decodeSMBIOSTable(neweps); } @@ -803,7 +1094,9 @@ { case SMBIOS_ORIGINAL: if (!origeps) + { origeps = getAddressOfSmbiosTable(); + } return origeps; case SMBIOS_PATCHED: return neweps; @@ -819,17 +1112,19 @@ SMBStructHeader *structHeader = (SMBStructHeader *)structPtr; int dimmnbr = 0; - Platform.DMI.MaxMemorySlots = 0; - Platform.DMI.CntMemorySlots = 0; + Platform.DMI.MaxMemorySlots = 0; // number of memory slots polulated by SMBIOS + Platform.DMI.CntMemorySlots = 0; // number of memory slots counted Platform.DMI.MemoryModules = 0; for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structHeader + sizeof(SMBStructHeader)));) { switch (structHeader->type) { + /* Bungo case kSMBTypeSystemInformation: Platform.UUID = ((SMBSystemInformation *)structHeader)->uuid; break; + */ case kSMBTypePhysicalMemoryArray: Platform.DMI.MaxMemorySlots += ((SMBPhysicalMemoryArray *)structHeader)->numMemoryDevices; @@ -838,20 +1133,27 @@ case kSMBTypeMemoryDevice: Platform.DMI.CntMemorySlots++; if (((SMBMemoryDevice *)structHeader)->memorySize != 0) + { Platform.DMI.MemoryModules++; + } if (((SMBMemoryDevice *)structHeader)->memorySpeed > 0) + { Platform.RAM.DIMM[dimmnbr].Frequency = ((SMBMemoryDevice *)structHeader)->memorySpeed; + } dimmnbr++; break; + default: + break; } structPtr = (uint8_t *)((uint32_t)structHeader + structHeader->length); for (; ((uint16_t *)structPtr)[0] != 0; structPtr++); if (((uint16_t *)structPtr)[0] == 0) + { structPtr += 2; + } structHeader = (SMBStructHeader *)structPtr; } } - Index: trunk/i386/libsaio/smbios.h =================================================================== --- trunk/i386/libsaio/smbios.h (revision 2283) +++ trunk/i386/libsaio/smbios.h (revision 2284) @@ -118,6 +118,13 @@ SMBString releaseDate; // BIOS release date SMBByte romSize; // (n); 64K * (n+1) bytes SMBQWord characteristics; // supported BIOS functions + // Bungo + SMBByte characteristicsExt1; // BIOS characteristics extension byte 1 + SMBByte characteristicsExt2; // BIOS characteristics extension byte 2 + SMBByte releaseMajor; // BIOS release (major) + SMBByte releaseMinor; // BIOS release (minor) + SMBByte ECreleaseMajor; // Embedded Controller firmware release (major) + SMBByte ECreleaseMinor; // Embedded Controller firmware release (minor) } __attribute__((packed)) SMBBIOSInformation; // Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 2283) +++ trunk/i386/libsaio/fake_efi.c (revision 2284) @@ -76,8 +76,10 @@ static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','2', 0}; static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */ -/* Default platform system_id (fix by IntVar) */ -static EFI_CHAR8 const SYSTEM_ID[] = "0123456789ABCDEF"; //random value gen by uuidgen +// Bungo +/* Default platform system_id (fix by IntVar) + static EFI_CHAR8 const SYSTEM_ID[] = "0123456789ABCDEF"; //random value gen by uuidgen + */ /* Just a ret instruction */ static uint8_t const VOIDRET_INSTRUCTIONS[] = {0xc3}; @@ -463,13 +465,14 @@ dst[i] = src[i]; } dst[(*len)] = '\0'; - *len = ((*len)+1)*2; // return the CHAR16 bufsize in cluding zero terminated CHAR16 + *len = ((*len)+1)*2; // return the CHAR16 bufsize including zero terminated CHAR16 return dst; } +// Bungo /* * Get the SystemID from the bios dmi info - */ + static EFI_CHAR8* getSmbiosUUID() { static EFI_CHAR8 uuid[UUID_LEN]; @@ -501,10 +504,10 @@ return uuid; } -/* - * return a binary UUID value from the overriden SystemID and SMUUID if found, - * or from the bios if not, or from a fixed value if no bios value is found - */ + +// return a binary UUID value from the overriden SystemID and SMUUID if found, +// or from the bios if not, or from a fixed value if no bios value is found + static EFI_CHAR8* getSystemID() { // unable to determine UUID for host. Error: 35 fix @@ -527,6 +530,7 @@ verbose("Customizing SystemID with : %s\n", getStringFromUUID(ret)); // apply a nice formatting to the displayed output return ret; } + */ /* * Must be called AFTER setup Acpi because we need to take care of correct @@ -546,7 +550,8 @@ void setupEfiDeviceTree(void) { - EFI_CHAR8* ret = 0; + // Bungo + // EFI_CHAR8* ret = 0; EFI_CHAR16* ret16 = 0; size_t len = 0; Node *node; @@ -622,12 +627,20 @@ DT__AddProperty(efiPlatformNode, CPU_Frequency_prop, sizeof(uint64_t), &Platform.CPU.CPUFrequency); } - // Export system-id. Can be disabled with SystemId=No in com.apple.Boot.plist + // Bungo + /* Export system-id. Can be disabled with SystemId=No in com.apple.Boot.plist if ((ret=getSystemID())) { DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, (EFI_UINT32*) ret); } + */ + if (Platform.UUID) + { + DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, Platform.UUID); + } + // + // Export SystemSerialNumber if present if ((ret16=getSmbiosChar16("SMserial", &len))) {