Chameleon Applications

Chameleon Applications Commit Details

Date:2011-06-01 03:00:41 (12 years 9 months ago)
Author:ErmaC
Commit:307
Parents: 306
Message:merge changes from trunk (929). Also merge the module changes from Azimutz branche (fix compile error) Also edited the info.plist into AHCIPortInjector.kext: http://forum.voodooprojects.org/index.php/topic,1170.0.html
Changes:
M/branches/iFabio/Chameleon/i386/boot2/modules.c
M/branches/iFabio/Chameleon/i386/libsaio/pci_setup.c
M/branches/iFabio/Chameleon/i386/modules/Resolution/915resolution.c
M/branches/iFabio/Chameleon/i386/modules/AMDGraphicsEnabler/ati.c
M/branches/iFabio/Chameleon/i386/boot2/Makefile
M/branches/iFabio/Chameleon/i386/modules/IntelGraphicsEnabler/gma.c
M/branches/iFabio/Chameleon/i386/boot2/modules.h
M/branches/iFabio/Chameleon/package/Kexts/AHCIPortInjector.kext/Contents/Info.plist
M/branches/iFabio/Chameleon/i386/libsaio/platform.c
M/branches/iFabio/Chameleon/i386/modules/NVIDIAGraphicsEnabler/nvidia.c
M/branches/iFabio/Chameleon/i386/libsaio/spd.c
M/branches/iFabio/Chameleon/i386/libsa/printf.c
M/branches/iFabio/Chameleon/i386/modules/ATiGraphicsEnabler/ati.c

File differences

