Chameleon

Chameleon Commit Details

Date:2017-07-03 19:33:45 (6 years 9 months ago)
Author:ErmaC
Commit:2887
Parents: 2886
Message:sync main Chameleon trunk with latest Enoch branch changes (r2886)
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/libsaio/ati.h
M/trunk/package/OptionalSettings/Control.txt
M/trunk/i386/libsaio/saio_types.h
M/trunk/i386/libsaio/xml.h
M/trunk/i386/boot2/boot.c
M/trunk/i386/libsaio/fake_efi.c
M/trunk/i386/libsaio/nvidia.c
M/trunk/i386/libsaio/ati.c
M/trunk/i386/libsa/prf.c
M/trunk/i386/libsa/strtol.c
M/trunk/i386/libsaio/load.c
M/trunk/i386/libsaio/smbios_decode.c
M/trunk/i386/libsaio/xml.c

File differences

trunk/i386/libsaio/xml.c
592592
593593
594594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614595
615596
616597
......
631612
632613
633614
615
616
617
618
619
620
621
622
623
624
625
626
627
634628
635629
636630
......
911905
912906
913907
914
915
908
909
910
916911
917
912
918913
919914
920915
......
927922
928923
929924
930
931
932
933
934
935
925
936926
937
927
928
929
938930
939931
940
941
932
942933
943934
944935
......
11061097
11071098
11081099
1100
1101
11091102
11101103
11111104
......
11411134
11421135
11431136
1137
1138
11441139
11451140
11461141
......
11821177
11831178
11841179
1180
11851181
11861182
11871183
}
}
/***** false ****/
else if (!strncmp(tagName, kXMLTagFalse, sizeof(kXMLTagFalse)))
{
length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse);
}
/***** true ****/
else if (!strncmp(tagName, kXMLTagTrue, sizeof(kXMLTagTrue)))
{
length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue);
}
/***** plist ****/
/***** dict ****/
/***** data ****/
else if (!strncmp(tagName, kXMLTagData, sizeof(kXMLTagData)))
{
{
length = ParseTagDate(buffer + pos, tag);
}
/***** false ****/
else if (!strncmp(tagName, kXMLTagFalse, sizeof(kXMLTagFalse)))
{
length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse);
}
/***** true ****/
else if (!strncmp(tagName, kXMLTagTrue, sizeof(kXMLTagTrue)))
{
length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue);
}
/***** array ****/
else if (!strncmp(tagName, kXMLTagArray, sizeof(kXMLTagArray) ))
{
// ParseTagData
static long ParseTagData( char *buffer, TagPtr *tag)
{
intactuallen = 0;
longlength = 0;
//intactuallen = 0;
int len = 0;
long length = 0;
TagPtrtmpTag;
char*string;
char*tmpString;
length = FixDataMatchingTag(buffer, kXMLTagData);
if (length == -1)
{
return -1;
}
//printf("ParseTagData unimplimented\n");
//printf("Data: %s\n", buffer);
//getchar();
string = BASE64Decode(buffer, strlen(buffer), &actuallen);
tmpString = NewSymbol(buffer);
tmpTag->type = kTagTypeData;
tmpTag->string = string;
tmpTag->string = tmpString;
tmpTag->data = (UInt8 *)BASE64Decode(buffer, strlen(buffer), &len);
tmpTag->dataLen = len;
tmpTag->tag = NULL;
tmpTag->offset = actuallen; // buffer_start ? buffer - buffer_start: 0;
tmpTag->offset = /* actuallen; */ buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = NULL;
*tag = tmpTag;
{
tag[cnt].type = kTagTypeNone;
tag[cnt].string = 0;
tag[cnt].data = 0;
tag[cnt].dataLen = 0;
tag[cnt].tag = 0;
tag[cnt].tagNext = tag + cnt + 1;
}
// Clear and free the tag.
tag->type = kTagTypeNone;
tag->string = NULL;
tag->data = NULL;
tag->dataLen = 0;
tag->tag = NULL;
tag->offset = 0;
tag->tagNext = gTagsFree;
if (symbol == NULL)
{
stop("NULL symbol!");
return NULL;
}
// Set the symbol's data.
trunk/i386/libsaio/xml.h
6262
6363
6464
65
66
6567
6668
6769
#define kXMLTagReference "reference"
#define kXMLStringID "ID="
#define kXMLStringIDRef "IDREF="
#define kXMLStringIDRefs "IDREFS="
#define kXMLTagSIZE "size="
#define kPropCFBundleIdentifier("CFBundleIdentifier")
#define kPropCFBundleExecutable("CFBundleExecutable")
trunk/i386/libsaio/nvidia.c
12521252
12531253
12541254
1255
1255
12561256
12571257
12581258
......
13231323
13241324
13251325
1326
13261327
13271328
13281329
......
13451346
13461347
13471348
1349
1350
13481351
13491352
13501353
......
13761379
13771380
13781381
1382
13791383
13801384
13811385
......
14251429
14261430
14271431
1432
1433
1434
14281435
14291436
14301437
14311438
14321439
14331440
1441
14341442
14351443
14361444
......
14381446
14391447
14401448
1449
1450
1451
14411452
14421453
14431454
......
16101621
16111622
16121623
1624
1625
16131626
16141627
16151628
//{ 0x10DE11E7,"GeForce " }, // GK106M
// 11F0 - 11FF
{ 0x10DE11FA,"Quadro K4000" },
{ 0x10DE11FC,"Quadro 2100M" },
{ 0x10DE11FC,"Quadro K2100M" },
{ 0x10DE11FF,"NB1Q" }, //
// 1200 - 120F
{ 0x10DE1200,"GeForce GTX 560 Ti" },
{ 0x10DE134E,"GeForce 930MX" }, // GM108M
{ 0x10DE134F,"GeForce 920MX" }, // GM108M
{ 0x10DE137A,"Quadro K620M/M500M" }, // GM108GLM
{ 0x10DE137B,"Quadro M520" },
{ 0x10DE137D,"GeForce 940A" }, // GM108M
{ 0x10DE1380,"GeForce GTX 750 Ti" },
{ 0x10DE1381,"GeForce GTX 750" },
{ 0x10DE13B1,"Quadro M1000M" }, // GM107GLM
{ 0x10DE13B2,"Quadro M600M" }, // GM107GLM
{ 0x10DE13B3,"Quadro K2200M" }, // GM107GLM
{ 0x10DE13B4,"Quadro M620" },
{ 0x10DE13B6,"Quadro M1200" },
{ 0x10DE13B9,"NVS 810" }, // GM107GL
{ 0x10DE13BA,"Quadro K2200" },
{ 0x10DE13BB,"Quadro K620" },
{ 0x10DE1427,"GeForce GTX 965M" }, // GM206M
{ 0x10DE1430,"Quadro M2000" }, //
{ 0x10DE1431,"Tesla M4" }, // GM206GL
{ 0x10DE1436,"Quadro M2200" },
//{ 0x10DE143F,"Graphics Device" }, //
//{ 0x10DE1600,"Graphics Device" }, //
//{ 0x10DE1601,"Graphics Device" }, //
{ 0x10DE1BB0,"Quadro P5000" }, // GP104GL
//{ 0x10DE1BB1,"Graphics Device" }, // GP104GL
//{ 0x10DE1BB4,"Graphics Device" }, // GP104GL
{ 0x10DE1BB6,"Quadro P5000" },
{ 0x10DE1BB7,"Quadro P4000" },
{ 0x10DE1BB8,"Quadro P3000" },
{ 0x10DE1BE0,"GeForce GTX 1080" }, //GP104M
{ 0x10DE1BE1,"GeForce GTX 1070" }, //GP104M
//{ 0x10DE1C00,"Graphics Device" }, // GP106
//{ 0x10DE1C01,"Graphics Device" }, // GP106
{ 0x10DE1C02, "GeForce GTX 1060"}, // GP106
{ 0x10DE1C03, "GeForce GTX 1060"}, // GP106
//{ 0x10DE1C07, "NVIDIA CMP6-1"}, //
{ 0x10DE1c20,"GeForce GTX 1060" }, //GP106M
//{ 0x10DE1C30,"Graphics Device" }, // GP106GL
{ 0x10DE1C60,"GeForce GTX 1060" }, // GP106M
//{ 0x10DE1C80,"Graphics Device" }, // GP107
//{ 0x10DE1C81,"Graphics Device" }, // GP107
{ 0x10DE1C82,"GeForce GTX 1050 Ti"}, // GP107
// 1D00 - 1EFFF
{ 0x10DE1D10,"GeForce MX150"},
};
static nvidia_card_info_t nvidia_card_exceptions[] = {
{ 0x10DE1140,0x10280565,"Dell GeForce GT 630M" },
{ 0x10DE1140,0x10280568,"Dell GeForce GT 630M" },
{ 0x10DE1140,0x144DC0D5,"Samsung GeForce GT 630M" },
{ 0x10DE1140,0x17AA2200,"nVidia NVS 5200M" },
{ 0x10DE1140,0x17AA2213,"nVidia GeForce GT 720M" },
{ 0x10DE1140,0x17AA500D,"Lenovo GeForce GT 620M" },
{ 0x10DE1140,0x1B0A20DD,"Pegatron GeForce GT 620M" },
{ 0x10DE1140,0x1B0A20FD,"Pegatron GeForce GT 620M" },
trunk/i386/libsaio/ati.c
103103
104104
105105
106
106107
107108
108
109109
110110
111111
......
113113
114114
115115
116
117
116118
117
118119
120
121
122
123
124
119125
126
127
128
129
130
120131
121
122
123
132
124133
125134
126135
......
11851194
11861195
11871196
1197
11881198
1189
1199
11901200
11911201
11921202
11931203
11941204
11951205
1196
1206
11971207
11981208
11991209
......
12151225
12161226
12171227
1218
1228
12191229
12201230
12211231
......
12431253
12441254
12451255
1246
1256
12471257
12481258
12491259
......
12511261
12521262
12531263
1254
1264
1265
12551266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
12561278
12571279
12581280
......
14151437
14161438
14171439
1418
1440
14191441
14201442
14211443
......
15401562
15411563
15421564
1543
1565
15441566
15451567
15461568
......
18421864
18431865
18441866
1867
1868
1869
18451870
18461871
18471872
{"Maguro",1},
{"MaguroS",6},
/* AMD8000Controller */
{"Exmoor",6},
{"Baladi", 6},
/* AMD9000Controller */
{"Exmoor",6},
{"MalteseS",1},
{"Lagotto",4},
{"GreyhoundS",1},
{"Basset",4},
{"Greyhound",6},
{"Labrador",6},
/* AMD9300Controller */
{"FlueveSWIP",4},
/* AMD9500Controller */
{"Elqui",5},
{"Acre",3},
{"Dayman",6},
{"Guariba",6},
{"Huallaga", 3},
{"Orinoco", 5},
/* AMD9510Controller */
{"Berbice",5},
/* AMD9515Controller */
{"Mazaruni", 5},
{"Longavi", 5},
/* AMD9520Controller */
{"Elqui",5},
{"Caroni",5},
{"Florin",6},
{"Dayman",6},
{"Guariba",6}
{"Florin",6}
};
static radeon_card_info_t radeon_cards[] = {
{ 0x6763,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon E6460 Series",kHydrilla},
{ 0x6768,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400M Series",kHydrilla},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kBulrushes},
{ 0x6771,0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8490",kBulrushes},
{ 0x6772,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400A Series",kBulrushes},
{ 0x6778,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7000 Series",kBulrushes},
{ 0x6778,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7470",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450/7450/8450/R5 230",kBulrushes},
{ 0x677B,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400 Series",kBulrushes},
// TAHITI
//Framebuffers: Aji - 4 Desktop, Buri - 4 Mobile, Chutoro - 5 Mobile, Dashimaki - 4, IkuraS - HMDI
// Ebi - 5 Mobile, Gari - 5 M, Futomaki - 4 D, Hamachi - 4 D, OPM - 6 Server, Ikura - 6
{ 0x6780,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kIkuraS},
{ 0x6780,0x00000000, CHIP_FAMILY_TAHITI,"AMD FirePro W9000",kIkuraS},
{ 0x6784,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6788,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x678A,0x00000000, CHIP_FAMILY_TAHITI,"AMD FirePro W8000",kFutomaki},
//{ 0x67A9,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67AA,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
{ 0x67B0,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290X", kBaladi},
{ 0x67B1,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290", kBaladi},
{ 0x67B1,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290/390", kBaladi},
//{ 0x67B8,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
{ 0x67B9,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 200", kFutomaki},
//{ 0x67BA,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
{ 0x67E9, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
{ 0x67EB, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
{ 0x67EF, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon RX460", kAcre },
{ 0x67FF, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
{ 0x67FF, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon RX560", kNull },
// Polaris 12
{ 0x6980, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6985, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6986, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6987, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x699F, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6995, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x699F, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon RX550", kNull },
// Vega 10
{ 0x6860,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6861,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6862,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6863,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6864,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6867,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6868,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x686C,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x687F,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
// PITCAIRN
{ 0x6800,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7970M",kBuri}, // Mobile
{ 0x6801,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 8970M Series",kFutomaki}, // Mobile
{ 0x7181, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ",kCaretta},
{ 0x7183, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ",kCaretta},
{ 0x7186, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ",kCaretta},
{ 0x7187, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ",kCaretta},
{ 0x7187, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD1900 ",kCaretta},
{ 0x7188, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD2300 Mobile ",kCaretta},
{ 0x718A, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ",kCaretta},
{ 0x718B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ",kCaretta},
{ 0x9452,0x00000000, CHIP_FAMILY_RV770,"AMD FireStream 9250",kMotmot},
{ 0x9456,0x00000000, CHIP_FAMILY_RV770,"ATI FirePro V8700 (FireGL)",kMotmot},
{ 0x945A,0x00000000, CHIP_FAMILY_RV770,"ATI Mobility Radeon HD 4870",kMotmot},
{ 0x9460,0x00000000, CHIP_FAMILY_RV770,"ATI Radeon HD 4800 Series",kMotmot},
{ 0x9460,0x00000000, CHIP_FAMILY_RV770,"ATI Radeon HD 4890",kMotmot},
{ 0x9462,0x00000000, CHIP_FAMILY_RV770,"ATI Radeon HD 4800 Series",kMotmot},
//{ 0x946A,0x00000000, CHIP_FAMILY_RV770,"ATI Mobility Radeon",kMotmot},
//{ 0x946B,0x00000000, CHIP_FAMILY_RV770,"ATI Mobility Radeon",kMotmot},
"Ellesmere",
"Baffin",
"Greenland",
"Vega10",
//"Vega11",
//"Navi",
""
};
trunk/i386/libsaio/load.c
256256
257257
258258
259
260
261
259
260
261
262262
263263
264264
......
274274
275275
276276
277
277
278278
279
280
279
280
281281
282282
283283
if (((long *)cmdBase)[0] == LC_SEGMENT_64)
{
struct segment_command_64 *segCmd;
segCmd = (struct segment_command_64 *)cmdBase;
vmaddr = (segCmd->vmaddr & 0x3fffffff);
vmsize = segCmd->vmsize;
segCmd = (struct segment_command_64 *)cmdBase;
vmaddr = (segCmd->vmaddr & 0x3fffffff);
vmsize = segCmd->vmsize;
fileaddr = (gBinaryAddress + segCmd->fileoff);
filesize = segCmd->filesize;
segname = segCmd->segname;
{
struct segment_command *segCmd;
segCmd = (struct segment_command *)cmdBase;
segCmd = (struct segment_command *)cmdBase;
vmaddr = (segCmd->vmaddr & 0x3fffffff);
vmsize = segCmd->vmsize;
vmaddr = (segCmd->vmaddr & 0x3fffffff);
vmsize = segCmd->vmsize;
fileaddr = (gBinaryAddress + segCmd->fileoff);
filesize = segCmd->filesize;
segname = segCmd->segname;
trunk/i386/libsaio/ati.h
9292
9393
9494
95
9596
9697
9798
9899
99100
100
101101
102
102103
103104
104105
......
108109
109110
110111
112
111113
112114
113115
......
199201
200202
201203
204
202205
203206
204
205207
206208
207209
......
209211
210212
211213
214
215
212216
213
214217
218
219
220
221
222
215223
224
225
226
227
228
216229
217230
218
219
220231
221232
222233
CHIP_FAMILY_PITCAIRN,
CHIP_FAMILY_VERDE,
CHIP_FAMILY_OLAND,
/* Sea Islands */
CHIP_FAMILY_HAINAN,
CHIP_FAMILY_BONAIRE,
CHIP_FAMILY_KAVERI,
CHIP_FAMILY_KABINI,
CHIP_FAMILY_HAWAII,
/* ... */
CHIP_FAMILY_MULLINS,
/* Volcanic Islands */
CHIP_FAMILY_TOPAZ,
CHIP_FAMILY_AMETHYST,
CHIP_FAMILY_TONGA,
CHIP_FAMILY_ELLESMERE, /* Polaris 10 */
CHIP_FAMILY_BAFFIN, /* Polaris 11 */
CHIP_FAMILY_GREENLAND, /* Polaris 12 */
CHIP_FAMILY_VEGA10, /* Vega 10 */
CHIP_FAMILY_LAST
} ati_chip_family_t;
kMaguro,
kMaguroS,
/* AMD8000Controller */
kExmoor,
kBaladi,
/* AMD9000Controller */
kExmoor,
kMalteseS,
kLagotto,
kGreyhoundS,
kBasset,
kGreyhound,
kLabrador,
/* AMD9300Controller */
kFleuveSWIP,
/* AMD9500Controller */
kElqui,
kAcre,
kDayman,
kGuariba,
kHuallaga,
kOrinoco,
/* AMD9510Controller*/
kBerbice,
/* AMD9515Controller */
kMazaruni,
kLongavi,
/* AMD9520Controller */
kElqui,
kCaroni,
kFlorin,
kDayman,
kGuariba,
kCfgEnd
} config_name_t;
trunk/i386/libsaio/smbios_decode.c
655655
656656
657657
658
658
659659
660
660
661661
662662
663663
//break;
/* Skip all Apple Specific Structures */
// case kSMBTypeFirmwareVolume: // Type 128
case kSMBTypeFirmwareVolume: // Type 128
// case kSMBTypeMemorySPD: // Type 130
//break;
break;
case kSMBTypeOemProcessorType: // Type 131
decodeOemProcessorType(structHeader);
trunk/i386/libsaio/saio_types.h
6161
6262
6363
64
65
6466
6567
6668
{
longtype;
char*string;
uint8_t*data;
longdataLen;
longoffset;
struct Tag *tag;
struct Tag *tagNext;
trunk/i386/libsaio/fake_efi.c
829829
830830
831831
832
832833
833834
834835
// booter-build-time (Fri Apr 14 16:21:16 PDT 2017) 10.12.5
DT__AddProperty(chosenNode, "booter-build-time", sizeof(I386BOOT_BUILDDATE), I386BOOT_BUILDDATE);
// booter-name
DT__AddProperty(chosenNode, "booter-name", sizeof("Chameleon"), "Chameleon");
trunk/i386/boot2/drivers.c
652652
653653
654654
655
656
657
658
659
660
655
656
657
658
659
660
661661
662662
663663
......
678678
679679
680680
681
681
682682
683683
684684
......
12521252
12531253
12541254
1255
1256
1257
1258
12591255
12601256
12611257
// LoadMatchedModules
long LoadMatchedModules( void )
{
TagPtr prop;
ModulePtr module;
char *fileName, segName[32];
DriverInfoPtr driver;
long length, driverAddr, driverLength;
void *executableAddr = 0;
TagPtrprop;
ModulePtrmodule;
char*fileName, segName[32];
DriverInfoPtrdriver;
longlength, driverAddr, driverLength;
void*executableAddr = 0;
module = gModuleHead;
length = LoadFile(gFileSpec);
executableAddr = (void *)kLoadAddr;
}
//printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar();
//printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar();
}
else
{
/* ================================================================ */
// Entry point
/* ================================================================ */
ret = DecodeMachO(binary, rentry, raddr, rsize);
if (ret < 0 && archCpuType == CPU_TYPE_X86_64)
{
trunk/i386/boot2/boot.c
10791079
10801080
10811081
1082
1083
1084
1082
1083
1084
10851085
1086
1087
1088
1089
1090
1091
10861092
1093
1094
1095
1096
1097
1098
1099
1100
10871101
10881102
10891103
......
11161130
11171131
11181132
1119
1133
11201134
11211135
11221136
......
11311145
11321146
11331147
1134
1148
11351149
11361150
11371151
......
11871201
11881202
11891203
1204
11901205
11911206
11921207
//
void setupBooterArgs()
{
bool KPRebootOption= false;
bool HiDPIOption= false;
bool FlagBlackOption= false;
bool KPRebootOption= false; // I don't want this by default ( It makes me angry because I do not see the reason for the panic)+
//bool HiDPIOption= false; // (Disabled by default) 10.8+
//bool FlagBlackOption= false; // (Disabled by default) 10.10+
// OS X Lion 10.7
if ( MacOSVerCurrent >= MacOSVer2Int("10.7") ) // Lion and Up!
{
// Pike R. Alpha: Adding a 16 KB log space.
bootArgs->performanceDataSize= 0;
bootArgs->performanceDataStart= 0;
// Pike R. Alpha: AppleKeyStore.kext
bootArgs->keyStoreDataSize= 0;
bootArgs->keyStoreDataStart= 0;
bootArgs->bootMemSize= 0;
bootArgs->bootMemStart= 0;
}
// OS X Mountain Lion 10.8
if ( MacOSVerCurrent >= MacOSVer2Int("10.8") ) // Mountain Lion and Up!
{
}
// OS X El Capitan 10.11
if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan and Sierra!
if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan, Sierra and High Sierra!
{
// ErmaC
verbose("\n");
if (isRecoveryHD || isInstaller || isOSXUpgrade || isMacOSXUpgrade)
{
// SIP can be controlled with or without FileNVRAM.kext (Pike R. Alpha)
bootArgs->flags|=(kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot);
bootArgs->flags|=(kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot + kBootArgsFlagInstallUI);
}
else
{
verbose("DTrace Restrictions: %s\n", ((csrValue & 0x20) == 0) ? "enabled":"disabled"); /* (1 << 5) Allow unrestricted dtrace */
verbose("NVRAM Protections: %s\n", ((csrValue & 0x40) == 0) ? "enabled":"disabled"); /* (1 << 6) Allow unrestricted NVRAM */
//verbose("DEVICE configuration: %s\n", ((csrValue & 0x80) == 0) ? "enabled":"disabled"); /* (1 << 7) Allow device configuration */
//verbose("Disable BaseSystem Verification: %s\n", ((csrValue & 0x100) == 0) ? "enabled":"disabled"); /* (1 << 8) Disable BaseSystem Verification */
}
verbose("\n");
}
trunk/i386/libsa/prf.c
3838
3939
4040
41
41
4242
4343
4444
45
45
46
4647
4748
4849
......
5253
5354
5455
56
57
58
5559
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
5688
5789
5890
59
60
61
62
63
91
92
93
94
95
96
97
98
6499
65
100
66101
67102
103
68104
69
105
106
70107
71
108
72109
73110
74
75
76
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
77139
78
79
80
81
82
83140
84
85
86
141
142
143
144
145
146
147
87148
88
149
89150
151
90152
91153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
92179
93
94
95
180
181
182
96183
97
184
98185
99
100
101
186
187
188
102189
103190
104191
105
192
193
106194
107195
108196
......
110198
111199
112200
113
201
114202
115203
116204
117205
206
207
118208
119209
120
210
211
121212
213
214
215
216
122217
123218
124219
......
149244
150245
151246
247
248
249
250
152251
153252
154253
155254
156255
157
256
158257
159
258
259
260
261
262
263
264
265
266
160267
161
162268
163269
164
165
166
270
271
272
273
274
275
276
277
278
167279
168
280
169281
282
283
284
285
286
287
170288
171289
172290
173291
174292
175
176
177
178
293
179294
180295
181296
182297
183298
184299
185
300
186301
187302
188303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
189321
190322
191323
192
193324
194325
*@(#)prf.c7.1 (Berkeley) 6/5/86
*/
#include <sys/param.h>
#include <stdarg.h>
#define SPACE1
#define ZERO2
#define UCASE 16
#define UCASE16
#define SIGNED32
/*
* Scaled down version of C Library printf.
*
*/
#define DIVIDEND_LOW *(unsigned int*) dividend
#define DIVIDEND_HIGH ((unsigned int*) dividend)[1]
/*
* Divides 64-bit dividend by 32-bit divisor.
* Quotient stored in dividend, remainder returned.
* Assumes little-endian byte order.
* Assumes divisor is non-zero.
*/
unsigned int i386_unsigned_div(
unsigned long long* dividend,
unsigned int divisor
)
{
unsigned int high = DIVIDEND_HIGH;
if (high >= divisor)
{
__asm__ volatile ("xorl %%edx, %%edx; divl %2" : "=a"(DIVIDEND_HIGH), "=d"(high) : "r"(divisor), "a"(high));
}
else
{
DIVIDEND_HIGH = 0;
}
__asm__ volatile("divl %2" : "+a"(DIVIDEND_LOW), "+d"(high) : "r"(divisor));
return high;
}
#undef DIVIDEND_HIGH
#undef DIVIDEND_LOW
/*
* Printn prints a number n in base b.
* We don't use recursion to avoid deep kernel stacks.
*/
static void printn(n, b, flag, minwidth, putfn_p, putfn_arg)
u_long n;
int b, flag, minwidth;
void (*putfn_p)();
void *putfn_arg;
static int printn(
unsigned long long n,
int b,
int flag,
int minwidth,
int (*putfn_p)(),
void* putfn_arg
)
{
char prbuf[11];
char prbuf[22];
register char *cp;
int width = 0, neg = 0;
static const char hexdig[] = "0123456789abcdef0123456789ABCDEF";
if (b == 10 && (int)n < 0) {
if ((flag & SIGNED) && (long long)n < 0)
{
neg = 1;
n = (unsigned)(-(int)n);
n = (unsigned long long)(-(long long)n);
}
cp = prbuf;
do {
*cp++ = "0123456789abcdef0123456789ABCDEF"[(flag & UCASE) + n%b];
n /= b;
if ((b & -b) == b)// b is a power of 2
{
unsigned int log2b = (unsigned int) (__builtin_ctz((unsigned int) b) & 31);
unsigned int mask = (unsigned int) (b - 1);
do
{
*cp++ = hexdig[(flag & UCASE) + (int) (n & mask)];
n >>= log2b;
width++;
}
while (n);
}
else// b is not a power of 2
{
do
{
*cp++ = hexdig[(flag & UCASE) + (int) i386_unsigned_div(&n, (unsigned int) b)];
width++;
}
while (n);
}
if (neg)
{
if (putfn_p)
{
(void)(*putfn_p)('-', putfn_arg);
}
width++;
} while (n);
if (neg) {
(*putfn_p)('-', putfn_arg);
width++;
}
while (width++ < minwidth)
(*putfn_p)( (flag & ZERO) ? '0' : ' ', putfn_arg);
if (!putfn_p)
{
return (width < minwidth) ? minwidth : width;
}
for (;width < minwidth; width++)
(void)(*putfn_p)( (flag & ZERO) ? '0' : ' ', putfn_arg);
do
(*putfn_p)(*--cp, putfn_arg);
(void)(*putfn_p)(*--cp, putfn_arg);
while (cp > prbuf);
return width;
}
/*
* Printp prints a pointer.
*/
static int printp(
const void* p,
int minwidth,
int (*putfn_p)(),
void* putfn_arg
)
{
int width = 0;
if (p)
{
if (putfn_p)
{
(void)(*putfn_p)('0', putfn_arg);
(void)(*putfn_p)('x', putfn_arg);
}
width = 2;
minwidth = ((minwidth >= 2) ? (minwidth - 2) : 0);
}
return width + printn((unsigned long long) p, 16, ZERO, minwidth, putfn_p, putfn_arg);
}
int prf(
char *fmt,
unsigned int *adx,
void (*putfn_p)(),
const char *fmt,
va_list ap,
int (*putfn_p)(),
void *putfn_arg
)
)
{
int b, c, len =0;
char *s;
int flag = 0, width = 0;
int b, c, len = 0;
const char *s;
int flag, width, ells;
int minwidth;
loop:
while ((c = *fmt++) != '%') {
while ((c = *fmt++) != '%')
{
if(c == '\0')
{
return len;
if (putfn_p)
{
(*putfn_p)(c, putfn_arg);
(void)(*putfn_p)(c, putfn_arg);
}
len++;
}
minwidth = 0;
flag = 0;
ells = 0;
again:
c = *fmt++;
switch (c) {
switch (c)
{
case 'l':
if (ells < 2)
{
++ells;
}
goto again;
case ' ':
flag |= SPACE;
b = 16;
goto number;
case 'd':
case 'i':
flag |= SIGNED;
/* fall through */
case 'u':
b = 10;
goto number;
case 'o': case 'O':
b = 8;
number:
if (putfn_p)
switch (ells)
{
printn((u_long)*adx, b, flag, minwidth, putfn_p, putfn_arg);
case 2:
len += printn(va_arg(ap, unsigned long long), b, flag, minwidth, putfn_p, putfn_arg);
break;
case 1:
len += printn(va_arg(ap, unsigned long), b, flag, minwidth, putfn_p, putfn_arg);
break;
default:
len += printn(va_arg(ap, unsigned int), b, flag, minwidth, putfn_p, putfn_arg);
break;
}
len++;
break;
case 's':
s = (char *)*adx;
while ((c = *s++)) {
if (putfn_p)
s = va_arg(ap, const char*);
if (!s)
{
s = "(null)";
}
width = 0;
if (!putfn_p)
{
while ((c = *s++))
{
(*putfn_p)(c, putfn_arg);
width++;
}
len += ((width < minwidth) ? minwidth : width);
break;
}
while ((c = *s++))
{
(void)(*putfn_p)(c, putfn_arg);
len++;
width++;
}
while (width++ < minwidth)
{
if (putfn_p)
{
(*putfn_p)(' ', putfn_arg);
}
(void)(*putfn_p)(' ', putfn_arg);
len++;
}
break;
case 'c':
if (putfn_p)
{
(*putfn_p)((char)*adx, putfn_arg);
(void)(*putfn_p)((char) va_arg(ap, int), putfn_arg);
}
len++;
break;
case '%':
if (putfn_p)
{
(void)(*putfn_p)('%', putfn_arg);
}
len++;
break;
case 'p':
len += printp(va_arg(ap, const void*), minwidth, putfn_p, putfn_arg);
break;
case 'n':
s = va_arg(ap, const char*);
if (s)
{
*(int*) s = len;
}
break;
default:
break;
}
adx++;
goto loop;
}
trunk/i386/libsa/strtol.c
324324
325325
326326
327
327
328328
329
329330
330331
331332
......
365366
366367
367368
368
369
369
370
370371
371372
372373
register const char *s = nptr;
register unsigned long long acc;
register int c;
register unsigned long long qbase, cutoff;
/* register */ unsigned long long qbase, cutoff;
register int neg, any, cutlim;
extern unsigned int i386_unsigned_div(unsigned long long*, unsigned int);
/*
* See strtoq for comments as to the logic used.
}
qbase = (unsigned)base;
cutoff = (unsigned long long)UQUAD_MAX / qbase;
cutlim = (unsigned long long)UQUAD_MAX % qbase;
cutoff = (unsigned long long)UQUAD_MAX;
cutlim = (int) i386_unsigned_div(&cutoff, (unsigned int) base);
for (acc = 0, any = 0;; c = *s++)
{
trunk/package/OptionalSettings/Control.txt
2828
2929
3030
31
31
3232
3333
3434
Bool@BootBanner:Boot Banner=No
Bool@GUI:GUI=No
Bool@LegacyLogo:Legacy Logo=Yes
#Bool@RebootOnPanic:RebootOnPanic=No
Bool@RebootOnPanic:RebootOnPanic=No
#Bool@EnableHiDPI:EnableHiDPI=Yes
Bool@BlackMode:BlackMode=Yes
Bool@InstantMenu:Instant Menu=Yes

Archive Download the corresponding diff file

Revision: 2887