Index: branches/ErmaC/Trunk/Chameleon.xcodeproj/project.pbxproj =================================================================== --- branches/ErmaC/Trunk/Chameleon.xcodeproj/project.pbxproj (revision 2059) +++ branches/ErmaC/Trunk/Chameleon.xcodeproj/project.pbxproj (revision 2060) @@ -99,6 +99,7 @@ 36AB75E814BD095E005B8045 /* PowerManagement.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = PowerManagement.txt; path = OptionalSettings/PowerManagement.txt; sourceTree = ""; }; 36AB75E914BD095E005B8045 /* Resolution.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Resolution.txt; path = OptionalSettings/Resolution.txt; sourceTree = ""; }; 36AB75EA14BD095E005B8045 /* Video.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Video.txt; path = OptionalSettings/Video.txt; sourceTree = ""; }; + 36B0F58515FD7E95009E3EF4 /* bootargs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bootargs.h; sourceTree = ""; }; 65ED53931204B83200B22507 /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; 6DBAFD1313B0D21E0047ED33 /* modules_support.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = modules_support.s; sourceTree = ""; }; 6DBAFD1413B0D21E0047ED33 /* modules.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = modules.c; sourceTree = ""; }; @@ -1463,10 +1464,6 @@ B45260B4153EFCF60018E994 /* po4a-chameleon.cfg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-chameleon.cfg"; sourceTree = ""; }; B484E1CD15E19F08005E977B /* ld_classic */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = ld_classic; sourceTree = ""; }; B484E1CE15E19F08005E977B /* ld_classic.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = ld_classic.1; sourceTree = ""; }; - B484E1E415E19F85005E977B /* Cconfig */ = {isa = PBXFileReference; lastKnownFileType = text; name = Cconfig; path = md/Cconfig; sourceTree = ""; }; - B484E1E515E19F85005E977B /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = md/Makefile; sourceTree = ""; }; - B484E1E615E19F85005E977B /* md.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; name = md.1; path = md/md.1; sourceTree = ""; }; - B484E1E715E19F85005E977B /* md.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = md.c; path = md/md.c; sourceTree = ""; }; B49234A91571906A00F168C2 /* freebsd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = freebsd.c; sourceTree = ""; }; B49234AA1571906A00F168C2 /* freebsd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = freebsd.h; sourceTree = ""; }; B49234AB1571906A00F168C2 /* gma.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gma.c; sourceTree = ""; }; @@ -3228,7 +3225,6 @@ B0056D1611F3868000754B65 /* libsa */, B0056D2411F3868000754B65 /* libsaio */, B0056D7611F3868000754B65 /* Makefile */, - B484E1E315E19F6E005E977B /* md */, A3561CAB1414024C00E9B51E /* modules */, B0056D7911F3868000754B65 /* util */, ); @@ -3358,6 +3354,7 @@ B0056D2C11F3868000754B65 /* bios.h */, B0056D2D11F3868000754B65 /* bios.s */, B0056D2E11F3868000754B65 /* biosfn.c */, + 36B0F58515FD7E95009E3EF4 /* bootargs.h */, B0056D2F11F3868000754B65 /* bootstruct.c */, B0056D3011F3868000754B65 /* bootstruct.h */, B0056D3111F3868000754B65 /* cache.c */, @@ -3852,17 +3849,6 @@ path = bin; sourceTree = ""; }; - B484E1E315E19F6E005E977B /* md */ = { - isa = PBXGroup; - children = ( - B484E1E415E19F85005E977B /* Cconfig */, - B484E1E515E19F85005E977B /* Makefile */, - B484E1E615E19F85005E977B /* md.1 */, - B484E1E715E19F85005E977B /* md.c */, - ); - name = md; - sourceTree = ""; - }; B4AABE5814C3B8B90055ECD1 /* AddOption */ = { isa = PBXGroup; children = ( @@ -4292,7 +4278,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0440; }; buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */; compatibilityVersion = "Xcode 3.2"; @@ -5106,6 +5092,7 @@ 1DEB919008733D9F0010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; GCC_DYNAMIC_NO_PIC = NO; @@ -5120,6 +5107,7 @@ 1DEB919108733D9F0010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; Index: branches/ErmaC/Trunk/i386/libsaio/xml.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/xml.c (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/xml.c (revision 2060) @@ -270,7 +270,7 @@ int i; s++; - for ( i = 0; i < sizeof(ents); i++) + for ( i = 0; i < sizeof(ents)/sizeof(ents[0]); i++) { if ( strncmp(s, ents[i].name, ents[i].nameLen) == 0 ) { Index: branches/ErmaC/Trunk/i386/libsaio/bootstruct.h =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/bootstruct.h (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/bootstruct.h (revision 2060) @@ -42,7 +42,6 @@ //#define FB_TEXT_MODE 2 - /* * Maximum number of boot drivers that can be loaded. */ Index: branches/ErmaC/Trunk/i386/libsaio/bootargs.h =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/bootargs.h (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/bootargs.h (revision 2060) @@ -1,7 +1,6 @@ /* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License @@ -23,7 +22,6 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _PEXPERT_I386_BOOT_H #define _PEXPERT_I386_BOOT_H @@ -45,8 +43,8 @@ enum { kEfiReservedMemoryType = 0, - kEfiLoaderCode = 1, - kEfiLoaderData = 2, + kEfiLoaderCode = 1, + kEfiLoaderData = 2, kEfiBootServicesCode = 3, kEfiBootServicesData = 4, kEfiRuntimeServicesCode = 5, @@ -57,7 +55,7 @@ kEfiACPIMemoryNVS = 10, kEfiMemoryMappedIO = 11, kEfiMemoryMappedIOPortSpace = 12, - kEfiPalCode = 13, + kEfiPalCode = 13, kEfiMaxMemoryType = 14 }; @@ -80,7 +78,8 @@ * Video information.. */ -struct Boot_Video { +struct Boot_Video +{ uint32_t v_baseAddr; /* Base address of video memory */ uint32_t v_display; /* Display Code (if Applicable */ uint32_t v_rowBytes; /* Number of bytes per pixel row */ @@ -93,15 +92,15 @@ /* Values for v_display */ -#define GRAPHICS_MODE 1 -#define FB_TEXT_MODE 2 +#define GRAPHICS_MODE 1 +#define FB_TEXT_MODE 2 /* Boot argument structure - passed into Mach kernel at boot time. * "Revision" can be incremented for compatible changes */ // Lion -#define kBootArgsRevision 0 -#define kBootArgsVersion 2 +#define kBootArgsRevision 0 +#define kBootArgsVersion 2 // Snow Leopard and older #define kBootArgsPreLionRevision 6 @@ -109,85 +108,92 @@ /* Snapshot constants of previous revisions that are supported */ -#define kBootArgsEfiMode32 32 -#define kBootArgsEfiMode64 64 +#define kBootArgsEfiMode32 32 +#define kBootArgsEfiMode64 64 -typedef struct boot_args { +typedef struct boot_args_pre_lion +{ uint16_t Revision; /* Revision of boot_args structure */ uint16_t Version; /* Version of boot_args structure */ - - uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ - uint8_t debugMode; /* Bit field with behavior changes */ - uint8_t __reserved1[2]; - + char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */ - + uint32_t MemoryMap; /* Physical address of memory map */ uint32_t MemoryMapSize; uint32_t MemoryMapDescriptorSize; uint32_t MemoryMapDescriptorVersion; - + Boot_Video Video; /* Video Information */ - + uint32_t deviceTreeP; /* Physical address of flattened device tree */ uint32_t deviceTreeLength; /* Length of flattened tree */ - + uint32_t kaddr; /* Physical address of beginning of kernel text */ uint32_t ksize; /* Size of combined kernel text+data+efi */ - + uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */ uint32_t efiRuntimeServicesPageCount; - uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ - + uint32_t efiSystemTable; /* physical address of system table in runtime area */ - uint32_t __reserved2; - + + uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ + uint8_t __reserved1[3]; + uint32_t __reserved2[1]; uint32_t performanceDataStart; /* physical address of log */ uint32_t performanceDataSize; - - uint32_t keyStoreDataStart; /* physical address of key store data */ - uint32_t keyStoreDataSize; - uint64_t bootMemStart; - uint64_t bootMemSize; - uint64_t PhysicalMemorySize; - uint64_t FSBFrequency; - uint32_t __reserved4[734]; - -} boot_args; + uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ + uint32_t __reserved3[2]; -typedef struct boot_args_pre_lion { +} boot_args_pre_lion; + +/* Bitfields for boot_args->flags */ +#define kBootArgsFlagRebootOnPanic (1 << 0) +#define kBootArgsFlagHiDPI (1 << 1) + +typedef struct boot_args +{ uint16_t Revision; /* Revision of boot_args structure */ uint16_t Version; /* Version of boot_args structure */ - + + uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ + uint8_t debugMode; /* Bit field with behavior changes */ + uint16_t flags; + char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */ - + uint32_t MemoryMap; /* Physical address of memory map */ uint32_t MemoryMapSize; uint32_t MemoryMapDescriptorSize; uint32_t MemoryMapDescriptorVersion; - + Boot_Video Video; /* Video Information */ - + uint32_t deviceTreeP; /* Physical address of flattened device tree */ uint32_t deviceTreeLength; /* Length of flattened tree */ - + uint32_t kaddr; /* Physical address of beginning of kernel text */ uint32_t ksize; /* Size of combined kernel text+data+efi */ - + uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */ uint32_t efiRuntimeServicesPageCount; + uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ + uint32_t efiSystemTable; /* physical address of system table in runtime area */ - - uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ - uint8_t __reserved1[3]; - uint32_t __reserved2[1]; + uint8_t __reserved1[2]; + uint32_t __reserved2; uint32_t performanceDataStart; /* physical address of log */ uint32_t performanceDataSize; - uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ - uint32_t __reserved3[2]; - -} boot_args_pre_lion; + uint32_t keyStoreDataStart; /* physical address of key store data */ + uint32_t keyStoreDataSize; + uint64_t bootMemStart; + uint64_t bootMemSize; + uint64_t PhysicalMemorySize; + uint64_t FSBFrequency; + uint32_t __reserved4[734]; + +} boot_args; + extern char gMacOSVersion[8]; #endif /* _PEXPERT_I386_BOOT_H */ Index: branches/ErmaC/Trunk/i386/libsaio/spd.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/spd.c (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/spd.c (revision 2060) @@ -287,8 +287,8 @@ /* Read from smbus the SPD content and interpret it for detecting memory attributes */ static void read_smb_intel(pci_dt_t *smbus_dev) { - int i, speed; - uint8_t spd_size, spd_type; + uint16_t speed; + uint8_t i, spd_size, spd_type; uint32_t base, mmio, hostc; // bool dump = false; RamSlotInfo_t* slot; Index: branches/ErmaC/Trunk/i386/libsaio/device_inject.h =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/device_inject.h (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/device_inject.h (revision 2060) @@ -47,9 +47,9 @@ { uint32_t length; uint16_t numentries; - uint16_t WHAT2; // 0x0000 ? + uint16_t WHAT2; // 0x0000 ? struct ACPIDevPath acpi_dev_path; // = 0x02010c00 0xd041030a - struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS]; // = 0x01010600 func dev + struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS]; // = 0x01010600 func dev struct DevicePathEnd path_end; // = 0x7fff0400 uint8_t *data; Index: branches/ErmaC/Trunk/i386/libsaio/nvidia.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/nvidia.c (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/nvidia.c (revision 2060) @@ -1547,16 +1547,25 @@ { 0x10DE1180, 0x104383F7, "Asus GTX 680 Direct CU II" }, { 0x10DE1180, 0x10DE0969, "nVidia GTX 680" }, { 0x10DE1180, 0x10DE097A, "nVidia GeForce GTX 680" }, - { 0x10DE1180, 0x118010B0, "Gainward GTX 680" }, + { 0x10DE1180, 0x10B01180, "Gainward GTX 680" }, { 0x10DE1180, 0x1458353C, "GV-N680OC-2GD WindForce GTX 680 OC" }, + { 0x10DE1180, 0x14622820, "MSi N680GTX TwinFrozer" }, { 0x10DE1180, 0x14622830, "MSi GTX 680 Lightning" }, + { 0x10DE1180, 0x14622831, "MSi GTX 680 Lightning LN2" }, { 0x10DE1180, 0x15691180, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x15691181, "Palit GTX 680 JetStream" }, { 0x10DE1180, 0x15691189, "Palit GTX 680 JetStream" }, { 0x10DE1180, 0x174B1255, "PC Partner GeForce GTX 680" }, + { 0x10DE1180, 0x196E0969, "PNY GTX 680" }, { 0x10DE1180, 0x19DA1255, "Zotac GTX 680" }, + { 0x10DE1180, 0x19DA1260, "Zotac GTX680" }, + { 0x10DE1180, 0x1ACC684A, "Point of View GTX 680" }, { 0x10DE1180, 0x38421582, "EVGA GTX 680" }, { 0x10DE1180, 0x38422680, "EVGA GTX 680" }, { 0x10DE1180, 0x38422682, "EVGA GTX 680 SC" }, + { 0x10DE1180, 0x38422683, "EVGA GTX 680 SC" }, + { 0x10DE1180, 0x38422686, "EVGA GTX 680" }, + { 0x10DE1180, 0x38422689, "EVGA GTX 680" }, { 0x10DE1183, 0x10DE1000, "nVidia GTX 660 Ti" }, { 0x10DE1183, 0x14622843, "MSi GTX 660 Ti" }, @@ -1580,6 +1589,17 @@ // 1190 - 119F // 11A0 - 11AF // 11B0 - 11BF + { 0x10DE11BC, 0x1028053F, "Dell Quadro K5000M" }, + { 0x10DE11BC, 0x1028153F, "Dell Quadro K5000M" }, + { 0x10DE11BC, 0x10CF1762, "Fujitsu Quadro K5000M" }, + { 0x10DE11BC, 0x15580270, "Clevo Quadro K5000M" }, + { 0x10DE11BC, 0x15580371, "Clevo Quadro K5000M" }, + + { 0x10DE11BD, 0x10CF1761, "Fujitsu Quadro K4000M" }, + + { 0x10DE11BE, 0x10CF1760, "Fujitsu Quadro K3000M" }, + { 0x10DE11BE, 0x15585105, "Clevo Quadro K3000M" }, + { 0x10DE11BE, 0x15587102, "Clevo Quadro K3000M" }, // 11C0 - 11CF // 11D0 - 11DF // 11E0 - 11EF @@ -1602,6 +1622,8 @@ { 0x10DE1206, 0x10DE0958, "nVidia GeForce GTX 555" }, + { 0x10DE1207, 0x174B0645, "PC Partner GeForce GT 645" }, + { 0x10DE1210, 0x10431487, "Asus GeForce GTX 570M" }, { 0x10DE1210, 0x10432104, "Asus GeForce GTX 570M" }, { 0x10DE1210, 0x1179FB12, "Toshiba GeForce GTX 570M" }, @@ -2811,7 +2833,7 @@ int has_lvds = false; uint8_t channel1 = 0, channel2 = 0; - + for (i = 0; i < num_outputs; i++) { if (entries[i].type == 3) @@ -3430,5 +3452,6 @@ memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); stringlength = string->length; + free(rom); return true; } Index: branches/ErmaC/Trunk/i386/libsaio/ati.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/ati.c (revision 2059) +++ branches/ErmaC/Trunk/i386/libsaio/ati.c (revision 2060) @@ -233,8 +233,6 @@ { 0x94C1, 0x11101462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, { 0x94C3, 0x03421002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, - { 0x94C3, 0x94C31002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, - { 0x94C3, 0x01011A93, CHIP_FAMILY_RV610, "Qimonda Radeon HD 2400 PRO", kNull }, { 0x94C3, 0x03021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, { 0x94C3, 0x03421002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, @@ -256,6 +254,7 @@ { 0x94C3, 0x3000174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, { 0x94C3, 0x30001787, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, { 0x94C3, 0x37161642, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x94C31002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, { 0x94C3, 0xE370174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, { 0x94C3, 0xE400174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, @@ -488,6 +487,7 @@ { 0x68BA, 0x31531682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, { 0x68BA, 0xE144174B, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BE, 0x200A1787, CHIP_FAMILY_JUNIPER, "HIS ATI 5750", kVervet }, { 0x68BE, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5750", kVervet }, { 0x68BE, 0x3000148C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, { 0x68BE, 0x3000174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, @@ -523,6 +523,7 @@ { 0x68C1, 0x042E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, { 0x68C1, 0x042F1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, { 0x68C1, 0x9071104D, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0x1449103C, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, { 0x68C1, 0xFD001179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, { 0x68C1, 0xFD121179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, { 0x68C1, 0xFD501179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, @@ -630,11 +631,11 @@ { 0x68F9, 0x00021019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, { 0x68F9, 0x00191019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, { 0x68F9, 0x010E1002, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x010E1028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, { 0x68F9, 0x03741043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, { 0x68F9, 0x03CA1043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, { 0x68F9, 0x05181025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, { 0x68F9, 0x05191025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, - { 0x68F9, 0x010E1028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, { 0x68F9, 0x174B3000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, { 0x68F9, 0x174B6250, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, { 0x68F9, 0x174B6290, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, @@ -668,6 +669,8 @@ { 0x68F9, 0x301217AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, { 0x68F9, 0x301317AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, { 0x68F9, 0x301417AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x30321682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x303A1682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, { 0x68F9, 0x3580103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, { 0x68F9, 0x360217AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, { 0x68F9, 0x360317AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, @@ -789,6 +792,7 @@ { 0x6741, 0x9080104D, CHIP_FAMILY_TURKS, "AMD Radeon HD 6630M", kNull }, { 0x6758, 0x00121028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x0B0E1002, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kPithecia }, { 0x6758, 0x0B0E1028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, { 0x6758, 0x20121787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kPithecia }, { 0x6758, 0x20141787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, Index: branches/ErmaC/Trunk/i386/boot2/boot.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/boot.c (revision 2059) +++ branches/ErmaC/Trunk/i386/boot2/boot.c (revision 2060) @@ -123,8 +123,25 @@ { int ret; entry_t kernelEntry; - + bootArgs->kaddr = bootArgs->ksize = 0; + + { + bool KPRebootOption = false; + bool HiDPIOption = false; + + getBoolForKey(kRebootOnPanic, &KPRebootOption, &bootInfo->chameleonConfig); + if (KPRebootOption == true) + { + bootArgs->flags |= kBootArgsFlagRebootOnPanic; + } + getBoolForKey(kEnableHiDPI, &HiDPIOption, &bootInfo->chameleonConfig); + if (HiDPIOption == true) + { + bootArgs->flags |= kBootArgsFlagHiDPI; + } + } + execute_hook("ExecKernel", (void*)binary, NULL, NULL, NULL); ret = DecodeKernel(binary, @@ -185,10 +202,13 @@ // This will draw the boot graphics unless we are in // verbose mode. if (gVerboseMode) + { setVideoMode( GRAPHICS_MODE, 0 ); + } else + { drawBootGraphics(); - + } setupBooterLog(); finalizeBootStruct(); @@ -204,7 +224,8 @@ startprog( kernelEntry, bootArgs ); } - else { + else + { // Notify modules that the kernel is about to be started execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgsPreLion, NULL, NULL); @@ -234,15 +255,19 @@ // Use specify kernel cache file if not empty if (cacheFile[0] != 0) + { strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile)); - else { + } + else + { // Lion and Mountain Lion prelink kernel cache file if ((checkOSVersion("10.7")) || (checkOSVersion("10.8"))) { sprintf(kernelCacheFile, "%skernelcache", kDefaultCachePathSnow); } // Snow Leopard prelink kernel cache file - else if (checkOSVersion("10.6")) { + else if (checkOSVersion("10.6")) + { sprintf(kernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64"); int lnam = strlen(kernelCacheFile) + 9; //with adler32 @@ -262,7 +287,8 @@ } } } - else { + else + { // Reset cache name. bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64); sprintf(gCacheNameAdler + 64, "%s,%s", gRootDevice, bootInfo->bootFile); @@ -272,10 +298,13 @@ } /* Issue: http://forge.voodooprojects.org/p/chameleon/issues/270/ // kernelCacheFile must start with a / - if (kernelCacheFile[0] != '/') { + if (kernelCacheFile[0] != '/') + { char *str = strdup(kernelCacheFile); if (str == NULL) + { return -1; + } sprintf(kernelCacheFile, "/%s", str); free(str); } @@ -297,7 +326,9 @@ sprintf(kernelCachePath, "com.apple.boot.S%s", kernelCacheFile); ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); if ((flags & kFileTypeMask) != kFileTypeFlat) + { ret = -1; + } } } } @@ -307,7 +338,9 @@ strcpy(kernelCachePath, kernelCacheFile); ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); if ((flags & kFileTypeMask) != kFileTypeFlat) + { ret = -1; + } } // Exit if kernel cache file wasn't found Index: branches/ErmaC/Trunk/i386/boot2/boot.h =================================================================== --- branches/ErmaC/Trunk/i386/boot2/boot.h (revision 2059) +++ branches/ErmaC/Trunk/i386/boot2/boot.h (revision 2060) @@ -163,6 +163,10 @@ /* cosmo1: added these keys */ #define kEnableHDMIAudio "EnableHDMIAudio" /*ati.c && nvidia.c */ +/* cparm: added these keys */ +#define kRebootOnPanic "RebootOnPanic" +#define kEnableHiDPI "EnableHiDPI" // enable High resolution display (aka Retina) + /* * Flags to the booter or kernel */ Index: branches/ErmaC/Trunk/i386/boot2/options.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/options.c (revision 2059) +++ branches/ErmaC/Trunk/i386/boot2/options.c (revision 2060) @@ -210,21 +210,31 @@ clearScreenRows( row, kScreenLastRow ); } - //clearBootArgs(); + clearBootArgs(); - if (visible) { - if (bootArgs->Video.v_display == VGA_TEXT_MODE) { - if (gEnableCDROMRescan) { + if (visible) + { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + { + if (gEnableCDROMRescan) + { printf( bootRescanPrompt ); - } else { + } + else + { printf( bootPrompt ); - printf( gBootArgs ); + printf( gBootArgs ); } } - } else { - if (bootArgs->Video.v_display != VGA_TEXT_MODE) { -// clearGraphicBootPrompt(); - } else { + } + else + { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) + { + clearGraphicBootPrompt(); + } + else + { printf("Press Enter to start up the foreign OS. "); } } @@ -1130,46 +1140,43 @@ // Maximum config table value size #define VALUE_SIZE 2048 -int -processBootOptions() +int processBootOptions() { - const char *cp = gBootArgs; - const char *val = 0; - const char *kernel; - int cnt; - int userCnt; - int cntRemaining; - char *argP; - char *configKernelFlags; - char *valueBuffer; + const char *cp = gBootArgs; + const char *val = 0; + const char *kernel; + int cnt; + int userCnt; + int cntRemaining; + char *argP; + char *configKernelFlags; + char *valueBuffer; - valueBuffer = malloc(VALUE_SIZE); + valueBuffer = malloc(VALUE_SIZE); - skipblanks( &cp ); + skipblanks( &cp ); - // Update the unit and partition number. + // Update the unit and partition number. - if ( gBootVolume ) - { - if (!( gBootVolume->flags & kBVFlagNativeBoot )) - { - readBootSector( gBootVolume->biosdev, gBootVolume->part_boff, - (void *) 0x7c00 ); + if ( gBootVolume ) + { + if (!( gBootVolume->flags & kBVFlagNativeBoot )) + { + readBootSector( gBootVolume->biosdev, gBootVolume->part_boff, (void *) 0x7c00 ); + // + // Setup edx, and signal intention to chain load the + // foreign booter. + // - // - // Setup edx, and signal intention to chain load the - // foreign booter. - // + chainbootdev = gBootVolume->biosdev; + chainbootflag = 1; - chainbootdev = gBootVolume->biosdev; - chainbootflag = 1; + return 1; + } - return 1; - } + setRootVolume(gBootVolume); - setRootVolume(gBootVolume); - - } + } // If no boot volume fail immediately because we're just going to fail // trying to load the config file anyway. else @@ -1345,19 +1352,22 @@ int line_offset; int c; - if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) + { showInfoBox( "Press q to continue, space for next page.\n",buf_orig ); return; } - // Create a copy so that we don't mangle the original - buf = malloc(size + 1); - memcpy(buf, buf_orig, size); + // Create a copy so that we don't mangle the original + buf = malloc(size + 1); + memcpy(buf, buf_orig, size); bp = buf; - while (size-- > 0) { - if (*bp == '\n') { + while (size-- > 0) + { + if (*bp == '\n') + { *bp = '\0'; } bp++; @@ -1367,43 +1377,57 @@ setActiveDisplayPage(1); - while (1) { + while (1) + { clearScreenRows(0, 24); setCursorPosition(0, 0, 1); bp = buf; - for (line = 0; *bp != '\1' && line < line_offset; line++) { - while (*bp != '\0') { + for (line = 0; *bp != '\1' && line < line_offset; line++) + { + while (*bp != '\0') + { bp++; } bp++; } - for (line = 0; *bp != '\1' && line < 23; line++) { + for (line = 0; *bp != '\1' && line < 23; line++) + { setCursorPosition(0, line, 1); printf("%s\n", bp); - while (*bp != '\0') { + while (*bp != '\0') + { bp++; } bp++; } setCursorPosition(0, 23, 1); - if (*bp == '\1') { + if (*bp == '\1') + { printf("[Type %sq or space to quit viewer]", (line_offset > 0) ? "p for previous page, " : ""); - } else { + } + else + { printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); } c = getchar(); - if (c == 'q' || c == 'Q') { + if (c == 'q' || c == 'Q') + { break; } - if ((c == 'p' || c == 'P') && line_offset > 0) { + if ((c == 'p' || c == 'P') && line_offset > 0) + { line_offset -= 23; } - if (c == ' ') { - if (*bp == '\1') { + if (c == ' ') + { + if (*bp == '\1') + { break; - } else { + } + else + { line_offset += 23; } } @@ -1413,9 +1437,12 @@ void showHelp(void) { - if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) + { showInfoBox("Help. Press q to quit.\n", (char *)BootHelp_txt); - } else { + } + else + { showTextBuffer((char *)BootHelp_txt, BootHelp_txt_len); } } @@ -1427,14 +1454,16 @@ int fd; int size; - if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) { + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) + { printf("\nFile not found: %s\n", filename); sleep(2); return; } size = file_size(fd); - if (size > MAX_TEXT_FILE_SIZE) { + if (size > MAX_TEXT_FILE_SIZE) + { size = MAX_TEXT_FILE_SIZE; } buf = malloc(size); @@ -1461,9 +1490,11 @@ printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice); do { key = getchar(); - switch (ASCII_KEY(key)) { + switch (ASCII_KEY(key)) + { case KEY_BKSP: - if (digitsI > 0) { + if (digitsI > 0) + { int x, y, t; getCursorPositionAndType(&x, &y, &t); // Assume x is not 0; @@ -1472,7 +1503,9 @@ // Overwrite with space without moving cursor position putca(' ', 0x07, 1); digitsI--; - } else { + } + else + { // TODO: Beep or something } break; @@ -1480,25 +1513,33 @@ case KEY_ENTER: digits[digitsI] = '\0'; newbootdevice = strtol(digits, &end, 16); - if (end == digits && *end == '\0') { + if (end == digits && *end == '\0') + { // User entered empty string printf("\nUsing default boot device %x\n", bootdevice); key = 0; - } else if(end != digits && *end == '\0') { + } + else if(end != digits && *end == '\0') + { bootdevice = newbootdevice; printf("\n"); key = 0; // We gots da boot device - } else { + } + else + { printf("\nCouldn't parse. try again: "); digitsI = 0; } break; default: - if (isxdigit(ASCII_KEY(key)) && digitsI < 2) { + if (isxdigit(ASCII_KEY(key)) && digitsI < 2) + { putchar(ASCII_KEY(key)); digits[digitsI++] = ASCII_KEY(key); - } else { + } + else + { // TODO: Beep or something } break; @@ -1511,9 +1552,12 @@ bool promptForRescanOption(void) { printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n"); - if (getchar() == KEY_ENTER) { + if (getchar() == KEY_ENTER) + { return true; - } else { + } + else + { return false; } } Index: branches/ErmaC/Trunk/i386/Cconfig =================================================================== --- branches/ErmaC/Trunk/i386/Cconfig (revision 2059) +++ branches/ErmaC/Trunk/i386/Cconfig (revision 2060) @@ -8,8 +8,6 @@ ---help--- Specify the level to compile chameleon with. -source "i386/md/Cconfig" - source "i386/util/Cconfig" source "i386/boot0/Cconfig" Index: branches/ErmaC/Trunk/i386/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/Makefile (revision 2059) +++ branches/ErmaC/Trunk/i386/Makefile (revision 2060) @@ -18,10 +18,6 @@ # The order of building is important. SUBDIRS_PRE = -ifeq ($(CONFIG_MD),y) -SUBDIRS_PRE += md -endif - SUBDIRS_PRE += util SUBDIRS = $(SUBDIRS_PRE) klibc libsa libsaio boot0 boot1 boot2 cdboot modules Index: branches/ErmaC/Trunk/package/builddmg.sh =================================================================== --- branches/ErmaC/Trunk/package/builddmg.sh (revision 2059) +++ branches/ErmaC/Trunk/package/builddmg.sh (revision 2060) @@ -51,9 +51,9 @@ echo -e $COL_BLACK" ----------------------"$COL_RESET echo "" -# ================================= +# ================================== # 1) Clean previous builded contents -# ================================= +# ================================== if [ -x ${SRC_FOLDER} ]; then echo " Deleting previous existing source folder/content " Index: branches/ErmaC/Trunk/package/buildpkg.sh =================================================================== --- branches/ErmaC/Trunk/package/buildpkg.sh (revision 2059) +++ branches/ErmaC/Trunk/package/buildpkg.sh (revision 2060) @@ -23,6 +23,9 @@ set -u # Abort with unset variables #set -e # Abort with any error can be suppressed locally using EITHER cmd||true OR set -e;cmd;set +e +export LC_COLLATE='C' +export LC_CTYPE='C' + # ====== CONFIGURATION ====== CONFIG_MODULES="" CONFIG_KLIBC_MODULE="" Index: branches/ErmaC/Trunk/doc/BootHelp.txt =================================================================== --- branches/ErmaC/Trunk/doc/BootHelp.txt (revision 2059) +++ branches/ErmaC/Trunk/doc/BootHelp.txt (revision 2060) @@ -107,7 +107,8 @@ DropSSDT=Yes Skip the SSDT tables while relocating the ACPI tables. DSDT= Use an alternate DSDT.aml file - (default path: /DSDT.aml /Extra/DSDT.aml bt(0,0)/Extra/DSDT.aml). + (default path: /DSDT.aml + /Extra/DSDT.aml bt(0,0)/Extra/DSDT.aml). GenerateCStates=Yes Enable auto generation of processor idle sleep states (C-States). Index: branches/ErmaC/Trunk/Make.rules =================================================================== --- branches/ErmaC/Trunk/Make.rules (revision 2059) +++ branches/ErmaC/Trunk/Make.rules (revision 2060) @@ -48,82 +48,56 @@ @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -o $@ -ifeq ($(CONFIG_MD),y) - $(OBJROOT)/%.o: %.c @echo "\t[CC] $<" @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ \ -MD -dependency-file $(OBJROOT)/$*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d + @cat "$(OBJROOT)/$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$(OBJROOT)/$*.d" $(OBJROOT)/%.o32: %.c @echo "\t[CC32] $<" @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch i386 $< -o $@ \ -MD -dependency-file $(OBJROOT)/$*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d + @cat "$(OBJROOT)/$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$(OBJROOT)/$*.d" $(OBJROOT)/%.o64: %.c @echo "\t[CC64] $<" @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -o $@ \ -MD -dependency-file $(OBJROOT)/$*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d + @cat "$(OBJROOT)/$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$(OBJROOT)/$*.d" $(OBJROOT)/%.o: %.m @echo "\t[M] $<" @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ \ -MD -dependency-file $(OBJROOT)/$*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d + @cat "$(OBJROOT)/$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$(OBJROOT)/$*.d" $(OBJROOT)/%.o: %.cpp @echo "\t[CPP] $<" @$(CPP) $(CPPFLAGS) $(CFLAGS) -c "$<" $(INC) -o $@ \ -MD -dependency-file $(OBJROOT)/$*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d + @cat "$(OBJROOT)/$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$(OBJROOT)/$*.d" $(OBJROOT)/boot2.o: @echo "\t[AS] boot2.s" @$(CC) -Wa,-n -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) boot2.s \ -MD -dependency-file $*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $*.d + @cat "$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$*.d" $(OBJROOT)/%.o: %.s @echo "\t[AS] $<" @$(CC) $(CPPFLAGS) -c $(INC) -arch i386 -o $@ $< \ -MD -dependency-file $*.d - @$(SYMROOT)/md -u $(OBJROOT)/Makedep -f -d $*.d + @cat "$*.d" >>"$(OBJROOT)/Makedep" + @rm -f "$*.d" -else -$(OBJROOT)/%.o: %.c - @echo "\t[CC] $<" - @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ - -$(OBJROOT)/%.o32: %.c - @echo "\t[CC32] $<" - @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch i386 $< -o $@ - -$(OBJROOT)/%.o64: %.c - @echo "\t[CC64] $<" - @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -o $@ - -$(OBJROOT)/%.o: %.m - @echo "\t[M] $<" - @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ - -$(OBJROOT)/%.o: %.cpp - @echo "\t[CPP] $<" - @$(CPP) $(CPPFLAGS) $(CFLAGS) -c "$<" $(INC) -o $@ - -$(OBJROOT)/boot2.o: - @echo "\t[AS] boot2.s" - @$(CC) -Wa,-n -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) boot2.s - -$(OBJROOT)/%.o: %.s - @echo "\t[AS] $<" - @$(CC) $(CPPFLAGS) -c $(INC) -arch i386 -o $@ $< - -endif - CONFIG_FILES=$(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(CONFIG_FILES): $(SRCROOT)/.config @echo "\t[MAKE] config" @@ -200,7 +174,7 @@ fi @rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \ $(SRCROOT)/i386/modules/module_includes - + distclean: distclean-recursive clean-local clean-dep @find . $(FIND_IGNORE) \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ Index: branches/ErmaC/Trunk/CHANGES =================================================================== --- branches/ErmaC/Trunk/CHANGES (revision 2059) +++ branches/ErmaC/Trunk/CHANGES (revision 2060) @@ -1,3 +1,4 @@ +- cparm : Added two boot options for High resolution display and reboot on kernel panic - cparm : Added a workaroud for Xcode 4.4.x compatibility 504B030414030100630004731141000000007D0000008B00000003000B0062696E01990700020041450308001AED80DA50DF6080B0390FE095B3BC129E1FC27C104EC97897EF27CD1175766CB18C66FF42EFB7023911BDFD5E4BC9AEEC32FF3473963F70B255581D7B74DE9F - cparm : Fixed a buffer overflow in the plist loader - Add more nVidia and Ati Device and Subdevice IDs.