Chameleon

Chameleon Commit Details

Date:2011-11-05 22:02:15 (7 years 11 months ago)
Author:MacMan
Commit:1689
Parents: 1688
Message:Updated tag 2.0 by mistake, reverted back.
Changes:
M/tags/2.0/i386/libsaio/fake_efi.c
M/tags/2.0/version
M/tags/2.0/i386/libsaio/nvidia.c
M/tags/2.0/i386/boot2/boot.h
M/tags/2.0/i386/libsaio/ati.c
M/tags/2.0/i386/boot2/options.c
M/tags/2.0/Makefile
M/tags/2.0/package/Scripts/Standard/postinstall
M/tags/2.0/i386/boot2/prompt.c
M/tags/2.0/i386/libsaio/gma.c
M/tags/2.0/i386/boot2/boot.c

File differences

tags/2.0/version
1
1
1.6.0
2.0
tags/2.0/i386/libsaio/gma.c
11
22
33
4
5
64
75
86
......
2321
2422
2523
24
2625
2726
2827
......
4746
4847
4948
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
10949
11050
11151
......
12767
12868
12969
130
131
132
133
134
135
13670
13771
13872
......
15488
15589
15690
157
15891
15992
16093
......
16295
16396
16497
165
16698
16799
168100
......
223155
224156
225157
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287158
288159
289160
/*
Original patch by Nawcom
http://forum.voodooprojects.org/index.php/topic,1029.0.html
Original Intel HDx000 code from valv
*/
#include "libsa.h"
#define DBG(x...)
#endif
uint8_t GMAX3100_vals[22][4] = {
{ 0x01,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 }
};
uint8_t HD2000_vals[16][4] = {
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xfa,0x00,0x00,0x00 },
{ 0x2c,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xf4,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
};
uint8_t HD3000_vals[16][4] = {
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xfa,0x00,0x00,0x00 },
{ 0x2c,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x14,0x00,0x00,0x00 },
{ 0xf4,0x01,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
};
uint8_t HD2000_tbl_info[18] = {
0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
0x00,0x01,0x02,0x02,0x02,0x00,0x01,0x02,0x02
};
uint8_t HD2000_os_info[20] = {
0x30,0x49,0x01,0x11,0x11,0x11,0x08,0x00,0x00,0x01,
0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00
};
// The following values came from a Sandy Bridge MacBook Air
uint8_t HD3000_tbl_info[18] = {
0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
0x00,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01
};
// The following values came from a Sandy Bridge MacBook Air
uint8_t HD3000_os_info[20] = {
0x30,0x49,0x01,0x12,0x12,0x12,0x08,0x00,0x00,0x01,
0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00
};
uint8_t reg_TRUE[]= { 0x01, 0x00, 0x00, 0x00 };
uint8_t reg_FALSE[] = { 0x00, 0x00, 0x00, 0x00 };
{ 0x80862A13, "GMAX3100"},
{ 0x80862A42, "GMAX3100"},
{ 0x80862A43, "GMAX3100"},
{ 0x80860102, "Intel HD Graphics 2000"},
{ 0x80860106, "Intel HD Graphics 2000 Mobile"},
{ 0x80860112, "Intel HD Graphics 3000"},
{ 0x80860116, "Intel HD Graphics 3000 Mobile"},
{ 0x80860122, "Intel HD Graphics 3000"},
{ 0x80860126, "Intel HD Graphics 3000 Mobile"},
};
char *get_gma_model(uint32_t id) {
char*model;
uint8_t BuiltIn =0x00;
uint8_t ClassFix[4] ={ 0x00, 0x00, 0x03, 0x00 };
unsigned intdevice_id;
devicepath = get_pci_dev_path(gma_dev);
regs = (uint8_t *) (bar[0] & ~0x0f);
model = get_gma_model((gma_dev->vendor_id << 16) | gma_dev->device_id);
device_id = gma_dev->device_id;
verbose("Intel %s [%04x:%04x] :: %s\n",
model, gma_dev->vendor_id, gma_dev->device_id, devicepath);
devprop_add_value(device, "AAPL01,Stretch",GMAX3100_vals[21], 4);
devprop_add_value(device, "class-code",ClassFix, 4);
}
else if (model == (char *)"Intel HD Graphics 2000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL00,PixelFormat", HD2000_vals[0], 4);
devprop_add_value(device, "AAPL00,T1", HD2000_vals[1], 4);
devprop_add_value(device, "AAPL00,T2", HD2000_vals[2], 4);
devprop_add_value(device, "AAPL00,T3", HD2000_vals[3], 4);
devprop_add_value(device, "AAPL00,T4", HD2000_vals[4], 4);
devprop_add_value(device, "AAPL00,T5", HD2000_vals[5], 4);
devprop_add_value(device, "AAPL00,T6", HD2000_vals[6], 4);
devprop_add_value(device, "AAPL00,T7", HD2000_vals[7], 4);
devprop_add_value(device, "AAPL00,LinkType", HD2000_vals[8], 4);
devprop_add_value(device, "AAPL00,LinkFormat", HD2000_vals[9], 4);
devprop_add_value(device, "AAPL00,DualLink", HD2000_vals[10], 4);
devprop_add_value(device, "AAPL00,Dither", HD2000_vals[11], 4);
devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4);
devprop_add_value(device, "graphic-options", HD2000_vals[13], 4);
devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 3000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL00,PixelFormat", HD3000_vals[0], 4);
devprop_add_value(device, "AAPL00,T1", HD3000_vals[1], 4);
devprop_add_value(device, "AAPL00,T2", HD3000_vals[2], 4);
devprop_add_value(device, "AAPL00,T3", HD3000_vals[3], 4);
devprop_add_value(device, "AAPL00,T4", HD3000_vals[4], 4);
devprop_add_value(device, "AAPL00,T5", HD3000_vals[5], 4);
devprop_add_value(device, "AAPL00,T6", HD3000_vals[6], 4);
devprop_add_value(device, "AAPL00,T7", HD3000_vals[7], 4);
devprop_add_value(device, "AAPL00,LinkType", HD3000_vals[8], 4);
devprop_add_value(device, "AAPL00,LinkFormat", HD3000_vals[9], 4);
devprop_add_value(device, "AAPL00,DualLink", HD3000_vals[10], 4);
devprop_add_value(device, "AAPL00,Dither", HD3000_vals[11], 4);
devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4);
devprop_add_value(device, "graphic-options", HD3000_vals[13], 4);
devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 2000")
{
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id));
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 3000")
{
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
device_id = 0x00000126;// Inject a valid mobile GPU device id instead of patching kexts
devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id));
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20);
}
stringdata = malloc(sizeof(uint8_t) * string->length);
if (!stringdata)
tags/2.0/i386/libsaio/nvidia.c
801801
802802
803803
804
805804
806805
807806
......
809808
810809
811810
812
813811
814812
815813
{ 0x10DE1040, "GeForce GT 520" },
// 1050 - 105F
{ 0x10DE1050, "GeForce GT 520M" },
{ 0x10DE1056, "Quadro NVS 4200M" },
// 1060 - 106F
// 1070 - 107F
// 1080 - 108F
{ 0x10DE1081, "GeForce GTX 570" },
{ 0x10DE1082, "GeForce GTX 560 Ti" },
{ 0x10DE1083, "D13U" },
{ 0x10DE1086, "GeForce GTX 570" },
{ 0x10DE1088, "GeForce GTX 590" },
// 1090 - 109F
{ 0x10DE1098, "D13U" },
tags/2.0/i386/libsaio/ati.c
398398
399399
400400
401
402
401403
402404
403405
......
408410
409411
410412
411
413
412414
413415
414416
......
478480
479481
480482
481
482
483
483484
484485
485486
......
489490
490491
491492
492
493493
494494
495495
496496
497497
498498
499
500
501
499
502500
503501
504
505
506502
507503
508
509
510504
511505
512506
......
556550
557551
558552
559
560
561553
562
563
564554
565
566
567
568
569
570
571
572
573555
574556
575557
576
577
578
579
580558
581
582
583559
584
585560
586561
587562
588563
589564
590565
591
592
593
594
595
596
597
598
599
600
601
602
603
604566
605567
606
607
608
609
610
568
611569
612
613
614570
615571
616572
......
694650
695651
696652
697
698
699653
700654
701655
702656
703657
704658
705
706
659
660
707661
708
709
710
711662
712663
713
664
714665
715666
716667
......
13211272
13221273
13231274
1324
1325
1275
13261276
13271277
13281278
......
13301280
13311281
13321282
1333
1283
13341284
13351285
13361286
......
13441294
13451295
13461296
1347
1297
13481298
13491299
13501300
......
13701320
13711321
13721322
1373
1374
1375
1376
1323
1324
13771325
13781326
1379
1327
13801328
13811329
13821330
13831331
1384
1332
13851333
1386
1334
13871335
13881336
13891337
13901338
13911339
13921340
1393
1341
13941342
13951343
13961344
......
13991347
14001348
14011349
1402
1350
14031351
14041352
14051353
......
14551403
14561404
14571405
1458
1459
1406
1407
1408
14601409
14611410
1462
14631411
14641412
14651413
{ 0x9589,0x30001462, CHIP_FAMILY_RV630,"ATI Radeon HD 3610",kNull},
{ 0x9589,0x30001642, CHIP_FAMILY_RV630,"ATI Radeon HD 3610",kNull},
{ 0x9589,0x0E41174B, CHIP_FAMILY_RV630,"ATI Radeon HD 3600 Series",kNull},
{ 0x9589,0x30001787, CHIP_FAMILY_RV630,"ATI Radeon HD 3600 Series",kNull},
{ 0x9598,0xB3831002, CHIP_FAMILY_RV635,"ATI All-in-Wonder HD",kNull},
{ 0x9598,0x30001043, CHIP_FAMILY_RV635,"ATI Radeon HD 3730",kNull},
{ 0x9598,0x30001043, CHIP_FAMILY_RV635,"HD3730",kNull},
{ 0x9598,0x30011043, CHIP_FAMILY_RV635,"ATI Radeon HD 4570",kNull},
{ 0x9598,0x3000148C, CHIP_FAMILY_RV635,"ATI Radeon HD 3730",kNull},
{ 0x689C,0x30201682, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5970",kUakari},
{ 0x68A1,0x144D103C,CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5850",kNomascus},
{ 0x68A1,0x1522103C, CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5850",kHoolock},
{ 0x68A1,0x144D103C,CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5800",kNomascus},
{ 0x68A8,0x050E1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M",kUakari},
{ 0x68B8,0x29911682, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x1482174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0xE144174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kHoolock},
{ 0x68B8,0xE147174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x21D71458, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x200B1787, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x22881787, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68BF,0x220E1458, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750",kVervet},
{ 0x68C0,0x1594103C, CHIP_FAMILY_REDWOOD,"AMD Radeon HD 6570M",kNull},
{ 0x68C0,0x392717AA, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5730",kNull},
{ 0x68C1,0x033E1025, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kNull},
{ 0x68C1,0x9071104D,CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kEulemur},
{ 0x68C8,0x2306103C, CHIP_FAMILY_REDWOOD,"ATI FirePro V4800 (FireGL)",kNull},
{ 0x68D8,0x03561043, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5670",kBaboon},
{ 0x6718,0x31301682, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6738,0x00D01002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x21FA1002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x67381002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x21FA1458,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x31031682,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x31041682,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0xE178174B,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x20101787,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6738,0x23051787,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6739,0x67391002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x21F81458, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x24411462, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x31101682, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0xE177174B,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6740,0x1657103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M",kNull},
{ 0x6740,0x165A103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M",kNull},
{ 0x6741,0x050E1025, CHIP_FAMILY_TURKS,"AMD Radeon HD 6650M",kNull},
{ 0x6741,0x05131025, CHIP_FAMILY_TURKS,"AMD Radeon HD 6650M",kNull},
{ 0x6741,0x1646103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6750M",kNull},
{ 0x6741,0x9080104D,CHIP_FAMILY_TURKS,"AMD Radeon HD 6630M",kNull},
{ 0x6758,0x67581002,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0x22051458,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0xE194174B,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0x31811682,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0x31831682,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6758,0xE1941746,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kBulrushes},
{ 0x6759,0xE193174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570",kNull},
{ 0x6760,0x04CC1028,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6490M",kNull},
{ 0x6760,0x1CB21043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M",kNull},
{ 0x6779,0x64501092,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450",kBulrushes},
{ 0x6760,0x1CB21043, CHIP_FAMILY_RV730,"AMD Radeon HD 6470M",kNull},
{ 0x6779,0xE164174B,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450",kBulrushes},
/* standard/default models */
{ 0x9400,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x9405,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 GT",kNull},
{ 0x6718,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kNull},
{ 0x6719,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950 Series",kNull},
{ 0x6720,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kNull},
{ 0x6738,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870 Series",kDuckweed},
{ 0x6739,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850 Series",kDuckweed},
{ 0x673E,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6790 Series",kNull},
{ 0x6740,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6700M Series",kNull},
{ 0x6741,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6600M/6700M Series", kNull},
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kBulrushes},
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kNull},
{ 0x6759,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6500 Series",kNull},
{ 0x6760,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400M Series",kNull},
{ 0x6761,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6430M Series",kNull},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kNull},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450 Series",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450 Series",kNull},
{ 0x0000,0x00000000, CHIP_FAMILY_UNKNOW,NULL,kNull}
};
if (!card->info->device_id || !card->info->cfg_name)
{
verbose("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%08x] \n",
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id);
printf("Unsupported card!\n");
return false;
}
card->mmio= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f);
card->io= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_4) & ~0x03);
verbose("ATI Framebuffer Addr: @0x%08X MMIO Addr: @0x%08X I/O Port Addr: @0x%08X ROM Addr: @0x%08X\n",
verbose("Framebuffer @0x%08X MMIO @0x%08XI/O Port @0x%08X ROM Addr @0x%08X\n",
card->fb, card->mmio, card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS));
card->posted = radeon_card_posted();
{
if (!load_vbios_file(kUseAtiROM, pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id))
{
verbose("reading Video BIOS from %s", card->posted ? "legacy space" : "PCI ROM");
verbose("reading VBIOS from %s", card->posted ? "legacy space" : "PCI ROM");
if (card->posted)
read_vbios(false);
else
{
// use the device fb key on radeon_cards, to retrive the default name from card_configs.
card->cfg_name = card_configs[card->info->cfg_name].name;
// Uncommented the following line and added verbose for debugging AtiPorts issues on some cards
card->ports = card_configs[card->info->cfg_name].ports;
// Report number of ports card reports
verbose("Card reported ports: %d\n", card->ports);
// and leave ports alone!
//card->ports = card_configs[card->info->cfg_name].ports;
// which means one of the fb's or kNull
verbose("Framebuffer set to: %s using device's default.\n", card->cfg_name);
verbose("Framebuffer set to device's default: %s\n", card->cfg_name);
}
else
{
// else, use the fb name returned by AtiConfig.
verbose("Framebuffer set to: %s using AtiConfig=%s\n", card->cfg_name, card->cfg_name);
verbose("(AtiConfig) Framebuffer set to: %s\n", card->cfg_name);
}
// Check AtiPorts key for nr of ports,
card->ports = getIntForKey(kAtiPorts, &n_ports, &bootInfo->chameleonConfig);
// if a value bigger than 0 ?? is found, (do we need >= 0 ?? that's null FB on card_configs)
if (n_ports > 0)
{
card->ports = n_ports; // use it.
verbose("Number of ports set to: %d using AtiPorts=%d\n", card->ports, card->ports);
verbose("(AtiPorts) Nr of ports set to: %d\n", card->ports);
}
else// if (card->cfg_name > 0) // do we want 0 ports if fb is kNull or mistyped ?
{
if (strcmp(card->cfg_name, card_configs[i].name) == 0)
card->ports = card_configs[i].ports; // default
verbose("Number of ports set to: %d using framebuffer's default.\n", card->ports);
verbose("Nr of ports set to framebuffer's default: %d\n", card->ports);
}
//else
//card->ports = 2/1 ?; // set a min if 0 ports ?
stringlength = string->length;
// -------------------------------------------------
verbose("%s %dMB [%04x:%04x] (subsys [%04x:%04x]) (%s:%s) :: %s\n",
card->info->model_name, (uint32_t)(card->vram_size / (1024 * 1024)),
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->cfg_name,
ati_dev->vendor_id, ati_dev->device_id,
ati_dev->subsys_id.subsys.vendor_id, ati_dev->subsys_id.subsys.device_id,
chip_family_name[card->info->chip_family], card->cfg_name,
devicepath);
free(card);
tags/2.0/i386/libsaio/fake_efi.c
7373
7474
7575
76
76
7777
7878
7979
......
525525
526526
527527
528
529528
530529
531530
......
621620
622621
623622
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639623
640624
641625
......
699683
700684
701685
702
703
704
705686
706687
707688
*/
/* Identify ourselves as the EFI firmware vendor */
static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','i','m','e','r','a','_','1','.','5', 0};
static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','0', 0};
static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */
/* Default platform system_id (fix by IntVar) */
EFI_CHAR16* ret16 = 0;
size_t len = 0;
Node*node;
node = DT__FindNode("/", false);
}
/*
* Populate the chosen node
*/
void setupChosenNode()
{
Node *chosenNode;
chosenNode = DT__FindNode("/chosen", false);
if (chosenNode == 0)
stop("Couldn't get chosen node");
int bootUUIDLength = strlen(gBootUUIDString);
if (bootUUIDLength)
DT__AddProperty(chosenNode, "boot-uuid", bootUUIDLength + 1, gBootUUIDString);
}
/*
* Load the smbios.plist override config file if any
*/
static void setupSmbiosConfigFile(const char *filename)
gST64->Hdr.CRC32 = 0;
gST64->Hdr.CRC32 = crc32(0L, gST64, gST64->Hdr.HeaderSize);
}
// Setup the chosen node
setupChosenNode();
}
void saveOriginalSMBIOS(void)
tags/2.0/i386/boot2/prompt.c
2828
2929
3030
31
31
3232
3333
3434
#include <vers.h>
char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n"
char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chameleon v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n"
"Build date: " I386BOOT_BUILDDATE "\n"
"%dMB memory\n";
tags/2.0/i386/boot2/boot.c
7272
7373
7474
75
75
7676
7777
7878
static chargCacheNameAdler[64 + 256];
char*gPlatformName = gCacheNameAdler;
chargRootDevice[ROOT_DEVICE_SIZE];
chargRootDevice[512];
chargMKextName[512];
chargMacOSVersion[8];
static chargBootKernelCacheFile[512];
tags/2.0/i386/boot2/boot.h
147147
148148
149149
150
151150
152151
153152
......
225224
226225
227226
228
229
230
231
232
227
228
229
233230
234231
235232
* A global set by boot() to record the device that the booter
* was loaded from.
*/
#define ROOT_DEVICE_SIZE 512
extern int gBIOSDev;
extern long gBootMode;
extern bool sysConfigValid;
/*
* options.c
*/
extern char gBootUUIDString[];
extern int getBootOptions(bool firstRun);
extern int processBootOptions();
extern int selectAlternateBootDevice(int bootdevice);
extern int getBootOptions(bool firstRun);
extern int processBootOptions();
extern int selectAlternateBootDevice(int bootdevice);
extern bool promptForRescanOption(void);
void showHelp();
tags/2.0/i386/boot2/options.c
10621062
10631063
10641064
1065
10661065
10671066
10681067
......
10711070
10721071
10731072
1074
1075
1076
10771073
10781074
10791075
......
10841080
10851081
10861082
1083
10871084
1088
10891085
10901086
10911087
......
11031099
11041100
11051101
1106
1107
1108
1109
1102
1103
1104
11101105
11111106
11121107
......
11231118
11241119
11251120
1126
1127
1128
1121
1122
1123
1124
11291125
11301126
11311127
......
11341130
11351131
11361132
1137
1138
1139
1140
1141
1142
1143
1144
1145
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
11461144
11471145
11481146
......
11981196
11991197
12001198
1201
1199
1200
12021201
12031202
12041203
1204
1205
1206
12051207
1206
1208
12071209
12081210
12091211
......
12191221
12201222
12211223
1222
1223
1224
1224
1225
1226
1227
1228
1229
12251230
12261231
12271232
12281233
12291234
1230
1231
1235
1236
12321237
1233
1234
1235
1238
1239
1240
12361241
12371242
12381243
1239
1240
1241
1242
1243
1244
1245
1244
1245
1246
1247
1248
1249
12461250
12471251
1248
1249
1252
12501253
12511254
12521255
......
12541257
12551258
12561259
1257
1260
12581261
12591262
12601263
......
12731276
12741277
12751278
1276
1277
1278
1279
1280
1279
1280
1281
1282
12811283
12821284
12831285
......
13211323
13221324
13231325
1326
13241327
1325
1326
1328
13271329
13281330
13291331
......
13351337
13361338
13371339
1338
1340
13391341
13401342
1341
1342
1343
1344
1343
1344
1345
13451346
13461347
1347
1348
13481349
13491350
13501351
1351
1352
1353
1354
1355
13561352
13571353
13581354
//==========================================================================
char gBootUUIDString[32+4+1] = ""; // UUID of the boot volume e.g. 5EB1869F-C4FA-3502-BDEB-3B8ED5D87292
extern unsigned char chainbootdev;
extern unsigned char chainbootflag;
int argLen = argName ? strlen(argName) : 0;
int len = argLen + cnt + 1; // +1 to account for space
if (argName)
len++; // +1 to account for '='
if (len > *cntRemainingP) {
error("Warning: boot arguments too long, truncating\n");
return false;
*argP += argLen;
*argP[0] = '=';
(*argP)++;
len++; // +1 to account for '='
}
strncpy( *argP, val, cnt );
*argP += cnt;
*argP[0] = ' ';
const char *userString, // Typed-in boot arguments
const char *kernelFlags, // Kernel flags from config table
const char *configTable,
char **argP, // Output value
int *cntRemainingP, // Output count
char *foundVal, // found value
int foundValSize // max found value size
char **argP, // Output value
int *cntRemainingP, // Output count
char *foundVal // found value
)
{
const char *val;
copyArgument(argName, val, cnt, argP, cntRemainingP);
found = true;
}
if (found && foundVal)
strlcpy(foundVal, val, foundValSize);
return found;
if (found && foundVal) {
strlcpy(foundVal, val, cnt+1);
}
return found;
}
// Maximum config table value size
int
processBootOptions()
{
const char*cp = gBootArgs;
const char*val = 0;
const char*kernel;
intcnt;
intuserCnt;
intcntRemaining;
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 uuidStr[64];
bool uuidSet = false;
char * configKernelFlags;
char * valueBuffer;
valueBuffer = malloc(VALUE_SIZE);
gOverrideKernel = false;
if (( kernel = extractKernelName((char **)&cp) )) {
strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) );
strcpy( bootInfo->bootFile, kernel );
gOverrideKernel = true;
} else {
if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) {
strlcpy( bootInfo->bootFile, val, cnt+1 );
if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) {
gOverrideKernel = true;
}
} else {
strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) );
strcpy( bootInfo->bootFile, kDefaultKernel );
}
}
configKernelFlags = malloc(cnt + 1);
strlcpy(configKernelFlags, val, cnt + 1);
// boot-uuid can be set either on the command-line or in the config file
if (!processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString))) {
if (processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, 0)) {
// boot-uuid was set either on the command-line
// or in the config file.
uuidSet = true;
} else {
//
// Try an alternate method for getting the root UUID on boot helper partitions.
//
if (gBootVolume->flags & kBVFlagBooter)
{
// Load the configuration store in the boot helper partition
if (loadHelperConfig(&bootInfo->helperConfig) == 0)
if((loadHelperConfig(&bootInfo->helperConfig) == 0)
&& getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig) )
{
val = getStringForKey(kHelperRootUUIDKey, &bootInfo->helperConfig);
if (val != NULL)
strlcpy(gBootUUIDString, val, sizeof(gBootUUIDString));
getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig);
copyArgument(kBootUUIDKey, val, cnt, &argP, &cntRemaining);
uuidSet = true;
}
}
// Try to get the volume uuid string
if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid)
gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString);
// If we have the volume uuid add it to the commandline arguments
if (strlen(gBootUUIDString))
copyArgument(kBootUUIDKey, gBootUUIDString, strlen(gBootUUIDString), &argP, &cntRemaining);
if (!uuidSet && gBootVolume->fs_getuuid && gBootVolume->fs_getuuid (gBootVolume, uuidStr) == 0) {
verbose("Setting boot-uuid to: %s\n", uuidStr);
copyArgument(kBootUUIDKey, uuidStr, strlen(uuidStr), &argP, &cntRemaining);
uuidSet = true;
}
}
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) {
if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gRootDevice)) {
cnt = 0;
if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) {
valueBuffer[0] = '*';
strlcpy(valueBuffer + 1, val, cnt);
val = valueBuffer;
} else {
if (strlen(gBootUUIDString)) {
if (uuidSet) {
val = "*uuid";
cnt = 5;
} else {
/*
* Removed. We don't need this anymore.
*
if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config,
&argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) {
getPlatformName(gPlatformName);
copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining);
}
if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gPlatformName)) {
getPlatformName(gPlatformName);
copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining);
}
*/
if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) &&
}
if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )
{
strlcpy(gMKextName, val, cnt + 1);
else
gMKextName[0]=0;
}
free(configKernelFlags);
free(valueBuffer);
//==========================================================================
// Load the help file and display the file contents on the screen.
static void showTextBuffer(char *buf_orig, int size)
static void showTextBuffer(char *buf, int size)
{
char*bp;
char* buf;
intline;
intline_offset;
intc;
intline;
intline_offset;
intc;
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
showInfoBox( "Press q to continue, space for next page.\n",buf_orig );
showInfoBox( "Press q to quit\n",buf );
return;
}
// 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') {
tags/2.0/package/Scripts/Standard/postinstall
5050
5151
5252
53
5453
5554
5655
......
292291
293292
294293
295
296
294
295
297296
298297
299
298
300299
301
302
300
301
303302
304303
305304
......
318317
319318
320319
321
322
320
321
323322
324323
325324
......
333332
334333
335334
336
335
337336
338337
339338
......
343342
344343
345344
346
345
347346
348347
349348
......
358357
359358
360359
360
361
362
363
361364
echo "bootdisk: Disk device is ${bootdisk}"
echo "bootrdisk: Disk raw device is ${bootrdisk}"
echo "diskloader: Disk loader is ${diskloader}"
echo "diskloaderdualboot: Disk loader is ${diskloaderdualboot}"
echo "partitionloaderhfs: Partition loader is ${partitionloaderhfs}"
echo "partitionloaderfat: Partition loader is ${partitionloaderfat}"
echo "filesystemloader: Filesystem loader is ${filesystemloader}"
#---------------------------------------------------------------------
if [ ${disksignature} == "00000000" ]; then
echo "Executing command: ${bootvolume}/usr/sbin/fdisk440 -u -f ${bootvolume}/usr/standalone/i386/${diskloader} -y ${bootdisk}"
"${bootvolume}/usr/sbin/fdisk440" -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloader} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
else
#---------------------------------------------------------------------
# If it exists then Windows is also installed on the HDD and we need to write $diskloaderdualboot
# If it exists then Windows is also installed on the HDD and we need to write boot0hfs
#---------------------------------------------------------------------
echo "Executing command: ${bootvolume}/usr/sbin/fdisk440 -u -f {bootvolume}/usr/standalone/i386/${diskloaderdualboot} -y ${bootdisk}"
"${bootvolume}/usr/sbin/fdisk440" -u -f "${bootvolume}/usr/standalone/i386/${diskloaderdualboot}" -y ${bootdisk}
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloaderdualboot} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloaderdualboot}" -y ${bootdisk}
fi
else
echo "Diskupdate is false, so no stage 0 file was written"
echo "Executing command: cp /usr/standalone/i386/${filesystemloader} ${bootvolume}"
cp "${bootvolume}/usr/standalone/i386/${filesystemloader}" "${bootvolume}"
echo "Executing command: "${bootvolume}/usr/bin/chflags" hidden ${bootvolume}/${filesystemloader}"
"${bootvolume}/usr/bin/chflags" hidden "${bootvolume}/${filesystemloader}"
echo "Executing command: ${bootresources}/Tools/SetFile -a V ${bootvolume}/${filesystemloader}"
"${bootresources}/Tools/SetFile" -a V "${bootvolume}/${filesystemloader}"
echo "-----------------------------------------------"
echo ""
if [ ${disksignature} == "00000000" ]; then
# echo "Windows is not installed so let's change the active partition"
partitionactive=$( "${bootvolume}/usr/sbin/fdisk440" -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
echo "Current Active Partition: ${partitionactive}"
if [ "${partitionactive}" = "${bootslice}" ]; then
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
"${bootvolume}/usr/sbin/fdisk440" -e ${bootrdisk} <<-MAKEACTIVE
fdisk440 -e ${bootrdisk} <<-MAKEACTIVE
print
flag ${bootslice}
write
echo ""
echo ""
# hide boot file
chflags hidden "${3}/boot"
echo "boot file hidden ${3}/boot"
exit
tags/2.0/Makefile
142142
143143
144144
145
146
145
147146
147
148148
149149
150150
@echo "#define I386BOOT_VERSION \"5.0.132\"" > $@
@echo "#define I386BOOT_BUILDDATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $@
@echo "#define I386BOOT_CHAMELEONVERSION \"`cat version`\"" >> $@
##@echo "#define I386BOOT_CHAMELEONREVISION \"`svnversion -n | tr -d [:alpha:]`\"" >> $@
@echo "#define I386BOOT_CHAMELEONREVISION \"1394\"" >> $@
@echo "#define I386BOOT_CHAMELEONREVISION \"`svnversion -n | tr -d [:alpha:]`\"" >> $@
.PHONY: $(SYMROOT)/i386/vers.h
.PHONY: config
.PHONY: clean

Archive Download the corresponding diff file

Revision: 1689