branches/iFabio/Chameleon/i386/libsaio/spd.c
344344
345345
346346
347
347348
348
349
349350
350351
351352
slot->SerialNo);
#if DEBUG_SPD
// prevously located on mem.c; temporarily on platform.c now
dumpPhysAddr("spd content: ", slot->spd, spd_size);
getc();
getchar();
#endif
}
branches/iFabio/Chameleon/i386/libsaio/platform.c
2626
2727
2828
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
2973
3074
3175
PlatformInfo_t Platform;
pci_dt_t * dram_controller_dev = NULL;
//Azi: temporarily placing this here; from removed mem.c, needed by DEBUG_PLATFORM
// check if replaceable by other or completely remove?? whatever...
#define DC(c) (c >= 0x20 && c < 0x7f ? (char) c : '.')
#define STEP 16
void dumpPhysAddr(const char * title, void * a, int len)
{
int i,j;
u_int8_t* ad = (u_int8_t*) a;
char buffer[80];
char str[16];
if(ad==NULL) return;
printf("%s addr=0x%08x len=%04d\n",title ? title : "Dump of ", a, len);
printf("Ofs-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F ASCII\n");
i = (len/STEP)*STEP;
for (j=0; j < i; j+=STEP)
{
printf("%02x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
j,
ad[j], ad[j+1], ad[j+2], ad[j+3] , ad[j+4], ad[j+5], ad[j+6], ad[j+7],
ad[j+8], ad[j+9], ad[j+10], ad[j+11] , ad[j+12], ad[j+13], ad[j+14], ad[j+15],
DC(ad[j]), DC(ad[j+1]), DC(ad[j+2]), DC(ad[j+3]) , DC(ad[j+4]), DC(ad[j+5]), DC(ad[j+6]), DC(ad[j+7]),
DC(ad[j+8]), DC(ad[j+9]), DC(ad[j+10]), DC(ad[j+11]) , DC(ad[j+12]), DC(ad[j+13]), DC(ad[j+14]), DC(ad[j+15])
);
}
if (len%STEP==0) return;
sprintf(buffer,"%02x:", i);
for (j=0; j < STEP; j++) {
if (j<(len%STEP))
sprintf(str, " %02x", ad[i+j]);
else
strcpy(str, " " );
strncat(buffer, str, sizeof(buffer));
}
strncat(buffer," ", sizeof(buffer));
for (j=0; j < (len%STEP); j++) {
sprintf(str, "%c", DC(ad[i+j]));
strncat(buffer, str, sizeof(buffer));
}
printf("%s\n",buffer);
}
/** Return if a CPU feature specified by feature is activated (true) or not (false) */
bool platformCPUFeature(uint32_t feature)
{
branches/iFabio/Chameleon/i386/libsaio/pci_setup.c
1818
1919
2020
21
2221
23
2422
2523
2624
......
2826
2927
3028
31
3229
3330
3431
3532
3633
3734
38
35
3936
4037
4138
4239
43
40
4441
4542
4643
......
4845
4946
5047
51
48
5249
5350
5451
5552
5653
57
54
5855
5956
6057
char *devicepath;
bool do_eth_devprop, do_gfx_devprop, do_enable_hpet;
pci_dt_t *current = pci_dt;
do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;
getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
while (current)
{
devicepath = get_pci_dev_path(current);
switch (current->class_id)
{
case PCI_CLASS_BRIDGE_HOST:
if (current->dev.addr == PCIADDR(0, 0, 0))
dram_controller_dev = current;
break;
case PCI_CLASS_NETWORK_ETHERNET:
if (do_eth_devprop)
set_eth_builtin(current);
break;
case PCI_CLASS_DISPLAY_VGA:
if (do_gfx_devprop)
switch (current->vendor_id)
case PCI_VENDOR_ID_ATI:
setup_ati_devprop(current);
break;
case PCI_VENDOR_ID_INTEL:
/* message to be removed once support for these cards is added */
verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
current->vendor_id, current->device_id, devicepath);
break;
case PCI_VENDOR_ID_NVIDIA:
setup_nvidia_devprop(current);
break;
branches/iFabio/Chameleon/i386/boot2/Makefile
124124
125125
126126
127
128
129
130127
131128
132129
133130
134131
135
136
137132
138133
139134
-o $(OBJROOT)/Symbols_LINKER_ONLY.dylib
endif
@make embed_symbols# this is done in a sub process after boot.sys exists so the strings are populated correctly
@${RM} $(SYMROOT)/boot2.sys
@( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\
then \
branches/iFabio/Chameleon/i386/boot2/modules.c
5353
5454
5555
56
56
5757
5858
5959
......
6969
7070
7171
72
72
7373
7474
7575
......
166166
167167
168168
169
169
170170
171171
172172
......
308308
309309
310310
311
311
312
313
314
315
312316
313317
314318
......
377381
378382
379383
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
407411
408412
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
436438
437439
438440
if(symbols_module_start != (void*)0xFFFFFFFF)
{
// Module system was compiled in (Symbols.dylib addr known)
module_start = parse_mach(module_data, &load_module, &add_symbol);
module_start = parse_mach(module_data, &load_module, &add_symbol, NULL);
if(module_start && module_start != (void*)0xFFFFFFFF)
{
else
{
module_data -= 0x10; // XCODE 4 HACK
module_start = parse_mach(module_data, &load_module, &add_symbol);
module_start = parse_mach(module_data, &load_module, &add_symbol, NULL);
if(module_start && module_start != (void*)0xFFFFFFFF)
{
if (moduleSize && read(fh, module_base, moduleSize) == moduleSize)
{
// Module loaded into memory, parse it
module_start = parse_mach(module_base, &load_module, &add_symbol);
module_start = parse_mach(module_base, &load_module, &add_symbol, NULL);
if(module_start && module_start != (void*)0xFFFFFFFF)
{
* NOTE: If the module is unable to load ot completeion, the modules
* symbols will still be available.
*/
void* parse_mach(void* binary, int(*dylib_loader)(char*), long long(*symbol_handler)(char*, long long, char))
void* parse_mach(void* binary,
int(*dylib_loader)(char*),
long long(*symbol_handler)(char*, long long, char),
void (*section_handler)(char* section, char* segment, long long offset, long long address)
)
{
char is64 = false;
void (*module_start)(void) = NULL;
break;
case LC_SEGMENT: // 32bit macho
segCommand = binary + binaryIndex;
if(strcmp("__TEXT", segCommand->segname) == 0)
{
UInt32 sectionIndex;
sectionIndex = sizeof(struct segment_command);
struct section *sect;
while(sectionIndex < segCommand->cmdsize)
{
sect = binary + binaryIndex + sectionIndex;
sectionIndex += sizeof(struct section);
if(strcmp("__text", sect->sectname) == 0)
{
// __TEXT,__text found, save the offset and address for when looking for the calls.
textSection = sect->offset;
textAddress = sect->addr;
break;
}
}
}
{
segCommand = binary + binaryIndex;
UInt32 sectionIndex;
sectionIndex = sizeof(struct segment_command);
struct section *sect;
while(sectionIndex < segCommand->cmdsize)
{
sect = binary + binaryIndex + sectionIndex;
sectionIndex += sizeof(struct section);
if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr);
if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0))
{
// __TEXT,__text found, save the offset and address for when looking for the calls.
textSection = sect->offset;
textAddress = sect->addr;
}
}
}
break;
case LC_SEGMENT_64:// 64bit macho's
segCommand64 = binary + binaryIndex;
if(strcmp("__TEXT", segCommand64->segname) == 0)
{
UInt32 sectionIndex;
sectionIndex = sizeof(struct segment_command_64);
struct section_64 *sect;
while(sectionIndex < segCommand64->cmdsize)
{
sect = binary + binaryIndex + sectionIndex;
sectionIndex += sizeof(struct section_64);
if(strcmp("__text", sect->sectname) == 0)
{
// __TEXT,__text found, save the offset and address for when looking for the calls.
textSection = sect->offset;
textAddress = sect->addr;
break;
}
}
}
{
segCommand64 = binary + binaryIndex;
UInt32 sectionIndex;
sectionIndex = sizeof(struct segment_command_64);
struct section_64 *sect;
while(sectionIndex < segCommand64->cmdsize)
{
sect = binary + binaryIndex + sectionIndex;
sectionIndex += sizeof(struct section_64);
if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr);
if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0))
{
// __TEXT,__text found, save the offset and address for when looking for the calls.
textSection = sect->offset;
textAddress = sect->addr;
}
}
}
break;
branches/iFabio/Chameleon/i386/boot2/modules.h
4141
4242
4343
44
44
4545
4646
4747
4848
49
49
5050
5151
5252
......
7777
7878
7979
80
80
81
82
8183
8284
8385
struct moduleHook_t* next;
} moduleHook_t;
typedef struct modulesList_t
typedef struct moduleList_t //Azi: modules or module? see modules/include/modules
{
char*name;
//UInt32version;
//UInt32compat;
struct modulesList_t* next;
struct moduleList_t*next;
} moduleList_t;
/********************************************************************************/
void*parse_mach(void* binary,
int(*dylib_loader)(char*),
long long(*symbol_handler)(char*, long long, char));
long long(*symbol_handler)(char*, long long, char),
void (*section_handler)(char* section, char* segment, long long offset, long long address)
);
unsigned inthandle_symtable(UInt32 base,
struct symtab_command* symtabCommand,
long long(*symbol_handler)(char*, long long, char),
branches/iFabio/Chameleon/i386/modules/Resolution/915resolution.c
182182
183183
184184
185
185
186186
187187
188188
......
860860
861861
862862
863
863
if((id & 0x0000FFFF) == 0x00008086) // Intel chipset
{
//printf("Unknown chipset 0x%llX, please email id to meklort@gmail.com", id);
//getc();
//getchar();
type = CT_UNKNOWN_INTEL;
//type = CT_UNKNOWN;
//}
}
#endif // _RESOLUTION_H_
#endif // _RESOLUTION_H_
branches/iFabio/Chameleon/i386/modules/NVIDIAGraphicsEnabler/nvidia.c
245245
246246
247247
248
248
249249
250250
251251
......
402402
403403
404404
405
405
406406
407407
408408
{ 0x10DE0408, "GeForce 9650M GS" },
{ 0x10DE0409, "GeForce 8700M GT" },
{ 0x10DE040A, "Quadro FX 370" },
{ 0x10DE040B, "Quadro NVS 320M" },
{ 0x10DE040B, "Quadro NVS 320M" }, //Azi: 320M
{ 0x10DE040C, "Quadro FX 570M" },
{ 0x10DE040D, "Quadro FX 1600M" },
{ 0x10DE040E, "Quadro FX 570" },
{ 0x10DE0DE2, "GeForce GT 420" },
{ 0x10DE0DEB, "GeForce GT 555M" },
{ 0x10DE0DEE, "GeForce GT 415M" },
{ 0x10DE0DF0, "GeForce GT 425M" },
{ 0x10DE0DF0, "GeForce GT 425M" }, //Azi: ?? GT 450M
{ 0x10DE0DF1, "GeForce GT 420M" },
{ 0x10DE0DF2, "GeForce GT 435M" },
{ 0x10DE0DF3, "GeForce GT 420M" },
branches/iFabio/Chameleon/i386/modules/IntelGraphicsEnabler/gma.c
9999
100100
101101
102
102
103103
104104
105105
......
142142
143143
144144
145
145
146146
147147
148148
{
printf("Failed initializing dev-prop string dev-entry, press any key...\n");
getc();
getchar();
return false;
}
if(!stringdata)
{
printf("no stringdata press a key...\n");
getc();
getchar();
return false;
}
branches/iFabio/Chameleon/i386/modules/ATiGraphicsEnabler/ati.c
643643
644644
645645
646
646
647647
648648
649649
650650
651651
652652
653
654
653
654
655655
656656
657657
658658
659659
660660
661
661
662662
663663
664664
......
668668
669669
670670
671
672
671
672
673673
674674
675675
676676
677
677
678
678679
679
680
680681
681682
682683
683684
684
685
685686
686687
687688
......
690691
691692
692693
693
694
694
695
695696
696697
697698
698
699
700
699701
700702
701703
......
705707
706708
707709
708
710
709711
710712
711
713
712714
713715
714716
......
716718
717719
718720
721
719722
723
724
720725
721
726
722727
723728
724
725
729
730
731
732
733
726734
727
735
736
728737
729
730
731738
739
740
741
742
732743
733
734
735
736
744
745
746
747
748
749
750
751
752
737753
738
754
739755
740756
741
742
743
744757
745
758
759
760
761
762
763
764
765
746766
747767
748
749
768
769
770
771
750772
751773
752774
753
775
776
754777
755778
756779
757780
781
782
783
758784
759
785
786
760787
761788
762
763
789
790
791
792
764793
794
765795
766
796
797
798
799
767800
768801
802
769803
770804
771
805
806
807
808
772809
773810
774
775
776811
777
812
813
814
815
816
817
818
778819
779820
821
822
780823
781824
782825
devicepath = get_pci_dev_path(ati_dev);
cmd = pci_config_read8(ati_dev->dev.addr, 4);
verbose("old pci command - %x\n", cmd);
verbose("old pci command - %x\n", cmd); //Azi: 7
if (cmd == 0) {
pci_config_write8(ati_dev->dev.addr, 4, 6);
cmd = pci_config_read8(ati_dev->dev.addr, 4);
verbose("new pci command - %x\n", cmd);
}
model = get_ati_model((ati_dev->vendor_id << 16) | ati_dev->device_id);
framebuffer = get_ati_fb((ati_dev->vendor_id << 16) | ati_dev->device_id);
model = get_ati_model((ati_dev->vendor_id << 16) | ati_dev->device_id); //Azi: Unknown
framebuffer = get_ati_fb((ati_dev->vendor_id << 16) | ati_dev->device_id); //Azi: Megalodon
if (!string) {
string = devprop_create_string();
}
device = devprop_add_device(string, devicepath);
if (!device) {
printf("Failed initializing dev-prop string dev-entry, press any key...\n");
getc();
getchar();
return false;
}
} else {
boot_display = 0;
}
verbose("boot display - %x\n", boot_display);
devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t*)&boot_display, 4);
verbose("boot display - %x\n", boot_display); //Azi: 1... thus, POSTed!
devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t*)&boot_display, 4); //Azi: Ok!
if ((framebuffer[0] == 'M' && framebuffer[1] == 'o' && framebuffer[2] == 't') ||
(framebuffer[0] == 'S' && framebuffer[1] == 'h' && framebuffer[2] == 'r') ||
(framebuffer[0] == 'P' && framebuffer[1] == 'e' && framebuffer[2] == 'r')) //faster than strcmp ;)
devprop_add_ati_template_4xxx(device);
//Azi: if framebuffer = Motmot or Shrike (none!) or Peregrine
devprop_add_ati_template_4xxx(device); //Azi: 4000 series (or 4800 ??)
else {
devprop_add_ati_template(device);
devprop_add_ati_template(device); //Azi: my scene!!!***
vram_size = getvramsizekb(ati_dev) * 1024;
if ((vram_size > 0x80000000) || (vram_size == 0)) {
vram_size = 0x10000000;//vram reported wrong, defaulting to 256 mb
}
devprop_add_value(device, "VRAM,totalsize", (uint8_t*)&vram_size, 4);
devprop_add_value(device, "VRAM,totalsize", (uint8_t*)&vram_size, 4); //Azi: 0x20000000
ati_vram_memsize_0.data[6] = (vram_size >> 16) & 0xFF; //4,5 are 0x00 anyway
ati_vram_memsize_0.data[7] = (vram_size >> 24) & 0xFF;
ati_vram_memsize_1.data[6] = (vram_size >> 16) & 0xFF; //4,5 are 0x00 anyway
DP_ADD_TEMP_VAL_DATA(device, ati_vram_memsize_1);
devprop_add_iopciconfigspace(device, ati_dev);
}
devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1));
devprop_add_value(device, "ATY,DeviceID", (uint8_t*)&ati_dev->device_id, 2);
devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1)); //Azi: Unknown
devprop_add_value(device, "ATY,DeviceID", (uint8_t*)&ati_dev->device_id, 2); //Azi: Ok! 8171 = (7181)
//fb setup
sprintf(tmp, "Slot-%x",devices_number);
devprop_add_value(device, "AAPL,slot-name", (uint8_t*)tmp, strlen(tmp) + 1);
devprop_add_value(device, "AAPL,slot-name", (uint8_t*)tmp, strlen(tmp) + 1); //Azi: OK! Slot-1
// don't think my card is on slot 1 ??... 0 ??
devices_number++;
sprintf(tmp, ati_compatible_0[1], framebuffer);
devprop_add_value(device, (char *) ati_compatible_1[0], (uint8_t *)tmp, strlen(tmp) + 1);
sprintf(tmp, ati_device_type[1], framebuffer);
devprop_add_value(device, (char *) ati_device_type[0], (uint8_t *)tmp, strlen(tmp) + 1);
devprop_add_value(device, (char *) ati_device_type[0], (uint8_t *)tmp, strlen(tmp) + 1); //Azi: OK!
sprintf(tmp, ati_name[1], framebuffer);
devprop_add_value(device, (char *) ati_name[0], (uint8_t *)tmp, strlen(tmp) + 1);
devprop_add_value(device, (char *) ati_name[0], (uint8_t *)tmp, strlen(tmp) + 1); //Azi: display ??
sprintf(tmp, ati_name_0[1], framebuffer);
devprop_add_value(device, (char *) ati_name_0[0], (uint8_t *)tmp, strlen(tmp) + 1);
sprintf(tmp, ati_name_1[1], framebuffer);
devprop_add_value(device, (char *) ati_name_1[0], (uint8_t *)tmp, strlen(tmp) + 1);
//Azi: Assemble default path for a custom rom...
sprintf(tmp, "bt(0,0)/Extra/%04x_%04x.rom", (uint16_t)ati_dev->vendor_id, (uint16_t)ati_dev->device_id);
//Azi: if user enabled use of custom rom...
if (getBoolForKey(kUseAtiROMKey, &doit, &bootInfo->bootConfig) && doit) {
verbose("looking for ati video bios file %s\n", tmp);
verbose("Looking for custom ATI rom %s...\n", tmp);
rom = malloc(0x20000);
rom_size = load_ati_bios_file(tmp, rom, 0x20000);
if (rom_size > 0) {
verbose("Using ATI Video BIOS File %s (%d Bytes)\n", tmp, rom_size);
//Azi: if rom exists
if (rom_size > 0)
{
verbose("Using custom rom %s (%d Bytes)\n", tmp, rom_size);
if (rom_size > 0x10000) {
rom_size = 0x10000; //we dont need rest anyway;
rom_size = 0x10000; // we dont need the rest anyway;
//Azi:verbose("Trimmed %s to %d Bytes\n", tmp, rom_size);
}
} else {
printf("ERROR: unable to open ATI Video BIOS File %s\n", tmp);
}
else
{
printf("ERROR: unable to open custom ATI rom %s.\n", tmp);
}
}
if (rom_size == 0) {
if (boot_display) {// no custom rom
bios = NULL;// try to dump from legacy space, otherwise can result in 100% fan speed
} else {
if (rom_size == 0) //Azi: rom_size is still 0, user didn't enabled use of custom rom...
{//Azi: if card posted...
if (boot_display) { // no custom rom
bios = NULL; // try to dump from legacy space, otherwise can result in 100% fan speed
//bios = readAtomBIOS(ati_dev); //Azi: Wrong BIOS signature... returns 0 = NULL :-//
}
else
{
// readAtomBios result in bug on some cards (100% fan speed and black screen),
// not using it for posted card, reading from legacy space instead
// not using it for posted card, reading from legacy space instead - Azi: reminder***
bios = readAtomBIOS(ati_dev);
}
} else {
bios = rom;//going custom rom way
verbose("Using rom %s\n", tmp);
}
if (bios == NULL) {
else //Azi: rom_size is diff from 0, user enabled use of custom rom...
{
bios = rom; //going custom rom way //Azi: shouldn't this be bios = rom_size??*****
verbose("Using rom %s\n", tmp); //Azi: print just the path
}
if (bios == NULL) //Azi: card was posted (boot_display = 1)
{
bios = (uint8_t *)0x000C0000;
toFree = false;
verbose("Not going to use bios image file\n");
} else {
verbose("Card posted, not going to use custom bios?? rom.\n"); //Azi: what file? custom rom??
}
else //Azi: anything but NULL, card wasn't posted (boot_display = 0), bios = readAtomBIOS(ati_dev), bios = rom_size... whatever :P ufff...
{
toFree = true;
}
if (bios[0] == 0x55 && bios[1] == 0xaa) {
if (bios[0] == 0x55 && bios[1] == 0xaa) //Azi: check bios for 0xAA55 sig
{
verbose("Found bios image\n");
bios_size = bios[2] * 512;
rom_pci_header = (option_rom_pci_header_t*)(bios + bios[24] + bios[25]*256);
//Azi: Wrong pci header signature 558a1275 but still works!**** check later...
// ‘rom_header’ is used uninitialized in this function...
//rom_pci_header = (option_rom_pci_header_t *)((uint8_t *)rom_header + rom_header->pci_header_offset);
if (rom_pci_header->signature == 0x52494350) {
if (rom_pci_header->signature == 0x52494350) //Azi: ati pci header sig
{
if (rom_pci_header->device_id != ati_dev->device_id) {
verbose("Bios image (%x) doesnt match card (%x), ignoring\n", rom_pci_header->device_id, ati_dev->device_id);
} else {
if (toFree)
}
else
{
if (toFree) //Azi: card wasn't posted (boot_display = 0)
{
//Azi: mmio, Memory-mapped I/O - Kabyl's smbios patcher stuff reminder.
verbose("Adding binimage to card %x from mmio space with size %x\n", ati_dev->device_id, bios_size);
} else {
}
else //Azi: card was posted (boot_display = 1)
{
//Azi: check "legacy space/mmio" stuff again!!!***
verbose("Adding binimage to card %x from legacy space with size %x\n", ati_dev->device_id, bios_size);
}
//Azi: not all Mac's have this..!!
devprop_add_value(device, "ATY,bin_image", bios, bios_size);
}
} else {
}
else
{
// ATY,bin_image is not added... not all Mac's have this..!!
verbose("Wrong pci header signature %x\n", rom_pci_header->signature);
}
} else {
verbose("Bios image not found at %x, content %x %x\n", bios, bios[0], bios[1]);
}
if (toFree) {
else
{
verbose("Bios image not found at %x, content %x %x\n", bios, bios[0], bios[1]);
}
if (toFree) //Azi: card wasn't posted (boot_display = 0)
{
free(bios);
}
//Azi: see ati.c AMDge; i have no problems here with xcode 4 compilation ???
stringdata = malloc(sizeof(uint8_t) * string->length);
memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length);
stringlength = string->length;
branches/iFabio/Chameleon/i386/modules/AMDGraphicsEnabler/ati.c
541541
542542
543543
544
544545
545546
546547
......
11021103
11031104
11041105
1105
11061106
11071107
11081108
......
11661166
11671167
11681168
1169
1170
1169
1170
11711171
1172
1172
11731173
11741174
11751175
11761176
11771177
1178
1178
11791179
11801180
11811181
1182
1182
11831183
11841184
11851185
11861186
1187
1187
11881188
11891189
11901190
......
12311231
12321232
12331233
1234
1234
12351235
12361236
12371237
uint8_t*rom;
uint32_trom_size;
uint32_tvram_size;
const char*cfg_name;
uint8_tports;
uint32_tflags;
boolposted;
static bool init_card(pci_dt_t *pci_dev)
{
const char *fb_name;
char name[24];
char name_parent[24];
int i;
atN = 0;
fb_name = getStringForKey(kAtiConfig, &bootInfo->bootConfig);
if (!fb_name)
card->cfg_name = getStringForKey(kAtiConfig, &bootInfo->bootConfig);
if (!card->cfg_name)
{
fb_name = card_configs[card->info->cfg_name].name;
card->cfg_name = card_configs[card->info->cfg_name].name;
card->ports = card_configs[card->info->cfg_name].ports;
}
else
{
for (i = 0; i < kCfgEnd; i++)
if (strcmp(fb_name, card_configs[i].name) == 0)
if (strcmp(card->cfg_name, card_configs[i].name) == 0)
card->ports = card_configs[i].ports;
}
sprintf(name, "ATY,%s", fb_name);
sprintf(name, "ATY,%s", card->cfg_name);
aty_name.type = kStr;
aty_name.size = strlen(name) + 1;
aty_name.data = (uint8_t *)name;
sprintf(name_parent, "ATY,%sParent", fb_name);
sprintf(name_parent, "ATY,%sParent", card->cfg_name);
aty_nameparent.type = kStr;
aty_nameparent.size = strlen(name_parent) + 1;
aty_nameparent.data = (uint8_t *)name_parent;
verbose("ATI %s %s %dMB (%s) [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
chip_family_name[card->info->chip_family], card->info->model_name,
(uint32_t)(card->vram_size / (1024 * 1024)), card_configs[card->info->cfg_name].name,
(uint32_t)(card->vram_size / (1024 * 1024)), card->cfg_name,
ati_dev->vendor_id, ati_dev->device_id,
ati_dev->subsys_id.subsys.vendor_id, ati_dev->subsys_id.subsys.device_id,
devicepath);
branches/iFabio/Chameleon/i386/libsa/printf.c
2828
2929
3030
31
31
32
3233
3334
3435
#include "libsa.h"
struct putc_info {
struct putc_info //Azi: same as below
{
char * str;
char * last_str;
};
branches/iFabio/Chameleon/package/Kexts/AHCIPortInjector.kext/Contents/Info.plist
375375
376376
377377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
378395
379396
380397
<key>Vendor Name</key>
<string>Intel</string>
</dict>
<key>MCP79BAHCI</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.AppleAHCIPort</string>
<key>Chipset Name</key>
<string>MCP79 AHCI</string>
<key>IOClass</key>
<string>AppleMCP79AHCI</string>
<key>IOPCIPrimaryMatch</key>
<string>0x0ab810de</string>
<key>IOProbeScore</key>
<integer>2000</integer>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>
<key>Vendor Name</key>
<string>NVidia</string>
</dict>
</dict>
<key>OSBundleRequired</key>
<string>Local-Root</string>

Archive Download the corresponding diff file

Revision: 307