Chameleon

Chameleon Commit Details

Date:2015-04-23 16:47:08 (8 years 11 months ago)
Author:MacMan
Commit:2658
Parents: 2657
Message:Added Braodwell CPU and IGP support. Useed Chameleon 2.2 r2421 as codebase.
Changes:
A/branches/Chimera/Chimera 4.1.0 Changes.txt
M/branches/Chimera/i386/modules/AcpiCodec/acpi_codec.c
M/branches/Chimera/i386/libsaio/nvidia.c
M/branches/Chimera/i386/boot2/modules.c
M/branches/Chimera/i386/libsaio/stringTable.c
M/branches/Chimera/i386/libsaio/aml_generator.c
M/branches/Chimera/i386/libsaio/pci.h
M/branches/Chimera/i386/libsaio/acpi_patcher.c
M/branches/Chimera/i386/libsaio/bootargs.h
M/branches/Chimera/i386/util/Makefile
M/branches/Chimera/i386/boot2/gui.c
M/branches/Chimera/i386/boot2/modules_support.s
M/branches/Chimera/i386/libsaio/device_inject.c
M/branches/Chimera/i386/libsaio/smbios.c
M/branches/Chimera/i386/boot2/gui.h
M/branches/Chimera/i386/boot2/lzss.c
M/branches/Chimera/i386/boot1/boot1hp.s
M/branches/Chimera/i386/boot1/Makefile
M/branches/Chimera/i386/libsaio/smbios.h
M/branches/Chimera/i386/boot2/picopng.c
M/branches/Chimera/i386/config/confdata.c
M/branches/Chimera/i386/libsaio/console.c
M/branches/Chimera/i386/libsaio/efi.h
M/branches/Chimera/i386/libsaio/vbe.c
M/branches/Chimera/i386/libsaio/device_tree.c
M/branches/Chimera/i386/libsaio/device_tree.h
M/branches/Chimera/i386/libsaio/saio_types.h
M/branches/Chimera/i386/boot0/boot0md.s
M/branches/Chimera/i386/libsaio/spd.c
M/branches/Chimera/i386/libsaio/smbios_getters.c
M/branches/Chimera/i386/libsaio/smbios_getters.h
M/branches/Chimera/i386/libsaio/smbios_decode.c
M/branches/Chimera/i386/boot2/Makefile
M/branches/Chimera/i386/libsaio/gma.c
M/branches/Chimera/i386/boot0/boot0hfs.s
M/branches/Chimera/i386/libsaio/bootstruct.c
M/branches/Chimera/i386/modules/KernelPatcher/Makefile
M/branches/Chimera/i386/libsaio/dram_controllers.c
M/branches/Chimera/i386/libsaio/gma.h
M/branches/Chimera/i386/include/sys/socket.h
M/branches/Chimera/i386/libsaio/bootstruct.h
M/branches/Chimera/i386/libsaio/load.c
M/branches/Chimera/i386/config/textbox.c
M/branches/Chimera/i386/libsaio/platform.c
M/branches/Chimera/i386/boot2/appleClut8.h
M/branches/Chimera/i386/libsaio/platform.h
M/branches/Chimera/i386/libsaio/disk.c
M/branches/Chimera/i386/libsaio/saio_internal.h
M/branches/Chimera/i386/libsaio/hda.c
M/branches/Chimera/i386/klibc/Makefile
M/branches/Chimera/i386/boot2/options.c
M/branches/Chimera/i386/boot2/graphics.c
M/branches/Chimera/i386/libsa/Makefile
M/branches/Chimera/i386/boot2/graphics.h
M/branches/Chimera/i386/libsaio/ati.c
M/branches/Chimera/i386/boot1/boot1h.s
M/branches/Chimera/i386/libsaio/sys.c
M/branches/Chimera/i386/libsaio/ati.h
M/branches/Chimera/i386/boot2/mboot.c
M/branches/Chimera/i386/boot2/prompt.c
M/branches/Chimera/i386/cdboot/Makefile
M/branches/Chimera/i386/libsaio/cpu.c
M/branches/Chimera/i386/libsaio/md5c.c
M/branches/Chimera/i386/libsaio/fake_efi.c
M/branches/Chimera/i386/libsa/zalloc.c
M/branches/Chimera/i386/boot0/Makefile
M/branches/Chimera/i386/boot0/boot0.s

File differences

branches/Chimera/i386/libsaio/smbios_getters.h
1717
1818
1919
20
21
20
21
2222
2323
2424
......
2727
2828
2929
30
30
3131
3232
3333
kSMBString,
kSMBByte,
kSMBWord,
kSMBDWord
//kSMBQWord
kSMBDWord,
kSMBQWord
} SMBValueType;
typedef union
uint8_tbyte;
uint16_tword;
uint32_tdword;
//uint64_tqword;
uint64_tqword;
} returnType;
extern bool getProcessorInformationExternalClock(returnType *value);
branches/Chimera/i386/libsaio/console.c
9191
9292
9393
94
95
94
9695
9796
9897
......
186185
187186
188187
189
188
189
190190
191191
192192
193
193
194
194195
195196
196197
......
220221
221222
222223
223
224
225
224226
225227
226228
227
229
230
228231
229232
230233
msgbuf = malloc(BOOTER_LOG_SIZE);
bzero(msgbuf, BOOTER_LOG_SIZE);
cursor = msgbuf;
//msglog("%s\n", "Chimera 4.0.0 Branch of " "Chameleon " I386BOOT_CHAMELEONVERSION " (svn-r" I386BOOT_CHAMELEONREVISION ")" " [" I386BOOT_BUILDDATE "]");
msglog("%s\n", "Chimera 4.0.1 Branch of Chameleon" " [" I386BOOT_BUILDDATE "]");
msglog("%s\n", "Chimera 4.1.0 Branch of Chameleon" " [" I386BOOT_BUILDDATE "]");
}
void msglog(const char * fmt, ...)
// Kabyl: BooterLog
struct putc_info pi;
if (!msgbuf) {
if (!msgbuf)
{
return 0;
}
if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) {
if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE)))
{
return 0;
}
pi.str = cursor;
// Kabyl: BooterLog
struct putc_info pi;
if (!msgbuf) {
if (!msgbuf)
{
return 0;
}
if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) {
if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE)))
{
return 0;
}
pi.str = cursor;
branches/Chimera/i386/libsaio/bootstruct.c
4747
4848
4949
50
50
5151
5252
5353
......
5555
5656
5757
58
58
5959
6060
6161
62
62
6363
6464
65
65
6666
6767
6868
6969
70
70
7171
7272
7373
7474
7575
76
76
7777
7878
7979
8080
8181
8282
83
83
8484
85
85
8686
8787
8888
......
9191
9292
9393
94
94
9595
96
96
9797
9898
99
99
100100
101101
102
102
103103
104104
105105
106106
107
108107
109108
110109
......
115114
116115
117116
118
119
120
117
121118
122119
123120
124121
125122
126123
127
128
124
125
126
129127
130128
131129
......
133131
134132
135133
136
137
134
135
136
138137
139138
140139
141
140
142141
143142
143
144144
145145
146146
147147
148
149
148
149
150
150151
151
152
153
152154
153155
154156
157
155158
156159
157160
161
158162
159163
160164
165
161166
167
162168
163169
164170
165171
172
166173
167174
168175
......
171178
172179
173180
174
181
175182
176183
177
184
178185
179186
180187
181
188
189
190
182191
183192
184
193
185194
186195
187196
188197
189198
190
199
191200
192201
193
202
194203
195204
196205
197206
198
207
199208
200209
201
210
202211
203212
204
213
205214
206215
207216
208
217
209218
210
219
211220
212221
213222
Node *node;
int nameLen;
static int init_done = 0;
if ( !init_done )
{
bootArgs = (boot_args *)malloc(sizeof(boot_args));
bootInfo = (PrivateBootInfo_t *)malloc(sizeof(PrivateBootInfo_t));
if (bootArgs == 0 || bootInfo == 0)
stop("Couldn't allocate boot info\n");
bzero(bootArgs, sizeof(boot_args));
bzero(bootArgsPreLion, sizeof(boot_args_pre_lion));
bzero(bootInfo, sizeof(PrivateBootInfo_t));
// Get system memory map. Also update the size of the
// conventional/extended memory for backwards compatibility.
bootInfo->memoryMapCount =
getMemoryMap( bootInfo->memoryMap, kMemoryMapCountMax,
(unsigned long *) &bootInfo->convmem,
(unsigned long *) &bootInfo->extmem );
if ( bootInfo->memoryMapCount == 0 )
{
// BIOS did not provide a memory map, systems with
// discontiguous memory or unusual memory hole locations
// may have problems.
bootInfo->convmem = getConventionalMemorySize();
bootInfo->extmem = getExtendedMemorySize();
}
bootInfo->configEnd = bootInfo->config;
bootArgs->Video.v_display = VGA_TEXT_MODE;
DT__Initialize();
node = DT__FindNode("/", true);
if (node == 0) {
stop("Couldn't create root node");
nameLen = strlen(platformName) + 1;
DT__AddProperty(node, "compatible", nameLen, platformName);
DT__AddProperty(node, "model", nameLen, platformName);
gMemoryMapNode = DT__FindNode("/chosen/memory-map", true);
bootArgs->Version = kBootArgsVersion;
bootArgs->Revision = kBootArgsRevision;
bootArgsPreLion->Version = kBootArgsPreLionVersion;
bootArgsPreLion->Revision = kBootArgsPreLionRevision;
init_done = 1;
}
}
/* Copy boot args after kernel and record address. */
void
void *oldAddr = bootArgs;
bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args));
bcopy(oldAddr, bootArgs, sizeof(boot_args));
}
else
{
} else {
void *oldAddr = bootArgsPreLion;
bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion));
bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion));
}
}
void
finalizeBootStruct(void)
//==============================================================================
void finalizeBootStruct(void)
{
uint32_t size;
void *addr;
EfiMemoryRange *memoryMap;
MemoryRange *range;
int memoryMapCount = bootInfo->memoryMapCount;
if (memoryMapCount == 0) {
if (memoryMapCount == 0)
{
// XXX could make a two-part map here
stop("Unable to convert memory map into proper format\n");
}
// convert memory map to boot_args memory map
memoryMap = (EfiMemoryRange *)AllocateKernelMemory(sizeof(EfiMemoryRange) * memoryMapCount);
bootArgs->MemoryMap = (uint32_t)memoryMap;
bootArgs->MemoryMapSize = sizeof(EfiMemoryRange) * memoryMapCount;
bootArgs->MemoryMapDescriptorSize = sizeof(EfiMemoryRange);
bootArgs->MemoryMapDescriptorVersion = 0;
for (i = 0; i < memoryMapCount; i++, memoryMap++) {
for (i = 0; i < memoryMapCount; i++, memoryMap++)
{
range = &bootInfo->memoryMap[i];
switch(range->type) {
switch(range->type)
{
case kMemoryRangeACPI:
memoryMap->Type = kEfiACPIReclaimMemory;
break;
case kMemoryRangeNVS:
memoryMap->Type = kEfiACPIMemoryNVS;
break;
case kMemoryRangeUsable:
memoryMap->Type = kEfiConventionalMemory;
break;
case kMemoryRangeReserved:
default:
memoryMap->Type = kEfiReservedMemoryType;
break;
}
memoryMap->PhysicalStart = range->base;
memoryMap->VirtualStart = range->base;
memoryMap->NumberOfPages = range->length >> I386_PGSHIFT;
// copy bootFile into device tree
// XXX
// add PCI info somehow into device tree
// XXX
// Flatten device tree
DT__FlattenDeviceTree(0, &size);
addr = (void *)AllocateKernelMemory(size);
if (addr == 0) {
if (addr == 0)
{
stop("Couldn't allocate device tree\n");
}
DT__FlattenDeviceTree((void **)&addr, &size);
bootArgs->deviceTreeP = (uint32_t)addr;
bootArgs->deviceTreeLength = size;
// Copy BootArgs values to older structure
memcpy(&bootArgsPreLion->CommandLine, &bootArgs->CommandLine, BOOT_LINE_LENGTH);
memcpy(&bootArgsPreLion->Video, &bootArgs->Video, sizeof(Boot_Video));
bootArgsPreLion->MemoryMap = bootArgs->MemoryMap;
bootArgsPreLion->MemoryMapSize = bootArgs->MemoryMapSize;
bootArgsPreLion->MemoryMapDescriptorSize = bootArgs->MemoryMapDescriptorSize;
bootArgsPreLion->MemoryMapDescriptorVersion = bootArgs->MemoryMapDescriptorVersion;
bootArgsPreLion->deviceTreeP = bootArgs->deviceTreeP;
bootArgsPreLion->deviceTreeLength = bootArgs->deviceTreeLength;
bootArgsPreLion->kaddr = bootArgs->kaddr;
bootArgsPreLion->ksize = bootArgs->ksize;
bootArgsPreLion->efiRuntimeServicesPageStart = bootArgs->efiRuntimeServicesPageStart;
bootArgsPreLion->efiRuntimeServicesPageCount = bootArgs->efiRuntimeServicesPageCount;
bootArgsPreLion->efiSystemTable = bootArgs->efiSystemTable;
bootArgsPreLion->efiMode = bootArgs->efiMode;
bootArgsPreLion->performanceDataStart = bootArgs->performanceDataStart;
bootArgsPreLion->performanceDataSize = bootArgs->performanceDataSize;
bootArgsPreLion->efiRuntimeServicesVirtualPageStart = bootArgs->efiRuntimeServicesVirtualPageStart;
branches/Chimera/i386/libsaio/efi.h
231231
232232
233233
234
234
235235
236236
237237
......
254254
255255
256256
257
257
258258
259259
260260
......
262262
263263
264264
265
265
266266
267267
268268
......
281281
282282
283283
284
284
285285
286286
287287
......
290290
291291
292292
293
293
294294
295295
296296
......
301301
302302
303303
304
304
305305
306306
307307
......
318318
319319
320320
321
321
322322
323323
324324
325325
326326
327327
328
328
329329
330330
331331
......
334334
335335
336336
337
337
338338
339339
340340
......
342342
343343
344344
345
345
346346
347347
348348
......
363363
364364
365365
366
366
367367
368368
369369
......
391391
392392
393393
394
394
395395
396396
397397
// range requires a runtime mapping
#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL
#define EFI_MEMORY_KERN_RESERVED (1ULL << 59)
typedef EFI_UINT64 EFI_PHYSICAL_ADDRESS;
typedef EFI_UINT64 EFI_VIRTUAL_ADDRESS;
IN EFI_UINTN DescriptorSize,
IN EFI_UINT32 DescriptorVersion,
IN EFI_MEMORY_DESCRIPTOR * VirtualMap
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
(EFIAPI *EFI_CONVERT_POINTER) (
IN EFI_UINTN DebugDisposition,
IN OUT VOID **Address
) __attribute__((regparm(0)));
);
// Variable attributes
OUT EFI_UINT32 * Attributes OPTIONAL,
IN OUT EFI_UINTN * DataSize,
OUT VOID * Data
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
IN OUT EFI_UINTN * VariableNameSize,
IN OUT EFI_CHAR16 * VariableName,
IN OUT EFI_GUID * VendorGuid
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
IN EFI_UINT32 Attributes,
IN EFI_UINTN DataSize,
IN VOID * Data
) __attribute__((regparm(0)));
);
// EFI Time
(EFIAPI *EFI_GET_TIME) (
OUT EFI_TIME * Time,
OUT EFI_TIME_CAPABILITIES * Capabilities OPTIONAL
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
EFI_STATUS
(EFIAPI *EFI_SET_TIME) (
IN EFI_TIME * Time
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
OUT EFI_BOOLEAN * Enabled,
OUT EFI_BOOLEAN * Pending,
OUT EFI_TIME * Time
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
(EFIAPI *EFI_SET_WAKEUP_TIME) (
IN EFI_BOOLEAN Enable,
IN EFI_TIME * Time OPTIONAL
) __attribute((regparm(0)));
);
typedef enum {
EfiResetCold,
IN EFI_STATUS ResetStatus,
IN EFI_UINTN DataSize,
IN EFI_CHAR16 * ResetData OPTIONAL
) __attribute__((regparm(0)));
);
typedef
EFI_RUNTIMESERVICE
IN EFI_UINT32 Instance,
IN EFI_GUID * CallerId OPTIONAL,
IN EFI_STATUS_CODE_DATA * Data OPTIONAL
) __attribute__((regparm(0)));
);
#endif
//
branches/Chimera/i386/libsaio/vbe.c
3434
3535
3636
37
37
3838
3939
4040
......
6666
6767
6868
69
69
7070
7171
7272
static biosBuf_t bb;
//==============================================================================
#if UNUSED
static inline void
outi (int port, int index, int val)
{
outb (port, index);
outb (port + 1, (inb (port + 1) & ~clear) | set);
}
#endif /* UNUSED */
//==============================================================================
int getVBEInfo( void * infoBlock )
branches/Chimera/i386/libsaio/bootstruct.h
4747
4848
4949
50
50
5151
5252
5353
......
7474
7575
7676
77
77
78
79
7880
7981
8082
......
9092
9193
9294
93
95
96
9497
9598
9699
/*
* Maximum number of boot drivers that can be loaded.
*/
#define NDRIVERS 500
#define NDRIVERS500
#define CONFIG_SIZE (40 * 4096)
unsigned char BIOSPresent;
} PCI_bus_info_t;
typedef struct {
typedef struct
{
unsigned long address; // address where driver was loaded
unsigned long size; // number of bytes
unsigned long type; // driver type
/*
* ACPI defined memory range types.
*/
enum {
enum
{
kMemoryRangeUsable = 1, // RAM usable by the OS.
kMemoryRangeReserved = 2, // Reserved. (Do not use)
kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
branches/Chimera/i386/libsaio/device_tree.c
398398
399399
400400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
401417
418
419
402420
403421
404422
}
//==============================================================================
// Bungo
Property *
DT__GetProperty(Node *node, const char *name)
{
Property *prop;
for (prop = node->properties; prop; prop = prop->next)
{
if (strcmp(prop->name, name) == 0)
{
return prop;
}
}
return NULL;
}
//==============================================================================
Node *
DT__FindNode(const char *path, bool createIfMissing)
{
branches/Chimera/i386/libsaio/acpi_patcher.c
2323
2424
2525
26
26
2727
2828
2929
......
112112
113113
114114
115
115
116116
117117
118118
......
136136
137137
138138
139
139
140140
141141
142142
......
147147
148148
149149
150
150
151151
152152
153153
......
161161
162162
163163
164
164
165165
166166
167167
168168
169169
170
170
171171
172172
173173
......
182182
183183
184184
185
185
186186
187187
188188
......
196196
197197
198198
199
199
200200
201201
202202
......
205205
206206
207207
208
208
209209
210210
211211
......
234234
235235
236236
237
237
238238
239239
240240
241241
242
242
243243
244244
245245
246246
247247
248248
249
249
250250
251251
252252
......
397397
398398
399399
400
400
401401
402402
403403
404
404
405405
406406
407407
......
419419
420420
421421
422
422
423423
424424
425425
426426
427
427
428428
429429
430430
......
587587
588588
589589
590
590
591591
592592
593593
......
608608
609609
610610
611
611
612612
613613
614614
......
658658
659659
660660
661
661
662662
663663
664664
665665
666
666
667667
668668
669669
......
689689
690690
691691
692
692
693693
694694
695695
......
717717
718718
719719
720
720
721721
722722
723723
......
726726
727727
728728
729
729
730730
731731
732732
......
734734
735735
736736
737
737
738738
739739
740740
......
747747
748748
749749
750
750
751751
752752
753753
......
756756
757757
758758
759
759
760760
761761
762762
......
772772
773773
774774
775
775
776776
777777
778778
......
794794
795795
796796
797
797
798798
799799
800800
......
803803
804804
805805
806
806
807807
808808
809809
......
823823
824824
825825
826
826827
827828
828829
......
840841
841842
842843
843
844
844
845
845846
846847
847848
......
849850
850851
851852
852
853
853854
854855
855856
......
866867
867868
868869
869
870
870871
871872
872873
......
876877
877878
878879
879
880
880881
881882
882883
......
914915
915916
916917
917
918
918919
919920
920921
922
921923
922924
923925
924926
925927
926928
927
928929
929930
930931
......
935936
936937
937938
938
939
939940
940941
941942
......
955956
956957
957958
958
959959
960960
961961
......
971971
972972
973973
974
974
975975
976976
977977
978978
979979
980
980981
981
982
983982
984983
985984
......
991990
992991
993992
994
993
995994
995
996996
997997
998998
......
10221022
10231023
10241024
1025
1025
10261026
10271027
10281028
......
10311031
10321032
10331033
1034
10341035
10351036
10361037
1037
1038
10381039
10391040
10401041
......
10451046
10461047
10471048
1048
1049
10491050
10501051
10511052
10521053
10531054
10541055
1055
1056
10561057
10571058
10581059
1060
10591061
10601062
10611063
10621064
10631065
10641066
1067
10651068
10661069
10671070
10681071
10691072
10701073
1071
1072
1073
1074
1075
10741076
10751077
10761078
......
11091111
11101112
11111113
1114
11121115
1113
1116
11141117
11151118
1116
11171119
11181120
1119
11201121
11211122
11221123
1123
1124
1124
11251125
11261126
1127
11281127
11291128
11301129
1131
11321130
11331131
11341132
......
11381136
11391137
11401138
1139
11411140
11421141
11431142
#elif DEBUG_ACPI==1
#define DBG(x...) printf(x)
#else
#define DBG(x...)
#define DBG(x...) msglog(x)
#endif
// Slice: New signature compare function
fd = open(dirSpec, 0);
if (fd < 0) {
// NOT FOUND:
verbose("ACPI Table not found: %s\n", filename);
DBG("ACPI Table not found: %s\n", filename);
*dirSpec = '\0';
}
}
{
if (read (fd, tableAddr, file_size (fd))!=file_size (fd))
{
printf("Couldn't read table %s\n",dirspec);
DBG("Couldn't read table %s\n",dirspec);
free (tableAddr);
close (fd);
return NULL;
return tableAddr;
}
close (fd);
printf("Couldn't allocate memory for table \n", dirspec);
DBG("Couldn't allocate memory for table \n", dirspec);
}
//printf("Couldn't find table %s\n", filename);
return NULL;
{
uint32_t i;
DBG("start finding cpu names. length %d\n", length);
DBG("Start finding cpu names. length %d\n", length);
for (i=0; i<length-7; i++)
{
if (dsdt[i] == 0x5B && dsdt[i+1] == 0x83) // ProcessorOP
{
DBG("dsdt: %x%x\n", dsdt[i], dsdt[i+1]);
DBG("DSDT: %x%x\n", dsdt[i], dsdt[i+1]);
uint32_t offset = i + 3 + (dsdt[i+2] >> 6);
if (!aml_isvalidchar(c))
{
add_name = false;
verbose("Invalid character found in ProcessorOP 0x%x!\n", c);
DBG("Invalid character found in ProcessorOP 0x%x!\n", c);
break;
}
}
if (acpi_cpu_count == 0)
acpi_cpu_p_blk = dsdt[i] | (dsdt[i+1] << 8);
verbose("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]);
DBG("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]);
if (++acpi_cpu_count == 32) {
return;
}
}
DBG("end finding cpu names: cpu names found: %d\n", acpi_cpu_count);
DBG("End finding cpu names: cpu names found: %d\n", acpi_cpu_count);
}
struct acpi_2_ssdt *generate_cst_ssdt(struct acpi_2_fadt* fadt)
};
if (Platform.CPU.Vendor != 0x756E6547) {
verbose ("Not an Intel platform: C-States will not be generated !!!\n");
DBG("Not an Intel platform: C-States will not be generated !!!\n");
return NULL;
}
if (fadt == NULL) {
verbose ("FACP not exists: C-States will not be generated !!!\n");
DBG("FACP not exists: C-States will not be generated !!!\n");
return NULL;
}
struct acpi_2_dsdt* dsdt = (void*)fadt->DSDT;
if (dsdt == NULL) {
verbose ("DSDT not found: C-States will not be generated !!!\n");
DBG("DSDT not found: C-States will not be generated !!!\n");
return NULL;
}
// dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt->Length);
verbose ("SSDT with CPU C-States generated successfully\n");
DBG("SSDT with CPU C-States generated successfully\n");
return ssdt;
} else {
verbose ("ACPI CPUs not found: C-States not generated !!!\n");
DBG("ACPI CPUs not found: C-States not generated !!!\n");
}
return NULL;
};
if (Platform.CPU.Vendor != 0x756E6547) {
verbose ("Not an Intel platform: P-States will not be generated !!!\n");
DBG("Not an Intel platform: P-States will not be generated !!!\n");
return NULL;
}
if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) {
verbose ("Unsupported CPU: P-States will not be generated !!! No MSR support\n");
DBG("Unsupported CPU: P-States will not be generated !!! No MSR support\n");
return NULL;
}
minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff;
verbose("P-States: min 0x%x, max 0x%x\n", minimum.Control, maximum.Control);
DBG("P-States: min 0x%x, max 0x%x\n", minimum.Control, maximum.Control);
// Sanity check
if (maximum.Control < minimum.Control) {
break;
}
default:
verbose ("Unsupported CPU (0x%X): P-States not generated !!!\n", Platform.CPU.Family);
DBG("Unsupported CPU (0x%X): P-States not generated !!!\n", Platform.CPU.Family);
break;
}
}
//dumpPhysAddr("P-States SSDT content: ", ssdt, ssdt->Length);
verbose ("SSDT with CPU P-States generated successfully\n");
DBG("SSDT with CPU P-States generated successfully\n");
return ssdt;
}
} else {
verbose ("ACPI CPUs not found: P-States not generated !!!\n");
DBG("ACPI CPUs not found: P-States not generated !!!\n");
}
return NULL;
getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig);
}
} else {
verbose ("Not an Intel platform: Restart Fix not applied !!!\n");
DBG("Not an Intel platform: Restart Fix not applied !!!\n");
fix_restart = false;
}
} else {
Platform.Type = 1;/* Set a fixed value (Desktop) */
}
verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type);
DBG("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type);
} else {
Platform.Type = (unsigned char) strtoul(value, NULL, 10);
}
if (fadt_mod->PM_Profile != Platform.Type) {
if (value) {
// user has overriden the SystemType so take care of it in FACP
verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type);
DBG("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type);
fadt_mod->PM_Profile = Platform.Type;
} else {
// PM_Profile has a different value and no override has been set, so reflect the user value to ioregs
}
}
// We now have to write the systemm-type in ioregs: we cannot do it before in setupDeviceTree()
// because we need to take care of facp original content, if it is correct.
// because we need to take care of FACP original content, if it is correct.
setupSystemType();
// Patch FADT to fix restart
fadt_mod->Reset_AccessWidth= 0x01; // Byte access
fadt_mod->Reset_Address= 0x64; // Address of the register
fadt_mod->Reset_Value= 0xfe; // Value to write to reset the system
msglog("FADT: PS2 Restart Fix applied!\n");
DBG("FADT: PS2 Restart Fix applied!\n");
} else {
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID= 0x01; // System I/O
fadt_mod->Reset_AccessWidth= 0x01; // Byte access
fadt_mod->Reset_Address= 0x0cf9; // Address of the register
fadt_mod->Reset_Value= 0x06; // Value to write to reset the system
verbose("FADT: ACPI Restart Fix applied!\n");
DBG("FADT: ACPI Restart Fix applied!\n");
}
}
DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT);
verbose("FADT: Using custom DSDT!\n");
DBG("FADT: Using custom DSDT!\n");
}
// Correct the checksum
if(acpi20_p) {
addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20");
} else {
verbose("No ACPI 2.\n");
DBG("No ACPI 2.\n");
}
return 1;
}
int setupAcpi(void)
{
int version;
void *new_dsdt;
void *new_dsdt = NULL;
const char *filename;
// Load replacement DSDT
new_dsdt = loadACPITable(dirSpec);
// Mozodojo: going to patch FACP and load SSDT's even if DSDT.aml is not present
/*if (!new_dsdt)
{
getBoolForKey(kGeneratePStates, &generate_pstates, &bootInfo->chameleonConfig);
getBoolForKey(kGenerateCStates, &generate_cstates, &bootInfo->chameleonConfig);
DBG("Generating P-States config: %d\n", generate_pstates);
DBG("Generating C-States config: %d\n", generate_cstates);
DBG("Generating P-States config: %s\n", generate_pstates ? "YES" : "NO");
DBG("Generating C-States config: %s\n", generate_cstates ? "YES" : "NO");
{
int i;
for (i = 0; i < 30; i++) {
char filename[512];
sprintf(filename, i > 0?"SSDT-%d.aml":"SSDT.aml", i);
sprintf(filename, i > 0 ? "SSDT-%d.aml" : "SSDT.aml", i);
if ( (new_ssdt[ssdt_count] = loadACPITable(filename)) ) {
ssdt_count++;
int rsdplength;
// Find original rsdp
rsdp=(struct acpi_2_rsdp *)(version?getAddressOfAcpi20Table():getAddressOfAcpiTable());
rsdp=(struct acpi_2_rsdp *)(version ? getAddressOfAcpi20Table() : getAddressOfAcpiTable());
if (!rsdp) {
DBG("No ACPI version %d found. Ignoring\n", version+1);
if (version) {
}
continue;
}
rsdplength=version?rsdp->Length:20;
rsdplength=version ? rsdp->Length : 20;
DBG("RSDP version %d found @%x. Length=%d\n",version+1,rsdp,rsdplength);
rsdt_entries[i-dropoffset]=rsdt_entries[i];
if (drop_ssdt && tableSign(table, "SSDT")) {
verbose("OEM SSDT tables was dropped\n");
DBG("OEM SSDT tables was dropped\n");
dropoffset++;
continue;
}
if (tableSign(table, "DSDT")) {
DBG("DSDT found\n");
verbose("Custom DSDT table was found\n");
if(new_dsdt) {
rsdt_entries[i-dropoffset]=(uint32_t)new_dsdt;
}
continue;
}
DBG("FADT found @%x, Length %d\n",fadt, fadt->Length);
if (!fadt || (uint32_t)fadt == 0xffffffff || fadt->Length>0x10000) {
printf("FADT incorrect. Not modified\n");
DBG("FADT incorrect. Not modified\n");
continue;
}
generate_pstates = false; // Generate SSDT only once!
ssdt_count++;
}
continue;
}
}
rsdt_entries=(uint32_t *)(rsdt_mod+1);
// Mozodojo: Insert additional SSDTs into RSDT
if(ssdt_count>0) {
if(ssdt_count > 0) {
int j;
for (j=0; j<ssdt_count; j++) {
rsdt_entries[i-dropoffset+j]=(uint32_t)new_ssdt[j];
}
DBG("RSDT: Added %d SSDT table(s)\n", ssdt_count);
verbose("RSDT: Added %d SSDT table(s)\n", ssdt_count);
}
// Correct the checksum of RSDT
DBG("New checksum %d at %x\n", rsdt_mod->Checksum,rsdt_mod);
} else {
rsdp_mod->RsdtAddress=0;
printf("RSDT not found or RSDT incorrect\n");
DBG("RSDT not found or RSDT incorrect\n");
}
DBG("\n");
if (version) {
struct acpi_2_xsdt *xsdt, *xsdt_mod;
xsdt_entries[i-dropoffset]=xsdt_entries[i];
if (drop_ssdt && tableSign(table, "SSDT")) {
verbose("OEM SSDT tables was dropped\n");
DBG("OEM SSDT tables was dropped\n");
dropoffset++;
continue;
}
if (new_dsdt) {
xsdt_entries[i-dropoffset]=(uint32_t)new_dsdt;
DBG("Custom Table Added\n");
}
DBG("TABLE %c%c%c%c@%x \n", table[0],table[1],table[2],table[3],xsdt_entries[i]);
continue;
}
if (tableSign(table, "FACP")) {
fadt->Length);
if (!fadt || (uint64_t)xsdt_entries[i] >= 0xffffffff || fadt->Length>0x10000) {
verbose("FADT incorrect or after 4GB. Dropping XSDT\n");
DBG("FADT incorrect or after 4GB. Dropping XSDT\n");
goto drop_xsdt;
}
fadt_mod = patch_fadt(fadt, new_dsdt);
xsdt_entries[i-dropoffset]=(uint32_t)fadt_mod;
DBG("TABLE %c%c%c%c@%x \n", table[0],table[1],table[2],table[3],xsdt_entries[i]);
// DBG("TABLE %c%c%c%c@%x \n", table[0],table[1],table[2],table[3],xsdt_entries[i]);
// Generate _CST SSDT
if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) {
DBG("C-States generated\n");
generate_cstates = false; // Generate SSDT only once!
ssdt_count++;
}
// Generating _PSS SSDT
if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) {
DBG("P-States generated\n");
generate_pstates = false; // Generate SSDT only once!
ssdt_count++;
}
continue;
}
DBG("TABLE %c%c%c%c@%x \n", table[0],table[1],table[2],table[3],xsdt_entries[i]);
DBG("copied (OEM)\n");
// DBG("TABLE %c%c%c%c@%x \n", table[0],table[1],table[2],table[3],xsdt_entries[i]);
}
// Allocate xsdt in Kernel memory area
verbose("XSDT not found or XSDT incorrect\n");
}
}
DBG("\n");
// Correct the checksum of RSDP
// Correct the checksum of RSDP
DBG("RSDP: Original checksum %d, ", rsdp_mod->Checksum);
rsdp_mod->Checksum=0;
rsdp_mod->Checksum=256-checksum8(rsdp_mod,20);
DBG("New checksum %d\n", rsdp_mod->Checksum);
if (version) {
DBG("RSDP: Original extended checksum %d", rsdp_mod->ExtendedChecksum);
DBG("RSDP: Original extended checksum %d, ", rsdp_mod->ExtendedChecksum);
rsdp_mod->ExtendedChecksum=0;
rsdp_mod->ExtendedChecksum=256-checksum8(rsdp_mod,rsdp_mod->Length);
DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum);
}
//verbose("Patched ACPI version %d DSDT\n", version+1);
if (version) {
/* XXX aserebln why uint32 cast if pointer is uint64 ? */
acpi20_p = (uint64_t)(uint32_t)rsdp_mod;
acpi10_p = (uint64_t)(uint32_t)rsdp_mod;
addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI");
}
DBG("ACPI version %d patching finished\n\n", version+1);
}
#if DEBUG_ACPI
printf("Press a key to continue... (DEBUG_ACPI)\n");
branches/Chimera/i386/libsaio/device_tree.h
6767
6868
6969
70
71
72
7073
7174
7275
extern char *
DT__GetName(Node *node);
extern Property *
DT__GetProperty(Node *node, const char *name);
void
DT__Initialize(void);
branches/Chimera/i386/libsaio/bootargs.h
109109
110110
111111
112
113
112
113
114114
115115
116116
117117
118118
119
119
120120
121121
122122
......
178178
179179
180180
181
181
182182
183183
184184
/* Snapshot constants of previous revisions that are supported */
#define kBootArgsEfiMode3232
#define kBootArgsEfiMode6464
#define kBootArgsEfiMode32 32
#define kBootArgsEfiMode64 64
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 efiMode; /* 32 means 32-bit mode, 64 means 64-bit mode */
uint8_t debugMode; /* Bit field with behavior changes */
uint8_t __reserved1[2];
uint32_t efiRuntimeServicesPageCount;
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint8_t efiMode; /* 32 means 32-bit mode, 64 means 64-bit mode */
uint8_t __reserved1[3];
uint32_t __reserved2[1];
uint32_t performanceDataStart; /* physical address of log */
branches/Chimera/i386/libsaio/spd.c
3030
3131
3232
33
33
3434
35
35
3636
3737
3838
39
40
39
40
4141
4242
4343
......
382382
383383
384384
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
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
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
411463
412464
413465
"RAM", /* 00h Undefined */
"FPM", /* 01h FPM */
"EDO", /* 02h EDO */
"",/* 03h PIPELINE NIBBLE */
"", /* 03h PIPELINE NIBBLE */
"SDRAM", /* 04h SDRAM */
"",/* 05h MULTIPLEXED ROM */
"", /* 05h MULTIPLEXED ROM */
"DDR SGRAM",/* 06h SGRAM DDR */
"DDR SDRAM",/* 07h SDRAM DDR */
"DDR2 SDRAM", /* 08h SDRAM DDR 2 */
"",/* 09h Undefined */
"",/* 0Ah Undefined */
"", /* 09h Undefined */
"", /* 0Ah Undefined */
"DDR3 SDRAM"/* 0Bh SDRAM DDR 3 */
};
static struct smbus_controllers_t smbus_controllers[] = {
{0x8086, 0x1C22, "6 Series", read_smb_intel },
{0x8086, 0x1D22, "C600/X79 Series", read_smb_intel },
{0x8086, 0x1D70, "C600/X79 Series", read_smb_intel },
{0x8086, 0x1D71, "C608/C606/X79 Series", read_smb_intel },
{0x8086, 0x1D72, "C608", read_smb_intel },
{0x8086, 0x1E22, "7 Series/C210 Series", read_smb_intel },
{0x8086, 0x2330, "DH89xxCC", read_smb_intel },
{0x8086, 0x2413, "82801AA", read_smb_intel },
{0x8086, 0x2423, "82801BA/BAM", read_smb_intel },
{0x8086, 0x2443, "82801BA/BAM", read_smb_intel },
{0x8086, 0x2483, "82801CA/CAM", read_smb_intel },
{0x8086, 0x24C3, "82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)", read_smb_intel },
{0x8086, 0x24D3, "82801EB/ER (ICH5/ICH5R)", read_smb_intel },
{0x8086, 0x25A4, "6300ESB", read_smb_intel },
{0x8086, 0x266A, "82801FB/FBM/FR/FW/FRW (ICH6 Family)", read_smb_intel },
{0x8086, 0x269B, "631xESB/632xESB/3100", read_smb_intel },
{0x8086, 0x27DA, "N10/ICH 7 Family", read_smb_intel },
{0x8086, 0x283E, "82801H (ICH8 Family) ", read_smb_intel },
{0x8086, 0x2930, "82801I (ICH9 Family)", read_smb_intel },
{0x8086, 0x3A30, "82801JI (ICH10 Family)", read_smb_intel },
{0x8086, 0x3A60, "82801JD/DO (ICH10 Family)", read_smb_intel },
{0x8086, 0x3B30, "5 Series/3400 Series", read_smb_intel },
{0x8086, 0x5032, "EP80579", read_smb_intel },
{0x8086, 0x8C22, "8 Series/C220", read_smb_intel },
{0x8086, 0x9C22, "Lynx Point-LP", read_smb_intel }
{0x8086, 0x1C22, "6 Series/C200 Series", read_smb_intel },
{0x8086, 0x1C41, "Mobile 6 Series", read_smb_intel },
{0x8086, 0x1C42, "6 Series/C200 Series", read_smb_intel },
{0x8086, 0x1C43, "Mobile 6 Series", read_smb_intel },
{0x8086, 0x1C44, "6 Series", read_smb_intel },
{0x8086, 0x1C46, "6 Series", read_smb_intel },
{0x8086, 0x1C47, "6 Series", read_smb_intel },
{0x8086, 0x1C49, "Mobile 6 Series", read_smb_intel },
{0x8086, 0x1C4A, "6 Series", read_smb_intel },
{0x8086, 0x1C4B, "Mobile 6 Series", read_smb_intel },
{0x8086, 0x1C4C, "6 Series", read_smb_intel },
{0x8086, 0x1C4D, "6 Series", read_smb_intel },
{0x8086, 0x1C4E, "6 Series", read_smb_intel },
{0x8086, 0x1C4F, "Mobile 6 Series", read_smb_intel },
{0x8086, 0x1C50, "6 Series", read_smb_intel },
{0x8086, 0x1C52, "6 Series/C202 Series", read_smb_intel },
{0x8086, 0x1C54, "6 Series/C204 Series", read_smb_intel },
{0x8086, 0x1C56, "6 Series/C206 Series", read_smb_intel },
{0x8086, 0x1C5C, "6 Series", read_smb_intel },
{0x8086, 0x1D22, "C600/X79 Series", read_smb_intel },
{0x8086, 0x1D41, "C600/X79 Series", read_smb_intel },
{0x8086, 0x1D70, "C600/X79 Series", read_smb_intel },
{0x8086, 0x1D71, "C608/C606/X79 series", read_smb_intel },
{0x8086, 0x1D72, "C608", read_smb_intel },
{0x8086, 0x1E22, "7 Series/C210 Series", read_smb_intel },
{0x8086, 0x1E42, "7 Series", read_smb_intel },
{0x8086, 0x1E43, "7 Series", read_smb_intel },
{0x8086, 0x1E44, "7 Series", read_smb_intel },
{0x8086, 0x1E55, "Mobile 7 Series", read_smb_intel },
{0x8086, 0x1E56, "7 Series", read_smb_intel },
{0x8086, 0x1E57, "Mobile 7 Series", read_smb_intel },
{0x8086, 0x1E58, "Mobile 7 Series", read_smb_intel },
{0x8086, 0x1E59, "Mobile 7 Series", read_smb_intel },
{0x8086, 0x1E5D, "Mobile 7 Series", read_smb_intel },
{0x8086, 0x2330, "DH89xxCC", read_smb_intel },
{0x8086, 0x2413, "82801AA", read_smb_intel },
{0x8086, 0x2423, "82801AB", read_smb_intel },
{0x8086, 0x2443, "82801BA/BAM", read_smb_intel },
{0x8086, 0x2483, "82801CA/CAM", read_smb_intel },
{0x8086, 0x24C3, "82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)", read_smb_intel },
{0x8086, 0x24D3, "82801EB/ER (ICH5/ICH5R)", read_smb_intel },
{0x8086, 0x25A4, "6300ESB", read_smb_intel },
{0x8086, 0x266A, "82801FB/FBM/FR/FW/FRW (ICH6 Family)", read_smb_intel },
{0x8086, 0x2670, "631xESB/632xESB/3100", read_smb_intel },
{0x8086, 0x269B, "631xESB/632xESB/3100", read_smb_intel },
{0x8086, 0x27B9, "82801GBM (ICH7-M)", read_smb_intel },
{0x8086, 0x27BD, "82801GHM (ICH7-M DH)", read_smb_intel },
{0x8086, 0x27DA, "82801GB/GBM/GR/GH/GHM (ICH7 Family)", read_smb_intel },
{0x8086, 0x2811, "82801HEM (ICH8M-E)", read_smb_intel },
{0x8086, 0x2815, "82801HM (ICH8M)", read_smb_intel },
{0x8086, 0x283E, "82801H (ICH8 Family) ", read_smb_intel },
{0x8086, 0x2916, "82801IR (ICH9R)", read_smb_intel },
{0x8086, 0x2930, "82801I (ICH9 Family)", read_smb_intel },
{0x8086, 0x3A18, "82801JIB (ICH10)", read_smb_intel },
{0x8086, 0x3A30, "82801JI (ICH10 Family)", read_smb_intel },
{0x8086, 0x3A60, "82801JD/DO (ICH10 Family)", read_smb_intel },
{0x8086, 0x3B00, "5 Series/3400 Series", read_smb_intel },
{0x8086, 0x3B01, "Mobile 5 Series", read_smb_intel },
{0x8086, 0x3B02, "5 Series", read_smb_intel },
{0x8086, 0x3B09, "Mobile 5 Series", read_smb_intel },
{0x8086, 0x3B30, "5 Series/3400 Series", read_smb_intel },
{0x8086, 0x5032, "EP80579", read_smb_intel },
{0x8086, 0x8119, "6 Series/C200 Series", read_smb_intel },
{0x8086, 0x8119, "US15W", read_smb_intel },
{0x8086, 0x8C22, "8 Series/C220 Series", read_smb_intel },
{0x8086, 0x8C44, "8 Series", read_smb_intel },
{0x8086, 0x8C4B, "Mobile 8 Series", read_smb_intel },
{0x8086, 0x8CA2, "9 Series", read_smb_intel },
{0x8086, 0x8D22, "X99/C610 Series", read_smb_intel },
{0x8086, 0x9C22, "8 Series", read_smb_intel },
{0x8086, 0x9C43, "8 Series", read_smb_intel },
{0x8086, 0x9CC1, "9 Series", read_smb_intel },
{0x8086, 0x9CC2, "9 Series", read_smb_intel },
{0x8086, 0x9CC3, "9 Series", read_smb_intel },
{0x8086, 0x9CC5, "9 Series", read_smb_intel },
{0x8086, 0x9CC6, "9 Series", read_smb_intel },
{0x8086, 0x9CC7, "9 Series", read_smb_intel },
{0x8086, 0x9CC9, "9 Series", read_smb_intel }
};
// initial call : pci_dt = root_pci_dev;
branches/Chimera/i386/libsaio/gma.c
333333
334334
335335
336
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
337363
338364
339365
......
384410
385411
386412
413
387414
388415
389416
......
482509
483510
484511
485
512
486513
487514
488515
489516
490517
491518
492
519
493520
494521
495522
......
515542
516543
517544
518
545
519546
520547
521548
522549
523550
524551
525
552
526553
527554
528555
......
535562
536563
537564
538
565
539566
540567
541568
542569
543570
544571
545
572
546573
547574
548575
549
576
550577
551578
552579
553580
554581
555582
556
583
557584
558585
559586
......
580607
581608
582609
583
610
584611
585612
586613
587614
588615
589616
590
617
591618
592619
593620
......
603630
604631
605632
606
633
607634
608635
609636
610637
611638
612639
613
640
614641
615642
616643
......
626653
627654
628655
629
656
630657
631658
632659
633660
634661
635662
636
663
637664
638665
639666
......
662689
663690
664691
665
692
666693
667694
668695
669696
670697
671698
672
699
673700
674701
675702
......
685712
686713
687714
688
715
689716
690717
691718
692719
693720
694721
695
722
696723
697724
698725
......
714741
715742
716743
717
744
718745
719746
720747
721748
722749
723750
724
751
725752
726753
727754
......
771798
772799
773800
774
801
775802
776803
777804
778805
779806
780807
781
808
782809
783810
784811
785
812
786813
787814
788815
789816
790817
791818
792
819
793820
794821
795822
......
799826
800827
801828
802
829
803830
804831
805832
......
810837
811838
812839
813
840
814841
815842
816843
817844
818845
819846
820
847
821848
822849
823850
......
834861
835862
836863
837
864
838865
839866
840867
841868
842869
843870
844
871
845872
846873
847874
848
875
849876
850877
851878
852879
853880
854881
855
882
856883
857884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
858921
859922
860923
{GMA_HASWELL_CRW_E_GT1, HD_GRAPHICS }, /* ??? */
{GMA_HASWELL_CRW_E_GT2, HD_GRAPHICS }, /* ??? */
{GMA_HASWELL_CRW_E_GT3, IRIS_5200 },
{GMA_HASWELL_CRW_M_GT2_PLUS_IG, HD_GRAPHICS }
{GMA_HASWELL_CRW_M_GT2_PLUS_IG, HD_GRAPHICS },
/* Brodwell */
{GMA_BRODWELL_BDW_M_GT1,HD_GRAPHICS }, /* 1602 */
{GMA_BRODWELL_BDW_M_GT2,HD_GRAPHICS_5600},/* 1612 */
{GMA_BRODWELL_BDW_M_GT3e,IRIS_Pro_6200}, /* 1622 */
{GMA_BRODWELL_BDW_M_1632,HD_GRAPHICS },/* 1632 */
{GMA_BRODWELL_ULT_M_GT1, HD_GRAPHICS }, /* 1606 */
{GMA_BRODWELL_ULT_M_GT2, HD_GRAPHICS_5500}, /* 1616 */
{GMA_BRODWELL_ULT_M_GT3,HD_GRAPHICS_6000},/* 1626 */
{GMA_BRODWELL_ULT_M_1636,HD_GRAPHICS },/* 1636 */
{GMA_BRODWELL_BDW_S_GT1, HD_GRAPHICS }, /* 160a */
{GMA_BRODWELL_BDW_S_GT2,HD_GRAPHICS },/* 161a */
{GMA_BRODWELL_BDW_S_GT3e,IRIS_Pro_P6300}, /* 162a */
{GMA_BRODWELL_BDW_S_163A,HD_GRAPHICS },/* 163a */
{GMA_BRODWELL_LVT_M_GT1, HD_GRAPHICS }, /* 160b */
{GMA_BRODWELL_LVT_M_GT2, HD_GRAPHICS }, /* 161b */
{GMA_BRODWELL_LVT_M_GT3,IRIS_6100 },/* 162b */
{GMA_BRODWELL_LVT_M_163B,HD_GRAPHICS },/* 163b */
{GMA_BRODWELL_BDW_D_GT1,HD_GRAPHICS }, /* 160d */
{GMA_BRODWELL_BDW_D_GT2,HD_GRAPHICS },/* 161d */
{GMA_BRODWELL_BDW_D_GT3,HD_GRAPHICS },/* 162d */
{GMA_BRODWELL_BDW_D_163D,HD_GRAPHICS },/* 163d */
{GMA_BRODWELL_ULX_M_GT1, HD_GRAPHICS }, /* 160e */
{GMA_BRODWELL_ULX_M_GT2,HD_GRAPHICS_5300},/* 161e */
{GMA_BRODWELL_ULX_M_GT3,HD_GRAPHICS },/* 162e */
{GMA_BRODWELL_ULX_M_163E,HD_GRAPHICS }/* 163e */
};
#define GFX_DEVICES_LEN (sizeof(intel_gfx_chipsets) / sizeof(intel_gfx_chipsets[0]))
uint8_t ig_id_4k_mobile[4] = { 0x03, 0x00, 0x66, 0x01 }; // MacMan
uint8_t ig_id_4600[4] = { 0x03, 0x00, 0x22, 0x0D }; // MacMan
uint8_t ig_id_4600_mobile[4] = { 0x06, 0x00, 0x26, 0x0A }; // MacMan
uint8_t ig_id_5500_mobile[4] = { 0x00, 0x00, 0x16, 0x16 }; // MacMan
uint8_t ig_platform_id[4] = { 0x00, 0x00, 0x00, 0x00 }; // MacMan
devicepath = get_pci_dev_path(gma_dev);
devprop_add_value(device, "AAPL,os-info",HD2000_os_info, 20);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Setting %s for snb-platform-id\n", value);
verbose("Setting 0x%s for snb-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,snb-platform-id", snb_id_3k, 4);
verbose("Using default snb-platform-id of 00030010\n");
verbose("Using default snb-platform-id of 0x00030010\n");
}
break;
devprop_add_value(device, "AAPL,os-info",HD2000_os_info, 20);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Setting %s for snb-platform-id\n", value);
verbose("Setting 0x%s for snb-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,snb-platform-id", snb_id_3k_mobile, 4);
verbose("Using default snb-platform-id of 00030010\n");
verbose("Using default snb-platform-id of 0x00030010\n");
}
break;
devprop_add_value(device, "AAPL,os-info",HD3000_os_info, 20);
if (getValueForKey(kIGPDeviceID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for unsupported device id injection.\n", value);
verbose("Using 0x%s for unsupported device id injection.\n", value);
hex2devprop(value, igp_device_id, 2);
devprop_add_value(device, "device-id",igp_device_id, 4);
}
else
{
devprop_add_value(device, "device-id", hd3k_kmobile_device_id, 4); // MacMan Inject Mobile ID Instead of Patching Kext
verbose("Using default unsupported device id injection of 0126\n");
verbose("Using default unsupported device id injection of 0x0126\n");
}
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for snb-platform-id\n", value);
verbose("Using 0x%s for snb-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,snb-platform-id", snb_id_3k, 4);
verbose("Using default snb-platform-id of 00030010\n");
verbose("Using default snb-platform-id of 0x00030010\n");
}
break;
devprop_add_value(device, "AAPL,os-info",HD3000_os_info, 20);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Setting %s for snb-platform-id\n", value);
verbose("Setting 0x%s for snb-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,snb-platform-id", snb_id_3k_mobile, 4);
verbose("Using default snb-platform-id of 00010000\n");
verbose("Using default snb-platform-id of 0x00010000\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4k, 4);
verbose("Using default ig-platform-id of 0166000a\n");
verbose("Using default ig-platform-id of 0x0166000a\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4k_mobile, 4);
verbose("Using default ig-platform-id of 01660003\n");
verbose("Using default ig-platform-id of 0x01660003\n");
}
break;
}
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4k, 4);
verbose("Using default ig-platform-id of 0166000a\n");
verbose("Using default ig-platform-id of 0x0166000a\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4600, 4);
verbose("Using default ig-platform-id of 0d220003\n");
verbose("Using default ig-platform-id of 0x0d220003\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4600_mobile, 4);
verbose("Using default ig-platform-id of 0a260006\n");
verbose("Using default ig-platform-id of 0x0a260006\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPDeviceID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for unsupported device id injection.\n", value);
verbose("Using 0x%s for unsupported device id injection.\n", value);
hex2devprop(value, igp_device_id, 2);
devprop_add_value(device, "device-id",igp_device_id, 4);
}
else
{
devprop_add_value(device, "device-id", hd4600_device_id, 4); // MacMan Inject Supported ID Instead of Patching Kext
verbose("Using default unsupported device id injection of 0412\n");
verbose("Using default unsupported device id injection of 0x0412\n");
}
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4600, 4);
verbose("Using default ig-platform-id of 0d220003\n");
verbose("Using default ig-platform-id of 0x0d220003\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPDeviceID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for unsupported device id injection.\n", value);
verbose("Using 0x%s for unsupported device id injection.\n", value);
hex2devprop(value, igp_device_id, 2);
devprop_add_value(device, "device-id",igp_device_id, 4);
}
}
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4600, 4);
verbose("Using default ig-platform-id of 0d220003\n");
verbose("Using default ig-platform-id of 0x0d220003\n");
}
break;
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
if (getValueForKey(kIGPDeviceID, &value, &len, &bootInfo->chameleonConfig)) // MacMan
{
verbose("Using %s for unsupported device id injection.\n", value);
verbose("Using 0x%s for unsupported device id injection.\n", value);
hex2devprop(value, igp_device_id, 2);
devprop_add_value(device, "device-id",igp_device_id, 4);
}
else
{
devprop_add_value(device, "device-id", hd4600_mobile_device_id, 4); // MacMan Inject Supported ID Instead of Patching Kext
verbose("Using default unsupported device id injection of 0416\n");
verbose("Using default unsupported device id injection of 0x0416\n");
}
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using %s for ig-platform-id\n", value);
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4600_mobile, 4);
verbose("Using default ig-platform-id of 0a260006\n");
verbose("Using default ig-platform-id of 0x0a260006\n");
}
break;
//
// Supported Broadwell Desktop Device IDs
//
//
// Currently none available as of 2015-04-08
//
//
// Supported Broadwell Mobile Device IDs
//
case GMA_BRODWELL_ULT_M_GT1:// HD Graphics ??? found in kext
case GMA_BRODWELL_ULX_M_GT1:// HD Graphics ??? found in kext
case GMA_BRODWELL_BDW_M_GT2:// HD Graphics 5600 and found in kext
case GMA_BRODWELL_ULT_M_GT2:// HD Graphics 5500 and found in kext
case GMA_BRODWELL_ULX_M_GT2:// HD Graphics 5300 and found in kext
case GMA_BRODWELL_ULT_M_GT3:// HD Graphics 6000 and found in kext
case GMA_BRODWELL_BDW_M_GT3e:// Iris Pro 6200 and found in kext
case GMA_BRODWELL_LVT_M_GT3:// Iris 6100 and found in kext
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);
if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig))
{
verbose("Using 0x%s for ig-platform-id\n", value);
hex2devprop(value, ig_platform_id, 4);
devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4);
}
else
{
devprop_add_value(device, "AAPL,ig-platform-id", ig_id_5500_mobile, 4);
verbose("Using default ig-platform-id of 0x16160000\n");
}
break;
default:
break;
branches/Chimera/i386/libsaio/gma.h
6666
6767
6868
69
70
71
72
73
74
75
6976
7077
7178
......
167174
168175
169176
170
171
172
173
174177
175178
176179
177
180
178181
179182
180183
184
181185
182
183186
184187
188
185189
186190
187191
192
188193
189194
190195
191196
192197
193198
194
199
200
195201
196202
197203
204
198205
199206
200207
208
201209
202210
203211
212
204213
205214
206215
......
219228
220229
221230
222
231
232
223233
224234
225235
236
237
226238
227239
228240
241
242
229243
230244
231245
246
232247
233248
234249
235
236
237250
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
238282
239283
240284
#define HD_GRAPHICS_5000 "HD Graphics 5000"
#define IRIS_5100 "Iris(TM) Graphics 5100"
#define IRIS_5200 "Iris(TM) Pro Graphics 5200"
#define HD_GRAPHICS_5300 "HD Graphics 5300"
#define HD_GRAPHICS_5500 "HD Graphics 5500"
#define HD_GRAPHICS_5600 "HD Graphics 5600"
#define HD_GRAPHICS_6000 "HD Graphics 6000"
#define IRIS_6100 "Iris(TM) Graphics 6100"
#define IRIS_Pro_6200 "Iris(TM) Pro Graphics 6200"
#define IRIS_Pro_P6300 "Iris(TM) Pro P6300"
#define INTEL_VENDORID0x8086
/* http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/src/intel_driver.h */
//#define GMA_VALLEYVIEW_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0F30)
/* ============ Haswell =============== */
// 0090 // AppleIntelHD5000Graphics.kext
// 0091 // AppleIntelHD5000Graphics.kext
// 0092 // AppleIntelHD5000Graphics.kext
//#define GMA_HASWELL_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0400) /* Desktop */
#define GMA_HASWELL_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0402) // HD Graphics
#define GMA_HASWELL_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0412) // HD Graphics 4600 and found in kext
#define GMA_HASWELL_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0422) // HD Graphics 5000
//#define GMA_HASWELL_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0404) /* Mobile */
#define GMA_HASWELL_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0406) // HD Graphics Mobile and found in kext
#define GMA_HASWELL_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0416) // HD Graphics 4600 Mobile and found in kext
#define GMA_HASWELL_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0426) // HD Graphics 5000 Mobile and found in kext
#define GMA_HASWELL_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x040A) // HD Graphics
//#define GMA_HASWELL_S_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0408) /* Server */
#define GMA_HASWELL_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x041A) // HD Graphics
#define GMA_HASWELL_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x042A)
#define GMA_HASWELL_B_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x040B)
#define GMA_HASWELL_B_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x041B) // HD Graphics
#define GMA_HASWELL_B_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x042B)
#define GMA_HASWELL_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x040E)
#define GMA_HASWELL_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x041E) // HD Graphics 4400
#define GMA_HASWELL_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x042E)
#define GMA_HASWELL_ULT_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A02)
#define GMA_HASWELL_ULT_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A12)
#define GMA_HASWELL_ULT_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A22) // HD Graphics 5000 Iris
#define GMA_HASWELL_ULT_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A22) // HD Graphics 5000 Iris
#define GMA_HASWELL_ULT_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A06) // HD Graphics
#define GMA_HASWELL_ULT_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A16) // HD Graphics 4400 Mobile and found in kext
#define GMA_HASWELL_ULT_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A26) // HD Graphics 5000 Iris Mobile and found in kext
#define GMA_HASWELL_ULT_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A0A)
#define GMA_HASWELL_ULT_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A1A)
#define GMA_HASWELL_ULT_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A2A)
#define GMA_HASWELL_ULT_B_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A0B)
#define GMA_HASWELL_ULT_B_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A1B)
#define GMA_HASWELL_ULT_B_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A2B)
#define GMA_HASWELL_ULT_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A0E) // HD Graphics
#define GMA_HASWELL_ULT_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A1E) // HD Graphics 4200 Mobile and found in kext
#define GMA_HASWELL_ULT_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A2E) // HD Graphics 5100 Iris Mobile and found in kext
#define GMA_HASWELL_CRW_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D02)
#define GMA_HASWELL_CRW_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D12) // HD Graphics
#define GMA_HASWELL_CRW_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D22) // HD Graphics 5200 Iris Pro and found in kext
//#define GMA_HASWELL_CRW_D_GT2_PLUS_IGGFX_MODEL_CONSTRUCT(INTEL, 0x0D32)
#define GMA_HASWELL_CRW_D_GT2_PLUS_IGGFX_MODEL_CONSTRUCT(INTEL, 0x0D32)
#define GMA_HASWELL_CRW_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D06)
#define GMA_HASWELL_CRW_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D16) // HD Graphics 4600 Mobile
#define GMA_HASWELL_CRW_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D26) // HD Graphics 5200 Iris Pro Mobile and found in kext
#define GMA_HASWELL_CRW_M_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D36)
#define GMA_HASWELL_CRW_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0A)
#define GMA_HASWELL_CRW_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1A)
#define GMA_HASWELL_CRW_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2A) // HD Graphics Iris Pro
#define GMA_HASWELL_CRW_S_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D3A)
#define GMA_HASWELL_CRW_B_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0B)
#define GMA_HASWELL_CRW_B_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1B)
#define GMA_HASWELL_CRW_B_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2B)
#define GMA_HASWELL_CRW_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0E)
#define GMA_HASWELL_CRW_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1E)
#define GMA_HASWELL_CRW_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2E)
#define GMA_HASWELL_CRW_M_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D36)
//#define GMA_HASWELL_CRW_S_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D3A)
/* Brodwell */
#define GMA_BRODWELL_BDW_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x1602)
#define GMA_BRODWELL_BDW_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x1612) // HD Graphics 5600 and found in kext
#define GMA_BRODWELL_BDW_M_GT3e GFX_MODEL_CONSTRUCT(INTEL, 0x1622) // Iris Pro 6200 and found in kext
#define GMA_BRODWELL_BDW_M_1632 GFX_MODEL_CONSTRUCT(INTEL, 0x1632)
#define GMA_BRODWELL_ULT_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x1606) // HD Graphics and found in kext
#define GMA_BRODWELL_ULT_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x1616) // HD Graphics 5500 and found in kext
#define GMA_BRODWELL_ULT_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x1626) // HD Graphics 6000 and found in kext
#define GMA_BRODWELL_ULT_M_1636 GFX_MODEL_CONSTRUCT(INTEL, 0x1636)
#define GMA_BRODWELL_BDW_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x160A)
#define GMA_BRODWELL_BDW_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x161A)
#define GMA_BRODWELL_BDW_S_GT3e GFX_MODEL_CONSTRUCT(INTEL, 0x162A) // Iris Pro P6300
#define GMA_BRODWELL_BDW_S_163A GFX_MODEL_CONSTRUCT(INTEL, 0x163A)
#define GMA_BRODWELL_LVT_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x160B)
#define GMA_BRODWELL_LVT_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x161B)
#define GMA_BRODWELL_LVT_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x162B) // Iris 6100 and found in kext
#define GMA_BRODWELL_LVT_M_163B GFX_MODEL_CONSTRUCT(INTEL, 0x163B)
#define GMA_BRODWELL_BDW_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x160D)
#define GMA_BRODWELL_BDW_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x161D)
#define GMA_BRODWELL_BDW_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x162D)
#define GMA_BRODWELL_BDW_D_163D GFX_MODEL_CONSTRUCT(INTEL, 0x163D)
#define GMA_BRODWELL_ULX_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x160E) // HD Graphics and found in kext
#define GMA_BRODWELL_ULX_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x161E) // HD Graphics 5300 and found in kext
#define GMA_BRODWELL_ULX_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x162E)
#define GMA_BRODWELL_ULX_M_163E GFX_MODEL_CONSTRUCT(INTEL, 0x163E)
/* END */
#endif /* !__LIBSAIO_GMA_H */
branches/Chimera/i386/libsaio/aml_generator.c
6767
6868
6969
70
70
71
7172
7273
7374
......
7677
7778
7879
79
80
81
8082
8183
8284
......
8789
8890
8991
90
92
93
9194
9295
9396
......
101104
102105
103106
104
107
108
105109
106110
107111
......
114118
115119
116120
117
121
122
118123
119124
120125
......
128133
129134
130135
131
136
137
132138
133139
134140
......
144150
145151
146152
147
153
154
148155
149156
150157
......
162169
163170
164171
165
172
173
166174
167175
168176
......
175183
176184
177185
178
186
187
179188
180189
181190
......
183192
184193
185194
186
195
196
187197
188198
189199
190200
191
201
202
192203
193204
194205
195
206
207
196208
197209
198210
......
200212
201213
202214
203
215
216
204217
205218
206219
......
224237
225238
226239
227
240
241
228242
229243
230244
......
236250
237251
238252
239
253
254
240255
241256
242257
......
248263
249264
250265
251
266
267
252268
253269
254270
......
263279
264280
265281
266
282
283
267284
268285
269286
......
276293
277294
278295
279
296
297
280298
281299
282300
......
292310
293311
294312
295
313
314
296315
297316
298317
......
304323
305324
306325
307
326
327
308328
309329
310330
......
316336
317337
318338
319
339
340
320341
321342
322343
......
328349
329350
330351
331
352
353
332354
333355
334356
......
340362
341363
342364
343
365
366
344367
345368
346369
......
352375
353376
354377
355
378
379
356380
357381
358382
......
369393
370394
371395
372
396
397
373398
374399
375400
376401
377402
378403
379
404
380405
381
406
382407
383408
384409
......
388413
389414
390415
391
416
417
392418
393419
394420
395
421
396422
397
423
398424
399425
400426
......
404430
405431
406432
407
433
434
408435
409436
410437
......
426453
427454
428455
429
456
457
430458
431459
432460
433461
434462
435
463
464
436465
437466
438467
......
440469
441470
442471
443
472
473
444474
445475
446476
......
466496
467497
468498
469
499
500
470501
471502
472503
......
529560
530561
531562
532
563
564
533565
534566
535567
......
538570
539571
540572
541
573
574
542575
543576
544577
......
559592
560593
561594
562
595
596
563597
564598
565599
566
600
601
567602
568603
569604
{
AML_CHUNK* next = child->Next;
if (child->Buffer) {
if (child->Buffer)
{
free(child->Buffer);
}
free(child);
}
// Free node
if (node->Buffer) {
if (node->Buffer)
{
free(node->Buffer);
}
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_NONE;
node->Length = (uint16_t)size;
node->Buffer = malloc(node->Length);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_BYTE;
node->Length = 1;
node->Buffer = malloc(node->Length);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_WORD;
node->Length = 2;
node->Buffer = malloc(node->Length);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_DWORD;
node->Length = 4;
node->Buffer = malloc(node->Length);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_QWORD;
node->Length = 8;
node->Buffer = malloc(node->Length);
uint32_t aml_fill_simple_name(char* buffer, char* name)
{
if (strlen(name) < 4) {
if (strlen(name) < 4)
{
verbose("aml_fill_simple_name: simple name %s has incorrect lengh! Must be 4.\n", name);
return 0;
}
int len, offset, count;
uint32_t root = 0;
if (!node) {
if (!node)
{
return 0;
}
offset = 0;
count = len >> 2;
if ((len % 4) > 1 || count == 0) {
if ((len % 4) > 1 || count == 0)
{
verbose("aml_fill_name: pathname %s has incorrect length! Must be 4, 8, 12, 16, etc...\n", name);
return 0;
}
if (((len % 4) == 1) && (name[0] == '\\')) {
if (((len % 4) == 1) && (name[0] == '\\'))
{
root++;
}
if (count == 1) {
if (count == 1)
{
node->Length = (uint16_t)(4 + root);
node->Buffer = malloc(node->Length+4);
memcpy(node->Buffer, name, 4 + root);
return (uint32_t)offset;
}
if (count == 2) {
if (count == 2)
{
node->Length = 2 + 8;
node->Buffer = malloc(node->Length+4);
node->Buffer[offset++] = 0x5c; // Root Char
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_SCOPE;
aml_fill_name(node, name);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_NAME;
aml_fill_name(node, name);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
unsigned int offset = aml_fill_name(node, name);
node->Type = AML_CHUNK_METHOD;
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_PACKAGE;
node->Length = 1;
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_ALIAS;
node->Length = 8;
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_RETURN;
aml_fill_name(node, name);
}
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_RETURN;
aml_add_byte(node, value);
}
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_DEVICE;
aml_fill_name(node, name);
}
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_LOCAL0;
node->Length = 1;
}
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_STORE_OP;
node->Length = 1;
}
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
int offset = 0;
node->Type = AML_CHUNK_BUFFER;
node->Length = (uint8_t)(size + 2);
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
unsigned int offset = 0;
unsigned int len = strlen(StringBuf);
node->Type = AML_CHUNK_BUFFER;
node->Length = (uint8_t)(len + 3);
node->Buffer = malloc (node->Length);
node->Buffer[offset++] = AML_CHUNK_BYTE;
node->Buffer[offset++] = (char)len;
node->Buffer[offset++] = (char)(len+1);
memcpy(node->Buffer+offset, StringBuf, len);
node->Buffer[offset+len] = '\0';
//node->Buffer[offset+len] = '\0';
}
return node;
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
int len = strlen(StringBuf);
node->Type = AML_CHUNK_STRING;
node->Length = (uint8_t)(len + 1);
node->Buffer = malloc (len);
node->Buffer = malloc (len+1);
memcpy(node->Buffer, StringBuf, len);
node->Buffer[len] = '\0';
//node->Buffer[len] = '\0';
}
return node;
{
AML_CHUNK* node = aml_create_node(parent);
if (node) {
if (node)
{
node->Type = AML_CHUNK_RETURN;
//aml_add_byte(node, value);
}
uint32_t aml_calculate_size(AML_CHUNK* node)
{
if (node) {
if (node)
{
// Calculate child nodes size
AML_CHUNK* child = node->First;
uint8_t child_count = 0;
node->Size = 0;
while (child) {
while (child)
{
child_count++;
node->Size += (uint16_t)aml_calculate_size(child);
child = child->Next;
}
switch (node->Type) {
switch (node->Type)
{
case AML_CHUNK_NONE:
case AML_STORE_OP:
case AML_CHUNK_LOCAL0:
break;
case AML_CHUNK_BYTE:
if (node->Buffer[0] == 0x0 || node->Buffer[0] == 0x1) {
if (node->Buffer[0] == 0x0 || node->Buffer[0] == 0x1)
{
node->Size += node->Length;
} else {
node->Size += 1 + node->Length;
uint32_t aml_write_buffer(const char* value, uint32_t size, char* buffer, uint32_t offset)
{
if (size > 0) {
if (size > 0)
{
memcpy(buffer + offset, value, size);
}
uint32_t aml_write_size(uint32_t size, char* buffer, uint32_t offset)
{
if (size <= 0x3f) { /* simple 1 byte length in 6 bits */
if (size <= 0x3f) /* simple 1 byte length in 6 bits */
{
buffer[offset++] = (char)size;
} else if (size <= 0xfff) {
buffer[offset++] = 0x40 | (size & 0xf); /* 0x40 is type, 0x0X is first nibble of length */
uint32_t aml_write_node(AML_CHUNK* node, char* buffer, uint32_t offset)
{
if (node && buffer) {
if (node && buffer)
{
uint32_t old = offset;
AML_CHUNK* child = node->First;
switch (node->Type) {
switch (node->Type)
{
case AML_CHUNK_NONE:
offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset);
break;
branches/Chimera/i386/libsaio/device_inject.c
2020
2121
2222
23
23
2424
2525
2626
......
251251
252252
253253
254
254255
255256
256
257
258
257259
258260
259261
......
261263
262264
263265
264
266
265267
266268
269
267270
268271
269272
270273
271
274
275
276
277
278
279
280
281
282
272283
273284
274285
275
286
287
276288
277289
278290
279291
280292
281293
294
282295
283296
284
297
298
299
300
285301
286302
287303
288304
289305
306
290307
291
292
308
309
310
311
312
313
293314
294315
295316
296317
318
297319
298320
299321
300
301
322
323
324
325
326
327
302328
303329
304330
#if DEBUG_INJECT
#define DBG(x...)printf(x)
#else
#define DBG(x...)
#define DBG(x...)msglog(x)
#endif
uint32_t devices_number = 1;
return 1;
}
// devprop_generate_string optimized by cparm
char *devprop_generate_string(DevPropString *string)
{
char *buffer = (char*)malloc(string->length * 2);
int len = string->length * 2;
char *buffer = (char*)malloc(len);
char *ptr = buffer;
if(!buffer)
return NULL;
}
sprintf(buffer, "%08x%08x%04x%04x", dp_swap32(string->length), string->WHAT2,
snprintf(buffer, len, "%08x%08x%04x%04x", dp_swap32(string->length), string->WHAT2,
dp_swap16(string->numentries), string->WHAT3);
buffer += 24;
len -= 24;
int i = 0, x = 0;
while(i < string->numentries)
{
sprintf(buffer, "%08x%04x%04x", dp_swap32(string->entries[i]->length),
if (!(i < DEV_PROP_DEVICE_MAX_ENTRIES)) {
break;
}
if(!len) {
break;
}
snprintf(buffer, len, "%08x%04x%04x", dp_swap32(string->entries[i]->length),
dp_swap16(string->entries[i]->numentries), string->entries[i]->WHAT2);
buffer += 16;
sprintf(buffer, "%02x%02x%04x%08x%08x", string->entries[i]->acpi_dev_path.type,
len -= 16;
snprintf(buffer, len, "%02x%02x%04x%08x%08x", string->entries[i]->acpi_dev_path.type,
string->entries[i]->acpi_dev_path.subtype,
dp_swap16(string->entries[i]->acpi_dev_path.length),
string->entries[i]->acpi_dev_path._HID,
dp_swap32(string->entries[i]->acpi_dev_path._UID));
buffer += 24;
len -= 24;
for(x = 0;x < string->entries[i]->num_pci_devpaths; x++)
{
sprintf(buffer, "%02x%02x%04x%02x%02x", string->entries[i]->pci_dev_path[x].type,
if(!len) {
break;
}
snprintf(buffer, len, "%02x%02x%04x%02x%02x", string->entries[i]->pci_dev_path[x].type,
string->entries[i]->pci_dev_path[x].subtype,
dp_swap16(string->entries[i]->pci_dev_path[x].length),
string->entries[i]->pci_dev_path[x].function,
string->entries[i]->pci_dev_path[x].device);
buffer += 12;
len -= 12;
}
sprintf(buffer, "%02x%02x%04x", string->entries[i]->path_end.type,
if(!len) {
break;
}
snprintf(buffer, len, "%02x%02x%04x", string->entries[i]->path_end.type,
string->entries[i]->path_end.subtype,
dp_swap16(string->entries[i]->path_end.length));
buffer += 8;
len -= 8;
uint8_t *dataptr = string->entries[i]->data;
for(x = 0; (uint32_t)x < (string->entries[i]->length) - (24 + (6 * string->entries[i]->num_pci_devpaths)) ; x++)
{
sprintf(buffer, "%02x", *dataptr++);
buffer += 2;
if(!len) {
break;
}
snprintf(buffer, len, "%02x", *dataptr++);
buffer += 2;
len -= 2;
}
i++;
}
branches/Chimera/i386/libsaio/hda.c
109109
110110
111111
112
113
112
113
114114
115115
116116
{ HDA_INTEL_PCH2, "5 Series/3400 Series" },
{ HDA_INTEL_SCH, "System Controller Hub (SCH Poulsbo)" },
{ HDA_INTEL_SCH2, "9 Series" },
{ HDA_INTEL_LPT1, "Lynx Point" },
{ HDA_INTEL_LPT2, "Lynx Point" },
{ HDA_INTEL_LPT1, "Wellsburg" },
{ HDA_INTEL_LPT2, "Wellsburg" },
{ HDA_INTEL_LYNX, "Lynx Point-LP" },
{ HDA_INTEL_LYNX2, "Lynx Point-LP" },
//10de NVIDIA Corporation
branches/Chimera/i386/libsaio/dram_controllers.c
525525
526526
527527
528
528
529529
530530
531531
{ 0x8086, 0x29C0, "82G33/G31/P35/P31",setup_p35, get_fsb_i965,get_timings_p35},
{ 0x8086, 0x29D0, "82Q33 Express",setup_p35, get_fsb_i965,get_timings_p35},
{ 0x8086, 0x29E0, "82X38/X48 Express",setup_p35, get_fsb_i965,get_timings_p35},
//{ 0x8086, 0x29F0, "3200/3210 Chipset",NULL, NULL, NULL },
{ 0x8086, 0x29F0, "3200/3210",setup_p35, get_fsb_i965,get_timings_p35},
{ 0x8086, 0x2E00, "Eaglelake",setup_p35, get_fsb_i965,get_timings_p35},
{ 0x8086, 0x2E10, "Q45/Q43",setup_p35, get_fsb_i965,get_timings_p35},
branches/Chimera/i386/libsaio/nvidia.c
10121012
10131013
10141014
1015
10151016
1017
10161018
10171019
10181020
......
10211023
10221024
10231025
1026
10241027
1028
10251029
10261030
10271031
10281032
10291033
10301034
1035
1036
1037
1038
1039
1040
10311041
1042
1043
10321044
1045
1046
1047
1048
10331049
10341050
10351051
......
10391055
10401056
10411057
1058
10421059
10431060
10441061
1062
1063
1064
10451065
1066
1067
10461068
1069
10471070
10481071
10491072
......
10511074
10521075
10531076
1077
1078
1079
1080
1081
1082
10541083
1084
1085
10551086
10561087
10571088
......
10601091
10611092
10621093
1094
1095
10631096
10641097
10651098
......
11171150
11181151
11191152
1120
1121
1122
1123
1124
1153
1154
1155
1156
1157
11251158
1126
1127
1159
1160
11281161
11291162
11301163
......
11421175
11431176
11441177
1178
11451179
11461180
1181
1182
11471183
11481184
1149
1150
1151
1185
1186
1187
11521188
11531189
11541190
......
11561192
11571193
11581194
1195
11591196
11601197
11611198
1199
1200
11621201
11631202
11641203
......
11801219
11811220
11821221
1183
1222
11841223
11851224
11861225
11871226
11881227
1228
11891229
11901230
11911231
......
12201260
12211261
12221262
1263
1264
12231265
12241266
12251267
......
12401282
12411283
12421284
1243
1244
1245
1246
1247
1248
1249
1250
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
12511344
12521345
12531346
......
14371530
14381531
14391532
1533
1534
14401535
14411536
14421537
{ 0x10DE0FC1,"NVIDIA GeForce GT 640" },
{ 0x10DE0FC2,"NVIDIA GeForce GT 630" },
{ 0x10DE0FC6,"NVIDIA GeForce GTX 650" },
{ 0x10DE0FC8,"NVIDIA GeForce GT 740" },
{ 0x10DE0FCD,"NVIDIA GeForce GT 755M" },
{ 0x10DE0FCE,"NVIDIA GeForce GT 640M LE" },
// 0FD0 - 0FDF
{ 0x10DE0FD1,"NVIDIA GeForce GT 650M" },
{ 0x10DE0FD2,"NVIDIA GeForce GT 640M" },
{ 0x10DE0FD5,"NVIDIA GeForce GT 650M" },
{ 0x10DE0FD8,"NVIDIA GeForce GT 640M" },
{ 0x10DE0FD9,"NVIDIA GeForce GT 645M" },
{ 0x10DE0FDA,"GK107-ES-A1" },
{ 0x10DE0FDB,"GK107-ESP-A1" },
{ 0x10DE0FDC,"GK107-INT22-A1" },
{ 0x10DE0FDF,"NVIDIA GeForce GT 740M" },
// 0FE0 - 0FEF
{ 0x10DE0FE0,"NVIDIA GeForce GTX 660M" },
{ 0x10DE0FE1,"NVIDIA GeForce GT 730M" },
{ 0x10DE0FE3,"NVIDIA GeForce GT 745M" },
{ 0x10DE0FE4,"NVIDIA GeForce GT 750M" },
{ 0x10DE0FE5,"NVIDIA GeForce K340 USM" },
{ 0x10DE0FE6,"NVS K1 USM" },
{ 0x10DE0FE7,"Generic K1 USM / GRID K100" },
{ 0x10DE0FE9,"NVIDIA GeForce GT 750M" },
{ 0x10DE0FEA,"NVIDIA GeForce GT 755M" },
{ 0x10DE0FEF,"GRID K340" },
// 0FF0 - 0FFF
{ 0x10DE0FF0,"NB1Q" },
{ 0x10DE0FF1,"NVS 1000" },
{ 0x10DE0FF2,"VGX K1" },
{ 0x10DE0FF3,"NVIDIA Quadro K420" },
{ 0x10DE0FF5,"Tesla K1 USM" },
{ 0x10DE0FF6,"NVIDIA Quadro K1100M" },
{ 0x10DE0FF7,"NVIDIA Quadro K1 USM" }, // K1 USM / GRID K120Q / GRID K140Q
{ 0x10DE0FF8,"NVIDIA Quadro K500M" },
{ 0x10DE0FF9,"NVIDIA Quadro K2000D" },
{ 0x10DE0FFA,"NVIDIA Quadro K600" },
{ 0x10DE0FFE,"NVIDIA Quadro K2000" },
{ 0x10DE0FFF,"NVIDIA Quadro 410" },
// 1000 - 100F
{ 0x10DE1001,"NVIDIA GeForce GTX TITAN Z" },
{ 0x10DE1003,"NVIDIA GeForce GTX Titan LE" },
{ 0x10DE1004,"NVIDIA GeForce GTX 780" },
{ 0x10DE1005,"NVIDIA GeForce GTX Titan" },
{ 0x10DE1006,"NVIDIA GeForce GTX 780 Ti" },
{ 0x10DE1007,"NVIDIA GeForce GTX 780" },
{ 0x10DE1008,"NVIDIA GeForce GTX 780 Ti" },
{ 0x10DE100A,"NVIDIA GeForce GTX 780 Ti" },
//{ 0x10DE100B,"Graphics Device" }, // GK110
{ 0x10DE100C,"GeForce GTX Titan Black" },
// 1010 - 101F
{ 0x10DE101E,"Tesla K20X" }, // GK110GL
{ 0x10DE101F,"NVIDIA Tesla K20" },
// 1020 - 102F
{ 0x10DE1020,"NVIDIA Tesla K20X" },
{ 0x10DE1022,"NVIDIA Tesla K20c" },
{ 0x10DE1026,"NVIDIA Tesla K20s" },
{ 0x10DE1028,"NVIDIA Tesla K20m" },
{ 0x10DE102A,"NVIDIA Tesla K40t" }, // GK110BGL
//{ 0x10DE102B,"Graphics Device" }, // GK110BGL
//{ 0x10DE102C,"Graphics Device" }, // GK110BGL
{ 0x10DE102D,"NVIDIA Tesla K80" }, // GK110BGL (2x)
{ 0x10DE102E,"NVIDIA Tesla K40d" }, // GK110BGL
{ 0x10DE102F,"TNVIDIA Tesla Stella Solo" }, // GK110BGL
// 1030 - 103F
//{ 0x10DE1030,"" }, // GK110
{ 0x10DE103F,"NVIDIA Tesla Stella SXM" }, // GK110
// 1040 - 104F
{ 0x10DE1040,"NVIDIA GeForce GT 520" },
// { 0x10DE1041,"D13M1-45" },
{ 0x10DE1049,"NVIDIA GeForce GT 620" },
{ 0x10DE104A,"NVIDIA GeForce GT 610" },
{ 0x10DE104B,"NVIDIA GeForce GT 625 (OEM)" },
{ 0x10DE104C,"NVIDIA GeForce GT 705" }, // GF119
{ 0x10DE104D,"NVIDIA GeForce GT 710" }, // GF119
// 1050 - 105F
{ 0x10DE1050,"NVIDIA GeForce GT 520M" },
{ 0x10DE1051,"NVIDIA GeForce GT 520MX" },
{ 0x10DE1140,"NVIDIA GeForce GT 610M" },
{ 0x10DE1141,"NVIDIA GeForce 610M" },
{ 0x10DE1142,"NVIDIA GeForce 620M" },
// { 0x10DE1143,"N13P-GV" },
// { 0x10DE1144,"GF117" },
// { 0x10DE1145,"GF117" },
// { 0x10DE1146,"GF117" },
// { 0x10DE1147,"GF117" },
{ 0x10DE1143,"N13P-GV" },
{ 0x10DE1144,"GF117" },
{ 0x10DE1145,"GF117" },
{ 0x10DE1146,"GF117" },
{ 0x10DE1147,"GF117" },
{ 0x10DE1149,"GF117-ES" },
// { 0x10DE114A,"GF117-INT" },
// { 0x10DE114B,"PCI-GEN3-B" },
{ 0x10DE114A,"GF117-INT" },
{ 0x10DE114B,"PCI-GEN3-B" },
// 1150 - 115F
// 1160 - 116F
// 1170 - 117F
{ 0x10DE118E,"NVIDIA GeForce GTX 760 (192-bit)" },
{ 0x10DE118F,"NVIDIA Tesla K10" },
// 1190 - 119F
{ 0x10DE1191,"NVIDIA GeForce GTX 760" }, // GK104
{ 0x10DE1192,"NVIDIA GeForce GK104" },
{ 0x10DE1193,"NVIDIA GeForce GTX 760 Ti" },
{ 0x10DE1194,"NVIDIA Tesla K8" }, // GK104
{ 0x10DE1195,"NVIDIA GeForce GTX 660" },
{ 0x10DE1198,"NVIDIA GeForce GTX 880M" },
{ 0x10DE1199,"NVIDIA GeForce GTX 870M" },
{ 0x10DE119a,"NVIDIA GeForce GTX 860M" },
{ 0x10DE119d,"NVIDIA GeForce GTX 775M" }, // Mac Edition
{ 0x10DE119e,"NVIDIA GeForce GTX 780M" }, // Mac Edition
{ 0x10DE119A,"NVIDIA GeForce GTX 860M" },
{ 0x10DE119D,"NVIDIA GeForce GTX 775M" }, // Mac Edition
{ 0x10DE119E,"NVIDIA GeForce GTX 780M" }, // Mac Edition
{ 0x10DE119F,"NVIDIA GeForce GTX 780M" },
// 11A0 - 11AF
{ 0x10DE11A0,"NVIDIA GeForce GTX 680M" },
{ 0x10DE11A2,"NVIDIA GeForce GTX 675MX" }, // Mac Edition
{ 0x10DE11A3,"NVIDIA GeForce GTX 680MX" },
{ 0x10DE11A7,"NVIDIA GeForce GTX 675MX" },
{ 0x10DE11AF,"GRID IceCube" }, // GF104M
// 11B0 - 11BF
{ 0x10DE11B0,"GRID K240Q" }, // K260Q vGPU
{ 0x10DE11B1,"GRID K2 Tesla USM" },
{ 0x10DE11B4,"NVIDIA Quadro K4200" },
{ 0x10DE11B6,"NVIDIA Quadro K3100M" },
{ 0x10DE11B6,"NVIDIA Quadro K3100M" },
{ 0x10DE11B7,"NVIDIA Quadro K4100M" },
{ 0x10DE11B8,"NVIDIA Quadro K5100M" },
{ 0x10DE11D0,"GK106-INT353" },
// 11E0 - 11EF
{ 0x10DE11E0,"NVIDIA GeForce GTX 770M" },
{ 0x10DE11E1,"N14E-GE-B-A1" },
{ 0x10DE11E1,"NVIDIA GeForce GTX 765M" },
{ 0x10DE11E2,"NVIDIA GeForce GTX 765M" },
{ 0x10DE11E3,"NVIDIA GeForce GTX 760M" },
// 11F0 - 11FF
{ 0x10DE11FA,"NVIDIA Quadro K4000" },
{ 0x10DE11FC,"NVIDIA Quadro 2100M" },
{ 0x10DE11FF,"NB1Q" }, //
// 1200 - 120F
{ 0x10DE1200,"NVIDIA GeForce GTX 560 Ti" },
{ 0x10DE1201,"NVIDIA GeForce GTX 560" },
{ 0x10DE1281,"NVIDIA GeForce GT 710" },
{ 0x10DE1282,"NVIDIA GeForce GT 640" },
{ 0x10DE1284,"NVIDIA GeForce GT 630" },
{ 0x10DE1286,"NVIDIA GeForce GT 720" },
{ 0x10DE1287,"NVIDIA GeForce GT 730" }, // GK208
// 1290 - 129F
{ 0x10DE1290,"NVIDIA GeForce GT 730M" },
{ 0x10DE1291,"NVIDIA GeForce GT 735M" },
// 12D0 - 12DF
// 12E0 - 12EF
// 12F0 - 12FF
{ 0x10DE1340,"NVIDIA GeForce 830M" },
{ 0x10DE1341,"NVIDIA GeForce 840M" },
{ 0x10DE1380,"NVIDIA GeForce GTX 750 Ti" },
{ 0x10DE1381,"NVIDIA GeForce GTX 750" },
{ 0x10DE1390,"NVIDIA GeForce 845M" },
{ 0x10DE1391,"NVIDIA GeForce GTX 850M" },
{ 0x10DE1392,"NVIDIA GeForce GTX 860M" },
{ 0x10DE1393,"NVIDIA GeForce 840M" }
{ 0x10DE1340,"NVIDIA GeForce 830M" },
{ 0x10DE1341,"NVIDIA GeForce 840M" },
{ 0x10DE1380,"NVIDIA GeForce GTX 750 Ti" },
{ 0x10DE1381,"NVIDIA GeForce GTX 750" },
{ 0x10DE1382,"NVIDIA GeForce GTX 745" },
//{ 0x10DE1383,"Graphics Device" }, // GM107
{ 0x10DE1389,"GRID M3" }, // GM107
{ 0x10DE1390,"NVIDIA GeForce 845M" },
{ 0x10DE1391,"NVIDIA GeForce GTX 850M" },
{ 0x10DE1392,"NVIDIA GeForce GTX 860M" },
{ 0x10DE1393,"NVIDIA GeForce 840M" },
{ 0x10DE1398,"NVIDIA GeForce N15S-GT1R" }, //
{ 0x10DE13AD,"GM107 INT52" }, //
{ 0x10DE13AE,"GM107 CS1" }, //
//{ 0x10DE13AF,"Graphics Device" }, // GM107GLM
{ 0x10DE13B3,"NVIDIA Quadro K2200M" }, //
{ 0x10DE13BA,"NVIDIA Quadro K2200" },
{ 0x10DE13BB,"NVIDIA Quadro K620" },
{ 0x10DE13BD,"NVIDIA Tesla M40" }, // GM107GLM
{ 0x10DE13BE,"GM107 CS1" }, //
{ 0x10DE13BF,"GM107 INT52" }, //
// 12B0 - 12BF
{ 0x10DE13C0,"NVIDIA GeForce GTX 980" }, // GM107GLM
//{ 0x10DE13C1,"Graphics Device" }, // GM107GLM
{ 0x10DE13C2,"NVIDIA GeForce GTX 970" }, // GM107GLM
//{ 0x10DE13C3,"Graphics Device" }, // GM107GLM
{ 0x10DE13D7,"NVIDIA GeForce GTX 980M" }, //
{ 0x10DE13D8,"NVIDIA GeForce GTX 970M" }, //
//{ 0x10DE13D9,"Graphics Device" }, //
//{ 0x10DE13F0,"Graphics Device" }, // GM107GLM
//{ 0x10DE13F1,"Graphics Device" }, // GM107GLM
//{ 0x10DE1401,"Graphics Device" }, //
//{ 0x10DE1402,"Graphics Device" }, //
//{ 0x10DE143F,"Graphics Device" }, //
//{ 0x10DE1600,"Graphics Device" }, //
//{ 0x10DE1601,"Graphics Device" }, //
//{ 0x10DE1602,"Graphics Device" }, //
//{ 0x10DE1603,"Graphics Device" }, //
//{ 0x10DE1630,"Graphics Device" }, //
//{ 0x10DE1631,"Graphics Device" }, //
//{ 0x10DE1780,"Graphics Device" }, //
//{ 0x10DE1781,"Graphics Device" }, //
//{ 0x10DE1782,"Graphics Device" }, //
//{ 0x10DE1783,"Graphics Device" }, //
{ 0x10DE1789,"GRID M3-3020" }, //
{ 0x10DE1790,"N15S-GX" }, //
{ 0x10DE1791,"N15P-GT" }, //
{ 0x10DE1792,"N15P-GX" }, //
//{ 0x10DE17B3,"Quadro" }, //
//{ 0x10DE17BA,"Quadro" }, //
//{ 0x10DE17BB,"Quadro" }, //
//{ 0x10DE17BD,"Graphics Device" }, //
{ 0x10DE17BE,"GM107 CS1" } // GM107
//{ 0x10DE17C1,"Graphics Device" }, //
//{ 0x10DE17C2,"Graphics Device" }, //
//{ 0x10DE17EE,"Graphics Device" }, //
//{ 0x10DE17EF,"Graphics Device" }, //
//{ 0x10DE17F0,"Graphics Device" }, //
//{ 0x10DE17FF,"Graphics Device" }, //
};
static nvidia_card_info_t nvidia_card_exceptions[] = {
{ 0x10DE1180,0x38422682,"EVGA GTX 680 SC" },
{ 0x10DE1180,0x38422683,"EVGA GTX 680 SC" },
{ 0x10DE1185,0x10DE106F,"nVidia GeForce GTX 760 OEM" }, // GK104
{ 0x10DE1187,0x14583614,"GV-N760OC-4GD" },
{ 0x10DE1189,0x10438405,"Asus GTX 670 Direct CU II TOP" },
branches/Chimera/i386/libsaio/ati.c
4545
4646
4747
48
49
5048
51
5249
5350
5451
......
5653
5754
5855
59
60
61
62
56
57
58
59
60
61
62
63
64
6365
6466
6567
......
9698
9799
98100
99
101
100102
101103
102104
103105
104106
105107
106
108
107109
108110
109111
......
23372339
23382340
23392341
2340
2342
23412343
23422344
23432345
......
23462348
23472349
23482350
2349
2351
23502352
23512353
23522354
"Juniper",
"Redwood",
"Broadway",
//"Madison",
//"Park",
/* Northern Islands */
//"Antilles",
"Barts",
"Caicos",
"Cayman",
/* Southern Islands */
"Tahiti",
"Pitcairn",
//"CapeVerde",
//"Thames",
//"Lombok",
//"NewZealand",
"Verde",
"Oland",
"Hainan",
"Bonaire",
"Kaveri",
"Abini",
"Hawaii",
/* ... */
"Mullins",
""
};
{"Uakari",4},
{"Zonalis",6},
{"Alouatta",4},
{"Hoolock",3},
{"Hoolock",1},
{"Vervet",4},
{"Baboon",3},
{"Eulemur",3},
{"Galago",2},
{"Colobus",2},
{"Mangabey",2},
{"Nomascus",4},
{"Nomascus",5},
{"Orangutan",2},
/* AMD6000Controller */
{"Pithecia",3},
return false;
}
// -------------------------------------------------
#if 0
uint64_t fb= (uint32_t)card->fb;
uint64_t mmio= (uint32_t)card->mmio;
devprop_add_value(card->device, "ATY,RegisterSpaceOffset", &mmio, 8);
devprop_add_value(card->device, "ATY,IOSpaceOffset", &io, 8);
#endif
devprop_add_list(ati_devprop_list);
// -------------------------------------------------
branches/Chimera/i386/libsaio/sys.c
6565
6666
6767
68
6869
6970
7071
......
7677
7778
7879
80
81
82
83
84
85
7986
8087
8188
......
203210
204211
205212
206
213
214
207215
208216
209217
210
211
212
218
219
220
221
222
223
213224
214225
215226
216227
228
217229
218230
219231
220232
233
221234
222235
223236
......
230243
231244
232245
233
246
247
234248
235249
236250
#include "disk.h"
#include "ramdisk.h"
#include "xml.h"
#include "sl.h"
#include <libkern/crypto/md5.h>
//#include <uuid/uuid.h>
static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC};
#endif
#if DEBUG
#define DBG(x...)printf(x)
#else
#define DBG(x...)msglog(x)
#endif
extern int multiboot_partition;
extern int multiboot_partition_set;
extern int multiboot_skip_partition;
readFile = bvr->fs_readfile;
if (readFile != NULL) {
if (readFile != NULL)
{
// Read the first 4096 bytes (fat header)
length = readFile(bvr, (char *)filePath, *binary, 0, 0x1000);
if (length > 0) {
if (ThinFatFile(binary, &length) == 0) {
if (length == 0) {
if (length > 0)
{
if (ThinFatFile(binary, &length) == 0)
{
if (length == 0)
{
return 0;
}
// We found a fat binary; read only the thin part
DBG("Fat Binary found. Reading thin part only...\n");
length = readFile(bvr, (char *)filePath, (void *)kLoadAddr, (unsigned long)(*binary) - kLoadAddr, length);
*binary = (void *)kLoadAddr;
} else {
// Not a fat binary; read the rest of the file
DBG("Thin Binary found. Reading rest of the file...\n");
length2 = readFile(bvr, (char *)filePath, (void *)(kLoadAddr + length), length, 0);
if (length2 == -1) {
} else {
length = bvr->fs_loadfile(bvr, (char *)filePath);
if (length > 0) {
if (length > 0)
{
ThinFatFile(binary, &length);
}
}
branches/Chimera/i386/libsaio/load.c
1818
1919
2020
21
22
23
2421
25
22
2623
24
25
2726
2827
2928
......
3231
3332
3433
34
35
36
37
38
39
3540
3641
3742
......
5459
5560
5661
57
62
63
5864
5965
60
66
67
6168
6269
6370
6471
6572
6673
67
68
74
75
76
77
6978
7079
7180
......
7584
7685
7786
78
87
88
7989
8090
8191
8292
8393
8494
85
95
96
8697
8798
8899
......
107118
108119
109120
110
111
112
113
114
115
116
117
118
119
121
122
123
124
125
126
127
128
129
130
131
120132
121133
122134
123135
124136
125
137
138
126139
127140
128141
......
131144
132145
133146
134
135
147
148
149
136150
137151
138
139
152
153
154
140155
141156
142157
......
160175
161176
162177
163
178
179
164180
165181
166182
......
187203
188204
189205
190
206
207
191208
192209
193210
......
200217
201218
202219
203
204
205
220
221
222
223
206224
207
208
209
210
211
225
226
227
228
229
230
231
212232
213233
214234
......
227247
228248
229249
230
250
251
231252
232253
233254
......
260281
261282
262283
263
284
285
264286
265287
266288
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* load.c - Functions for decoding a Mach-o Kernel.
*
* Copyright (c) 1998-2003 Apple Computer, Inc.
* load.c - Functions for decoding a Mach-o Kernel.
*
* Copyright (c) 1998-2003 Apple Computer, Inc.
*
*/
#include <mach-o/fat.h>
#include <sl.h>
#if DEBUG
#define DBG(x...)printf(x)
#else
#define DBG(x...)msglog(x)
#endif
static long DecodeSegment(long cmdBase, unsigned int*load_addr, unsigned int *load_size);
static long DecodeUnixThread(long cmdBase, unsigned int *entry);
static long DecodeSymbolTable(long cmdBase);
uint32_t fapoffset;
uint32_t fapsize;
if (fhp->magic == FAT_MAGIC) {
if (fhp->magic == FAT_MAGIC)/* 0xcafebabe */
{
nfat = fhp->nfat_arch;
swapped = 0;
} else if (fhp->magic == FAT_CIGAM) {
} else if (fhp->magic == FAT_CIGAM)/* 0xbebafeca */
{
nfat = OSSwapInt32(fhp->nfat_arch);
swapped = 1;
} else {
return -1;
}
for (; nfat > 0; nfat--, fap++) {
if (swapped) {
for (; nfat > 0; nfat--, fap++)
{
if (swapped)
{
fapcputype = OSSwapInt32(fap->cputype);
fapoffset = OSSwapInt32(fap->offset);
fapsize = OSSwapInt32(fap->size);
fapsize = fap->size;
}
if (fapcputype == archCpuType) {
if (fapcputype == archCpuType)
{
*binary = (void *) ((unsigned long)*binary + fapoffset);
size = fapsize;
break;
}
}
if (length != 0) {
if (length != 0)
{
*length = size;
}
mH = (struct mach_header *)(gBinaryAddress);
#if DEBUG
printf("magic: %x\n", (unsigned)mH->magic);
printf("cputype: %x\n", (unsigned)mH->cputype);
printf("cpusubtype: %x\n", (unsigned)mH->cpusubtype);
printf("filetype: %x\n", (unsigned)mH->filetype);
printf("ncmds: %x\n", (unsigned)mH->ncmds);
printf("sizeofcmds: %x\n", (unsigned)mH->sizeofcmds);
printf("flags: %x\n", (unsigned)mH->flags);
getchar();
#endif
/*#if DEBUG
DBG("magic: 0x%x\n", (unsigned)mH->magic);
DBG("cputype: 0x%x\n", (unsigned)mH->cputype);
DBG("cpusubtype: 0x%x\n", (unsigned)mH->cpusubtype);
DBG("filetype: 0x%x\n", (unsigned)mH->filetype);
DBG("ncmds: 0x%x\n", (unsigned)mH->ncmds);
DBG("sizeofcmds: 0x%x\n", (unsigned)mH->sizeofcmds);
DBG("flags: 0x%x\n", (unsigned)mH->flags);
DBG("archCpuType: 0x%x\n", archCpuType);
//getchar();
#endif*/
switch (archCpuType)
{
case CPU_TYPE_I386:
if (mH->magic != MH_MAGIC) {
if (mH->magic != MH_MAGIC)
{
error("Mach-O file has bad magic number\n");
return -1;
}
break;
case CPU_TYPE_X86_64:
if (mH->magic != MH_MAGIC_64 && mH->magic == MH_MAGIC) {
/*
if (mH->magic != MH_MAGIC_64 && mH->magic == MH_MAGIC)
{
return -1;
}
if (mH->magic != MH_MAGIC_64) {
*/
if (mH->magic != MH_MAGIC_64)
{
error("Mach-O file has bad magic number\n");
return -1;
}
unsigned int load_addr;
unsigned int load_size;
switch (cmd) {
switch (cmd)
{
case LC_SEGMENT_64:
case LC_SEGMENT:
ret = DecodeSegment(cmdBase, &load_addr, &load_size);
}
if (ret != 0) {
if (ret != 0)
{
return -1;
}
cmdBase = cmdstart;
for (cnt = 0; cnt < ncmds; cnt++) {
cmd = ((long *)cmdBase)[0];
cmdsize = ((long *)cmdBase)[1];
for (cnt = 0; cnt < ncmds; cnt++)
{
cmd = ((long *)cmdBase)[0];
cmdsize = ((long *)cmdBase)[1];
if (cmd == LC_SYMTAB) {
if (DecodeSymbolTable(cmdBase) != 0) {
return -1;
}
}
if (cmd == LC_SYMTAB)
{
if (DecodeSymbolTable(cmdBase) != 0)
{
return -1;
}
}
cmdBase += cmdsize;
}
long vmsize, filesize;
unsigned long vmaddr, fileaddr;
if (((long *)cmdBase)[0] == LC_SEGMENT_64) {
if (((long *)cmdBase)[0] == LC_SEGMENT_64)
{
struct segment_command_64 *segCmd;
segCmd = (struct segment_command_64 *)cmdBase;
vmaddr = (segCmd->vmaddr & 0x3fffffff);
#endif
}
if (vmsize == 0 || filesize == 0) {
if (vmsize == 0 || filesize == 0)
{
*load_addr = ~0;
*load_size = 0;
return 0;
branches/Chimera/i386/libsaio/ati.h
1616
1717
1818
19
20
2119
2220
2321
......
5149
5250
5351
54
52
53
5554
5655
5756
......
8483
8584
8685
87
88
89
9086
91
9287
9388
9489
9590
9691
97
92
93
94
95
96
97
98
99
100
101
98102
99103
100
101
102
103
104
105
106
107
104
105
106
107
108
109
110
111
108112
109113
110114
#include "device_inject.h"
#include "ati_reg.h"
/* DEFINES */
#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e
CHIP_FAMILY_UNKNOW,
/* Old */
CHIP_FAMILY_R420,
CHIP_FAMILY_RV410,
CHIP_FAMILY_R423,
CHIP_FAMILY_RV410,
CHIP_FAMILY_RV515,
CHIP_FAMILY_R520,
CHIP_FAMILY_RV530,
CHIP_FAMILY_HEMLOCK,
CHIP_FAMILY_JUNIPER,
CHIP_FAMILY_REDWOOD,
CHIP_FAMILY_BROADWAY,
//CHIP_FAMILY_MADISON,
//CHIP_FAMILY_PARK,
/* Northern Islands */
//CHIP_FAMILY_ANTILLES,
CHIP_FAMILY_BARTS,
CHIP_FAMILY_CAICOS,
CHIP_FAMILY_CAYMAN,
CHIP_FAMILY_TURKS,
/* Southern Islands */
CHIP_FAMILY_TAHITI,
CHIP_FAMILY_PALM,
CHIP_FAMILY_LOMBOK,
CHIP_FAMILY_WRESTLER,
CHIP_FAMILY_SUMO,
CHIP_FAMILY_SUMO2,
CHIP_FAMILY_MANHATTAN,
CHIP_FAMILY_VANCOUVER,
CHIP_FAMILY_TRINITY,
CHIP_FAMILY_ARUBA,
CHIP_FAMILY_TAHITI,
CHIP_FAMILY_PITCAIRN,
CHIP_FAMILY_VERDE,
CHIP_FAMILY_THAMES,
CHIP_FAMILY_LOMBOK,
//CHIP_FAMILY_NEWZEALAND,
CHIP_FAMILY_SUMO,
CHIP_FAMILY_MANHATTAN,
CHIP_FAMILY_VANCOUVER,
CHIP_FAMILY_WRESTLER,
CHIP_FAMILY_TRINITY,
CHIP_FAMILY_OLAND,
CHIP_FAMILY_HAINAN,
CHIP_FAMILY_BONAIRE,
CHIP_FAMILY_KAVERI,
CHIP_FAMILY_KABINI,
CHIP_FAMILY_HAWAII,
/* ... */
CHIP_FAMILY_MULLINS,
CHIP_FAMILY_LAST
} ati_chip_family_t;
branches/Chimera/i386/libsaio/platform.c
2020
2121
2222
23
23
2424
2525
2626
#if DEBUG_PLATFORM
#define DBG(x...)printf(x)
#else
#define DBG(x...)
#define DBG(x...)msglog(x)
#endif
PlatformInfo_t Platform;
branches/Chimera/i386/libsaio/cpu.c
2727
2828
2929
30
31
32
33
34
35
36
37
38
39
30
31
32
33
34
35
36
37
38
39
4040
4141
4242
4343
4444
45
45
4646
4747
4848
4949
5050
5151
52
53
54
55
52
53
54
55
5656
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
7272
7373
74
74
7575
7676
7777
7878
7979
8080
81
82
83
84
81
82
83
84
8585
86
87
88
89
86
87
88
89
9090
91
92
91
92
9393
94
95
94
95
9696
9797
9898
......
106106
107107
108108
109
109
110110
111111
112112
......
126126
127127
128128
129
129
130130
131131
132132
133133
134134
135135
136
136
137137
138138
139139
140
140
141141
142142
143143
......
146146
147147
148148
149
149
150150
151151
152152
......
176176
177177
178178
179
179
180180
181181
182182
......
194194
195195
196196
197
197
198198
199199
200200
201201
202202
203203
204
204
205205
206206
207207
208
208
209209
210210
211211
212212
213
213
214214
215215
216216
......
285285
286286
287287
288
288
289289
290290
291291
292292
293
293
294294
295
295
296296
297297
298
299
300
301
302
303
304
305
306
307
308
309
310
298
299
300
301
302
303
311304
312305
313306
......
388381
389382
390383
391
384
392385
393386
394387
......
396389
397390
398391
399
392
400393
401394
402395
......
416409
417410
418411
419
412
413
420414
421415
422416
......
457451
458452
459453
454
460455
461456
462457
*/
uint64_t timeRDTSC(void)
{
intattempts = 0;
uint64_t latchTime;
uint64_tsaveTime,intermediate;
unsigned int timerValue, lastValue;
//boolean_tint_enabled;
/*
* Table of correction factors to account for
* - timer counter quantization errors, and
* - undercounts 0..5
*/
intattempts = 0;
uint64_t latchTime;
uint64_tsaveTime,intermediate;
unsigned int timerValue, lastValue;
//boolean_tint_enabled;
/*
* Table of correction factors to account for
* - timer counter quantization errors, and
* - undercounts 0..5
*/
#define SAMPLE_CLKS_EXACT(((double) CLKNUM) / 20.0)
#define SAMPLE_CLKS_INT((int) CLKNUM / 20)
#define SAMPLE_NSECS(2000000000LL)
#define SAMPLE_MULTIPLIER(((double)SAMPLE_NSECS)*SAMPLE_CLKS_EXACT)
#define ROUND64(x)((uint64_t)((x) + 0.5))
uint64_tscale[6] = {
uint64_tscale[6] = {
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-0)),
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-1)),
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-2)),
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-3)),
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-4)),
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-5))
};
//int_enabled = ml_set_interrupts_enabled(FALSE);
};
//int_enabled = ml_set_interrupts_enabled(FALSE);
restart:
if (attempts >= 9) // increase to up to 9 attempts.
{
// This will flash-reboot. TODO: Use tscPanic instead.
printf("Timestamp counter calibation failed with %d attempts\n", attempts);
}
attempts++;
enable_PIT2();// turn on PIT2
set_PIT2(0);// reset timer 2 to be zero
latchTime = rdtsc64();// get the time stamp to time
latchTime = get_PIT2(&timerValue) - latchTime; // time how long this takes
set_PIT2(SAMPLE_CLKS_INT);// set up the timer for (almost) 1/20th a second
saveTime = rdtsc64();// now time how long a 20th a second is...
get_PIT2(&lastValue);
get_PIT2(&lastValue);// read twice, first value may be unreliable
do {
if (attempts >= 9) // increase to up to 9 attempts.
{
// This will flash-reboot. TODO: Use tscPanic instead.
printf("Timestamp counter calibation failed with %d attempts\n", attempts);
}
attempts++;
enable_PIT2();// turn on PIT2
set_PIT2(0);// reset timer 2 to be zero
latchTime = rdtsc64();// get the time stamp to time
latchTime = get_PIT2(&timerValue) - latchTime; // time how long this takes
set_PIT2(SAMPLE_CLKS_INT);// set up the timer for (almost) 1/20th a second
saveTime = rdtsc64();// now time how long a 20th a second is...
get_PIT2(&lastValue);
get_PIT2(&lastValue);// read twice, first value may be unreliable
do {
intermediate = get_PIT2(&timerValue);
if (timerValue > lastValue)
{
{
// Timer wrapped
set_PIT2(0);
disable_PIT2();
goto restart;
}
lastValue = timerValue;
} while (timerValue > 5);
printf("timerValue %d\n",timerValue);
printf("intermediate 0x%016llx\n",intermediate);
printf("saveTime 0x%016llx\n",saveTime);
} while (timerValue > 5);
printf("timerValue %d\n",timerValue);
printf("intermediate 0x%016llx\n",intermediate);
printf("saveTime 0x%016llx\n",saveTime);
intermediate -= saveTime;// raw count for about 1/20 second
intermediate *= scale[timerValue];// rescale measured time spent
intermediate /= SAMPLE_NSECS;// so its exactly 1/20 a second
intermediate += latchTime;// add on our save fudge
intermediate -= saveTime;// raw count for about 1/20 second
intermediate *= scale[timerValue];// rescale measured time spent
intermediate /= SAMPLE_NSECS;// so its exactly 1/20 a second
intermediate += latchTime;// add on our save fudge
set_PIT2(0);// reset timer 2 to be zero
disable_PIT2();// turn off PIT 2
set_PIT2(0);// reset timer 2 to be zero
disable_PIT2();// turn off PIT 2
//ml_set_interrupts_enabled(int_enabled);
return intermediate;
//ml_set_interrupts_enabled(int_enabled);
return intermediate;
}
/*
unsigned long pollCount;
uint64_t retval = 0;
int i;
/* Time how many TSC ticks elapse in 30 msec using the 8254 PIT
* counter 2. We run this loop 3 times to make sure the cache
* is hot and we take the minimum delta from all of the runs.
/* The poll loop must have run at least a few times for accuracy */
if (pollCount <= 1) {
continue;
}
}
/* The TSC must increment at LEAST once every millisecond.
* We should have waited exactly 30 msec so the TSC delta should
* be >= 30. Anything less and the processor is way too slow.
*/
if ((tscEnd - tscStart) <= CALIBRATE_TIME_MSEC) {
continue;
}
}
// tscDelta = MIN(tscDelta, (tscEnd - tscStart))
if ( (tscEnd - tscStart) < tscDelta ) {
tscDelta = tscEnd - tscStart;
}
}
}
/* tscDelta is now the least number of TSC ticks the processor made in
* a timespan of 0.03 s (e.g. 30 milliseconds)
* Hz so we need to convert our milliseconds to seconds. Since we're
* dividing by the milliseconds, we simply multiply by 1000.
*/
/* Unlike linux, we're not limited to 32-bit, but we do need to take care
* that we're going to multiply by 1000 first so we do need at least some
* arithmetic headroom. For now, 32-bit should be enough.
unsigned long pollCount;
uint64_t retval = 0;
int i;
/* Time how many APERF ticks elapse in 30 msec using the 8254 PIT
* counter 2. We run this loop 3 times to make sure the cache
* is hot and we take the minimum delta from all of the runs.
/* The poll loop must have run at least a few times for accuracy */
if (pollCount <= 1) {
continue;
}
}
/* The TSC must increment at LEAST once every millisecond.
* We should have waited exactly 30 msec so the APERF delta should
* be >= 30. Anything less and the processor is way too slow.
*/
if ((aperfEnd - aperfStart) <= CALIBRATE_TIME_MSEC) {
continue;
}
}
// tscDelta = MIN(tscDelta, (tscEnd - tscStart))
if ( (aperfEnd - aperfStart) < aperfDelta ) {
aperfDelta = aperfEnd - aperfStart;
}
}
}
/* mperfDelta is now the least number of MPERF ticks the processor made in
* a timespan of 0.03 s (e.g. 30 milliseconds)
*/
if (aperfDelta > (1ULL<<32)) {
retval = 0;
} else {
+--------+----------------+--------+----+----+--------+--------+--------+
|########|Extended family |Extmodel|####|type|familyid| model |stepping|
+--------+----------------+--------+----+----+--------+--------+--------+
EAX (AMD):
31 28 27 20 19 16 1514 1312 11 8 7 4 3 0
+--------+----------------+--------+----+----+--------+--------+--------+
|########|Extended family |Extmodel|####|####|familyid| model |stepping|
+--------+----------------+--------+----+----+--------+--------+--------+
+--------+----------------+--------+----+----+--------+--------+--------+
*/
p->CPU.Vendor= p->CPU.CPUID[CPUID_0][1];
p->CPU.Signature= p->CPU.CPUID[CPUID_1][0];
// stepping = cpu_feat_eax & 0xF;
p->CPU.Stepping= bitfield(p->CPU.CPUID[CPUID_1][0], 3, 0);
// model = (cpu_feat_eax >> 4) & 0xF;
p->CPU.Model= bitfield(p->CPU.CPUID[CPUID_1][0], 7, 4);
// family = (cpu_feat_eax >> 8) & 0xF;
p->CPU.Family= bitfield(p->CPU.CPUID[CPUID_1][0], 11, 8);
// type = (cpu_feat_eax >> 12) & 0x3;
//p->CPU.Type= bitfield(p->CPU.CPUID[CPUID_1][0], 13, 12);
// ext_model = (cpu_feat_eax >> 16) & 0xF;
p->CPU.ExtModel= bitfield(p->CPU.CPUID[CPUID_1][0], 19, 16);
// ext_family = (cpu_feat_eax >> 20) & 0xFF;
p->CPU.ExtFamily= bitfield(p->CPU.CPUID[CPUID_1][0], 27, 20);
p->CPU.Stepping= bitfield(p->CPU.CPUID[CPUID_1][0], 3, 0); // stepping = cpu_feat_eax & 0xF;
p->CPU.Model= bitfield(p->CPU.CPUID[CPUID_1][0], 7, 4); // model = (cpu_feat_eax >> 4) & 0xF;
p->CPU.Family= bitfield(p->CPU.CPUID[CPUID_1][0], 11, 8); // family = (cpu_feat_eax >> 8) & 0xF;
//p->CPU.Type= bitfield(p->CPU.CPUID[CPUID_1][0], 13, 12); // type = (cpu_feat_eax >> 12) & 0x3;
p->CPU.ExtModel= bitfield(p->CPU.CPUID[CPUID_1][0], 19, 16); // ext_model = (cpu_feat_eax >> 16) & 0xF;
p->CPU.ExtFamily= bitfield(p->CPU.CPUID[CPUID_1][0], 27, 20); // ext_family = (cpu_feat_eax >> 20) & 0xFF;
p->CPU.Model += (p->CPU.ExtModel << 4);
if (p->CPU.Vendor == CPUID_VENDOR_INTEL &&
if (p->CPU.NoThreads > p->CPU.NoCores) {
p->CPU.Features |= CPU_FEATURE_HTT;
}
tscFrequency = measure_tsc_frequency();
/* if usual method failed */
if ( tscFrequency < 1000 ) { //TEST
}
fsbFrequency = 0;
cpuFrequency = 0;
if ((p->CPU.Vendor == CPUID_VENDOR_INTEL) && ((p->CPU.Family == 0x06) || (p->CPU.Family == 0x0f))) {
int intelCPU = p->CPU.Model;
if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0c) || (p->CPU.Family == 0x0f && p->CPU.Model >= 0x03)) {
p->CPU.Model == CPU_MODEL_HASWELL ||
p->CPU.Model == CPU_MODEL_HASWELL_SVR ||
p->CPU.Model == CPU_MODEL_HASWELL_ULT ||
p->CPU.Model == CPU_MODEL_CRYSTALWELL )){
p->CPU.Model == CPU_MODEL_CRYSTALWELL ||
p->CPU.Model == CPU_MODEL_BROADWELL )){
msr = rdmsr64(MSR_PLATFORM_INFO);
//DBG("msr(%d): platform_info %08x\n", __LINE__, bitfield(msr, 31, 0));
bus_ratio_max = bitfield(msr, 15, 8);//MacMan: Changed bitfield to match Apple tsc.c
case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1050 (22nm)
case CPU_MODEL_HASWELL_ULT:
case CPU_MODEL_CRYSTALWELL:
case CPU_MODEL_BROADWELL:
{
msr = rdmsr64(MSR_IA32_PERF_STATUS);
currcoef = bitfield(msr, 15, 8);
branches/Chimera/i386/libsaio/platform.h
3030
3131
3232
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
4951
50
51
52
53
5254
53
54
55
56
5557
5658
57
58
59
59
60
61
62
63
6064
61
65
6266
6367
64
68
69
70
71
72
73
74
75
6576
6677
6778
......
98109
99110
100111
112
101113
102114
103115
......
131143
132144
133145
134
146
147
135148
136149
137150
151
152
138153
139154
140155
......
177192
178193
179194
180
195
181196
182197
183198
#define CPUID_889
#define CPUID_MAX10
#define CPU_MODEL_PRESCOTT0x03// Celeron D, Pentium 4 (90nm)
#define CPU_MODEL_NOCONA0x04// Xeon Nocona, Irwindale (90nm)
#define CPU_MODEL_PRESLER0x06// Pentium 4, Pentium D (65nm)
#define CPU_MODEL_PENTIUM_M0x09// Banias
#define CPU_MODEL_DOTHAN0x0D// Dothan
#define CPU_MODEL_YONAH0x0E// Sossaman, Yonah
#define CPU_MODEL_MEROM0x0F// Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom
#define CPU_MODEL_CONROE0x0F//
#define CPU_MODEL_CELERON0x16//
#define CPU_MODEL_PENRYN0x17// Wolfdale, Yorkfield, Harpertown, Penryn
#define CPU_MODEL_WOLFDALE0x17//
#define CPU_MODEL_NEHALEM0x1A// Bloomfield. Nehalem-EP, Nehalem-WS, Gainestown
#define CPU_MODEL_ATOM0x1C// Pineview
#define CPU_MODEL_XEON_MP0x1D// MP 7400
#define CPU_MODEL_FIELDS0x1E// Lynnfield, Clarksfield, Jasper Forest
#define CPU_MODEL_DALES0x1F// Havendale, Auburndale
#define CPU_MODEL_ANY 0x00
#define CPU_MODEL_UNKNOWN 0x01
#define CPU_MODEL_PRESCOTT 0x03// Celeron D, Pentium 4 (90nm)
#define CPU_MODEL_NOCONA 0x04// Xeon Nocona, Irwindale (90nm)
#define CPU_MODEL_PRESLER 0x06// Pentium 4, Pentium D (65nm)
#define CPU_MODEL_PENTIUM_M 0x09// Banias
#define CPU_MODEL_DOTHAN 0x0D// Dothan
#define CPU_MODEL_YONAH 0x0E// Sossaman, Yonah
#define CPU_MODEL_MEROM 0x0F// Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom
#define CPU_MODEL_CONROE 0x0F//
#define CPU_MODEL_CELERON 0x16//
#define CPU_MODEL_PENRYN 0x17// Wolfdale, Yorkfield, Harpertown, Penryn
#define CPU_MODEL_WOLFDALE 0x17//
#define CPU_MODEL_NEHALEM 0x1A// Bloomfield. Nehalem-EP, Nehalem-WS, Gainestown
#define CPU_MODEL_ATOM 0x1C// Pineview
#define CPU_MODEL_XEON_MP 0x1D// MP 7400
#define CPU_MODEL_FIELDS 0x1E// Lynnfield, Clarksfield, Jasper Forest
#define CPU_MODEL_DALES 0x1F// Havendale, Auburndale
#define CPU_MODEL_DALES_32NM0x25// Clarkdale, Arrandale
#define CPU_MODEL_ATOM_SAN0x26// Lincroft
#define CPU_MODEL_LINCROFT0x27//
#define CPU_MODEL_ATOM_SAN 0x26// Lincroft
#define CPU_MODEL_LINCROFT 0x27//
#define CPU_MODEL_SANDYBRIDGE0x2A// Sandy Bridge
#define CPU_MODEL_WESTMERE0x2C// Gulftown, Westmere-EP, Westmere-WS
#define CPU_MODEL_JAKETOWN0x2D// Sandy Bridge-E, Sandy Bridge-EP
#define CPU_MODEL_WESTMERE 0x2C// Gulftown, Westmere-EP, Westmere-WS
#define CPU_MODEL_JAKETOWN 0x2D// Sandy Bridge-E, Sandy Bridge-EP
#define CPU_MODEL_NEHALEM_EX0x2E// Beckton
#define CPU_MODEL_WESTMERE_EX0x2F// Westmere-EX
#define CPU_MODEL_ATOM_20000x36// Cedarview
#define CPU_MODEL_IVYBRIDGE0x3A// Ivy Bridge
#define CPU_MODEL_HASWELL0x3C// Haswell DT
#define CPU_MODEL_ATOM_2000 0x36// Cedarview / Saltwell
#define CPU_MODEL_SILVERMONT0x37// Atom Silvermont
#define CPU_MODEL_IVYBRIDGE 0x3A// Ivy Bridge
#define CPU_MODEL_HASWELL 0x3C// Haswell DT
#define CPU_MODEL_BROADWELL 0x3D// Broadwell / Core-AVX2
#define CPU_MODEL_IVYBRIDGE_XEON0x3E// Ivy Bridge Xeon
#define CPU_MODEL_HASWELL_SVR0x3F// Haswell MB
#define CPU_MODEL_HASWELL_SVR0x3F// Haswell Server
//#define CPU_MODEL_HASWELL_H0x??// Haswell H
#define CPU_MODEL_HASWELL_ULT0x45// Haswell ULT
#define CPU_MODEL_CRYSTALWELL0x46// Haswell ULX
#define CPU_MODEL_CRYSTALWELL0x46// Crystal Well
// 4A silvermont / atom
#define CPU_MODEL_AVOTON 0x4D// Silvermont/Avoton Atom C2000
// 4E Core???
#define CPU_MODEL_BRODWELL_SVR0x4F// Broadwell Server
#define CPU_MODEL_BRODWELL_MSVR0x56// Broadwell Micro Server
// 5A silvermont / atom
// 5D silvermont / atom
/* CPU Features */
#define CPU_FEATURE_MMX0x00000001// MMX Instruction Set
#define SMB_MEM_TYPE_DDR219
#define SMB_MEM_TYPE_FBDIMM20
#define SMB_MEM_TYPE_DDR324// Supported in 10.5.6+ AppleSMBIOS
#define SMB_MEM_TYPE_DDR426
/* Memory Configuration Types */
#define SMB_MEM_CHANNEL_UNKNOWN0
//==============================================================================
typedef struct _PlatformInfo_t {
typedef struct _PlatformInfo_t
{
struct CPU {
uint32_tFeatures;// CPU Features like MMX, SSE2, VT, MobileCPU
uint32_tVendor;// Vendor
uint32_tCoresPerPackage;
uint32_tLogicalPerPackage;
uint32_tSignature;// Processor Signature
uint32_tStepping;// Stepping
//uint16_tType;// Type
intDIMM[MAX_RAM_SLOTS];// Information and SPD mapping for each slot
} DMI;
uint8_tType;// System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FACP: PM_Profile)
uint8_tType;// System Type: 1=Desktop, 2=Portable, 3=Workstation... according ACPI2.0 (FACP: PM_Profile)
uint8_t*UUID;
} PlatformInfo_t;
branches/Chimera/i386/libsaio/disk.c
10391039
10401040
10411041
1042
1043
10421044
1043
1045
10441046
10451047
10461048
......
10771079
10781080
10791081
1082
10801083
10811084
10821085
......
10951098
10961099
10971100
1101
10981102
10991103
11001104
......
15721576
15731577
15741578
1575
1579
1580
15761581
15771582
15781583
1579
15801584
15811585
15821586
15831587
15841588
15851589
1586
1590
1591
15871592
15881593
15891594
15901595
1591
1596
1597
15921598
15931599
15941600
1601
15951602
15961603
15971604
HFSGetDirEntry,
HFSGetFileBlock,
HFSGetUUID,
HFSGetDescription,
HFSFree,
0,
kBIOSDevTypeHardDrive);
kBIOSDevTypeHardDrive, 0);
bvr->next = map->bvr;
map->bvr = bvr;
map->bvrcnt++;
{
return NULL;
}
bzero(buffer,BPS);
/* Check for alternate block size */
if (readBytes( biosdev, 0, 0, BPS, buffer ) != 0)
{
return NULL;
}
bzero(buffer,BPS);
}
factor = blksize / BPS;
}
const char *val;
int len;
if (getValueForKey(kProductVersion, &val, &len, &systemVersion)) {
if (getValueForKey(kProductVersion, &val, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim
*str = '\0';
//strncat(str, val, MIN(len, 4)); // removed since it breaks any OS X version greater than 10.9 i.e. Yosemite 10.10
strncat(str, val, len); // just copy the whole version number instead
} else {
valid = false;
}
}
if(!valid) {
if(!valid)
{
int fh = -1;
sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0) {
if (fh >= 0)
{
valid = true;
bvr->OSisInstaller = true;
strcpy(bvr->OSVersion, "10.7"); // 10.7 +
close(fh);
} else {
close(fh);
}
branches/Chimera/i386/libsaio/smbios.c
125125
126126
127127
128
128
129129
130130
131131
......
186186
187187
188188
189
190
189
190
191191
192192
193193
......
267267
268268
269269
270
270
271271
272272
273273
......
430430
431431
432432
433
433434
435
434436
435437
436438
......
458460
459461
460462
463
464
461465
462466
463467
464468
465469
466
467
470
471
472
473
468474
475
476
477
478
479
469480
470481
471482
......
500511
501512
502513
514
503515
504516
505517
......
513525
514526
515527
516
528
517529
518530
519531
......
546558
547559
548560
561
562
549563
550564
551565
......
584598
585599
586600
587
601
588602
589603
590604
......
604618
605619
606620
607
621
608622
609623
610624
611625
612
626
627
613628
614629
615630
......
643658
644659
645660
646
661
647662
648663
649664
......
662677
663678
664679
665
680
666681
667682
668683
669684
670685
671
672
686
687
673688
674689
675690
......
679694
680695
681696
682
683
684
685
697
698
699
700
686701
687
702
703
688704
689705
690706
691707
692708
693
709
694710
695711
696712
697713
698
699
714
715
716
717
718
719
720
700721
701
722
723
702724
703725
704726
705727
706728
707729
708
709
730
731
710732
711
733
712734
713735
714736
......
717739
718740
719741
720
721
742
743
722744
723
745
724746
725747
726748
......
853875
854876
855877
856
878
857879
858880
859881
......
870892
871893
872894
873
874
875
895
896
897
876898
877899
878900
......
898920
899921
900922
901
902
903
923
924
925
904926
905927
906928
......
9831005
9841006
9851007
986
1008
9871009
9881010
9891011
1012
1013
1014
9901015
9911016
9921017
......
10721097
10731098
10741099
1075
1100
10761101
10771102
10781103
/* ==============================================
OEM Platform Feature (Apple Specific - Type 133)
================================================ */
//#define kSMBOemPlatformFeatureKey
//#define kSMBOemPlatformFeatureKey "SMoemplatformfeature"
/* ==================================================*/
#define getFieldOffset(struct, field)((uint8_t)(uint32_t)&(((struct *)0)->field))
uint8_tchassisType;
char*version;
char*serialNumber;
char*assetTag; // Bungo: renamed folowing convention
//char*skuNumber;
char*assetTag;
char*skuNumber;
} defaultChassis_t;
defaultChassis_t defaultChassis;
kSMBBaseBoardSerialNumberKey, NULL, &defaultBaseBoard.serialNumber }, // SMboardserial - C02140302D5DMT31M
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, assetTag),
kSMBBaseBoardAssetTagKey, NULL, &defaultBaseBoard.assetTag }, // SMboardassetag - Base Board Asset Tag#
kSMBBaseBoardAssetTagKey, NULL, &defaultBaseBoard.assetTag }, // SMboardassettag - Base Board Asset Tag#
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, locationInChassis),
kSMBBaseBoardLocationInChassisKey, NULL, &defaultBaseBoard.locationInChassis }, // SMboardlocation - Part Component
#define kDefaultMacMiniBoardProduct"Mac-F4208EAA"
// MacMini5,1 Mac-8ED6AF5B48C039E1 - MM51.88Z.0077.B0F.1110201309
// MacMini5,2 Mac-4BC72D62AD45599E
// MacMini5,3
//#define kDefaultMacMini"Macmini5,3"
//#define kDefaultMacMiniBIOSVersion" MM51.88Z.0077.B10.1201241549"
// MacBookAir4,1 - Mac-C08A6BB70A942AC2
// MacBookAir4,2 - Mac-742912EFDBEE19B3
// MacBookAir5,2
#define kDefaultMacBookAir"MacBookAir5,2"
#define kDefaultMacBookAirBIOSVersion" MBA51.88Z.00EF.B00.1205221442"
#define kDefaultMacBookAirBIOSReleaseDate"05/10/12"
#define kDefaultMacBookBoardAirProduct"Mac-2E6FAB96566FE58C"
// MacBookAir6,1 - Mac-35C1E88140C3E6CF - MBA61.88Z.0099.B04.1309271229
// MacBookAir6,2 - Mac-7DF21CB3ED6977E5 - MBA62.88Z.00EF.B00.1205221442
// MacBookAir6,1
// Bios: MBA61.88Z.0099.B04.1309271229
// Board: Mac-35C1E88140C3E6CF
// Data: 24/06/13
// MacBookAir6,2
// Bios: MBA62.88Z.00EF.B00.1205221442
// Board: Mac-7DF21CB3ED6977E5
// Data: 24/06/13
//=========== MacBookPro ===========
#define kDefaultMacBookProFamily"MacBook Pro"
//#define kDefaultMacBookProBoardAssetTagNumber"MacBook-Aluminum"
#define kDefaultiMacBIOSVersion" IM81.88Z.00C1.B00.0903051113"
#define kDefaultiMacBIOSReleaseDate"02/09/08"
#define kDefaultiMacBoardProduct"Mac-F227BEC8"
#define kDefaultMacFamily"Mac" // iMac8,1 family = "Mac" not "iMac"
// iMac10,1
// iMac11,1 core i3/i5/i7
// iMac12,1
#define kDefaultiMacSandy"iMac12,1"
#define kDefaultiMacSandyBIOSVersion" IM121.88Z.0047.B00.1102091756"
#define kDefaultiMacSandyBIOSReleaseDate"01/02/08"
#define kDefaultiMacSandyBIOSReleaseDate"04/22/11"
#define kDefaultiMacSandyBoardProduct"Mac-942B5BF58194151B"
// iMac12,2 Mac-942B59F58194171B
//#define KDefaultMacProBoardSerialNumber"J593902RA4MFE"
// Mac Pro 4,1 core i7/Xeon
#define kDefaultMacProNahWestSystemVersion"0.0"
#define kDefaultMacProNehalem"MacPro4,1"
#define kDefaultMacProNehalemBIOSVersion" MP41.88Z.0081.B07.0910130729"
#define kDefaultMacProNehalemBIOSReleaseDate"10/13/09"
bool useSMBIOSdefaults = true; // Bungo
SMBByte PlatformType= 3; // Bungo: same as Platfom.Type in platform.h
SMBByte PlatformType= 1; // Bungo: same as Platfom.Type in platform.h. Because can't get from ACPI FADT PM profile and platformCPUFeature(CPU_FEATURE_MOBILE)) doesn't work as expect, FIXING NEEDED.
/* Rewrite this function */
void setDefaultSMBData(void) // Bungo: setting data from real Macs
defaultChassis.manufacturer = kDefaultVendorManufacturer;
defaultChassis.serialNumber = kDefaultSerialNumber;
defaultChassis.assetTag = kDefaultAssetTag;
//defaultChassis.skuNumber = kDefaultSkuNumber;
defaultChassis.skuNumber = kDefaultSkuNumber;
// if (platformCPUFeature(CPU_FEATURE_MOBILE)) Bungo: doesn't recognise correctly, need fixing
if (PlatformType == 2) // this method works but it's a substitute
{
if (Platform.CPU.NoCores > 1) {
if (Platform.CPU.NoCores > 1)
{
defaultSystemInfo.productName = kDefaultMacBookPro;
defaultBIOSInfo.version = kDefaultMacBookProBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultMacBookProBIOSReleaseDate;
defaultBIOSInfo.version = kDefaultiMacBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultiMacBIOSReleaseDate;
defaultSystemInfo.productName = kDefaultiMac;
defaultSystemInfo.family = kDefaultiMacFamily;
defaultSystemInfo.family = kDefaultiMacFamily; // iMac8,1 family = Mac
defaultBaseBoard.product = kDefaultiMacBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardMotherboard;
defaultChassis.chassisType = kSMBchassisAllInOne;
defaultBIOSInfo.version= kDefaultiMacNehalemBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultiMacNehalemBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultiMacNehalem;
defaultSystemInfo.family= kDefaultiMacFamily;
defaultSystemInfo.family= kDefaultiMacFamily; // iMac8,1 family = Mac
defaultBaseBoard.product = kDefaultiMacNehalemBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardMotherboard;
defaultChassis.chassisType = kSMBchassisAllInOne;
break;
case CPU_MODEL_SANDYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (32nm)
case CPU_MODEL_IVYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (22nm)
case CPU_MODEL_SANDYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (32nm)
case CPU_MODEL_IVYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (22nm)
defaultBIOSInfo.version = kDefaultiMacSandyBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultiMacSandyBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultiMacSandy;
defaultChassis.chassisType = kSMBchassisAllInOne;
break;
case CPU_MODEL_NEHALEM:// Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm)
case CPU_MODEL_NEHALEM_EX:// Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x
defaultBIOSInfo.version= kDefaultMacProNehalemBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultMacProNehalemBIOSReleaseDate;
case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm)
case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x
defaultBIOSInfo.version = kDefaultMacProNehalemBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultMacProNehalemBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultMacProNehalem;
defaultSystemInfo.family= kDefaultMacProFamily;
defaultSystemInfo.version = kDefaultMacProNahWestSystemVersion;
defaultSystemInfo.family = kDefaultMacProFamily;
defaultBaseBoard.product = kDefaultMacProNehalemBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardProcessorMemoryModule;
defaultChassis.chassisType = kSMBchassisTower;
break;
case CPU_MODEL_WESTMERE:// Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core
case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core
case CPU_MODEL_WESTMERE_EX:// Intel Xeon E7
case CPU_MODEL_JAKETOWN:// Intel Core i7, Xeon E5 LGA2011 (32nm)
case CPU_MODEL_IVYBRIDGE_XEON: // Intel Core i7, Xeon E5 v2 LGA2011 (22nm) MacMan moved to proper location
case CPU_MODEL_HASWELL_SVR: // Intel Core i7, Xeon E5 v3 LGA2011v3 (22nm)
defaultBIOSInfo.version= kDefaultMacProWestmereBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultMacProWestmereBIOSReleaseDate;
case CPU_MODEL_BROADWELL: // Intel Core i3, i5, i7 LGA1150 LGA2011v3 (14nm)
case CPU_MODEL_HASWELL_ULT:
case CPU_MODEL_CRYSTALWELL:
case CPU_MODEL_BRODWELL_SVR:
case CPU_MODEL_BRODWELL_MSVR:
defaultBIOSInfo.version = kDefaultMacProWestmereBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultMacProWestmereBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultMacProWestmere;
defaultSystemInfo.family= kDefaultMacProFamily;
defaultSystemInfo.version = kDefaultMacProNahWestSystemVersion;
defaultSystemInfo.family = kDefaultMacProFamily;
defaultBaseBoard.product = kDefaultMacProWestmereBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardProcessorMemoryModule;
defaultChassis.chassisType = kSMBchassisTower;
break;
default:
defaultBIOSInfo.version= kDefaultMacProBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultMacProBIOSReleaseDate;
defaultBIOSInfo.version = kDefaultMacProBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultMacProBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultMacPro;
defaultSystemInfo.family= kDefaultMacProFamily;
defaultSystemInfo.family = kDefaultMacProFamily;
defaultBaseBoard.product = kDefaultMacProBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardMotherboard;
defaultChassis.chassisType = kSMBchassisUnknown;
break;
}
default:
defaultBIOSInfo.version= kDefaultMacProBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultMacProBIOSReleaseDate;
defaultBIOSInfo.version = kDefaultMacProBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultMacProBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultMacPro;
defaultSystemInfo.family= kDefaultMacProFamily;
defaultSystemInfo.family = kDefaultMacProFamily;
defaultBaseBoard.product = kDefaultMacProBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardMotherboard;
defaultChassis.chassisType = kSMBchassisUnknown;
case kSMBByte:
case kSMBWord:
case kSMBDWord:
//case kSMBQWord:
case kSMBQWord:
if (SMBSetters[idx].keyString) {
parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist);
if (!parsed)
case kSMBWord:
value->word = (uint16_t)val;
break;
//case kSMBQWord:
//value->qword = (uint64_t)val;
//break;
case kSMBQWord:
value->qword = (uint64_t)val;
break;
case kSMBDWord:
default:
value->dword = (uint32_t)val;
case kSMBWord:
value->word = *(uint16_t *)(SMBSetters[idx].defaultValue);
break;
//case kSMBQWord:
//value->qword = *(uint32_t *)(SMBSetters[idx].defaultValue);
//break;
case kSMBQWord:
value->qword = *(uint64_t *)(SMBSetters[idx].defaultValue);
break;
case kSMBDWord:
default:
value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue);
case CPU_MODEL_IVYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (22nm)
case CPU_MODEL_IVYBRIDGE_XEON:
case CPU_MODEL_JAKETOWN:// Intel Core i7, Xeon E5 LGA2011 (32nm)
case CPU_MODEL_HASWELL:
case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7 LGA1150 LGA2011v3 (22nm)
case CPU_MODEL_HASWELL_SVR:
case CPU_MODEL_HASWELL_ULT:
case CPU_MODEL_CRYSTALWELL:
case CPU_MODEL_BROADWELL: // Intel Core i3, i5, i7 LGA1150 LGA2011v3 (14nm)
case CPU_MODEL_BRODWELL_SVR:
case CPU_MODEL_BRODWELL_MSVR:
break;
structSize = sizeof(SMBMemoryDevice);
break;
default:
structSize = structPtr->orig->length; // don't change if not to patch
structSize = structPtr->orig->length; // doesn't change a length for unpatched
break;
}
branches/Chimera/i386/libsaio/smbios_decode.c
170170
171171
172172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
173192
174193
175194
......
382401
383402
384403
404
405
406
407
385408
386409
387410
......
398421
399422
400423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
401440
402441
403442
......
412451
413452
414453
454
455
456
415457
416458
459
460
461
462
463
464
465
466
417467
418468
419469
......
421471
422472
423473
424
474
475
476
477
478
425479
426480
427
428
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
429500
430501
431502
......
480551
481552
482553
483
554
484555
485556
486557
"Socket LGA1356-3" /* 2Ch */
};
static const char *SMBMemoryDeviceFormFactors[] = // Bungo: strings for form factor (Table Type 17 - Memory Device)
{
"Other", /* 01h */
"Unknown", /* 02h */
"SIMM", /* 03h */
"SIP", /* 04h */
"Chip", /* 05h */
"DIP", /* 06h */
"ZIP", /* 07h */
"Proprietary Card", /* 08h */
"DIMM", /* 09h */
"TSOP", /* 0Ah */
"Row of chips", /* 0Bh */
"RIMM", /* 0Ch */
"SODIMM", /* 0Dh */
"SRIMM", /* 0Eh */
"FB-DIMM" /* 0Fh */
};
/*=====
7.18.2
====*/
}
//-------------------------------------------------------------------------------------------------------------------------
// Memory Controller Information (Type 5)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// Memory Module Information (Type 6)
//-------------------------------------------------------------------------------------------------------------------------
//void decodeMemoryModule(SMBStructHeader *structHeader)
//}
//-------------------------------------------------------------------------------------------------------------------------
// Cache Information (Type 7)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// Port Connector Information (Type 8)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// System Slot Information (Type 9)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// On Board Device Information (Type 10)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// OEM Strings (Type 11)
//-------------------------------------------------------------------------------------------------------------------------
void decodeSMBOEMStrings(SMBStructHeader *structHeader)
}
DBG("\n");
}
//-------------------------------------------------------------------------------------------------------------------------
// System Configuration Options (Type 12)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// BIOS Language Information (Type 13)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// Physical Memory Array (Type 16)
//-------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// MemoryDevice (Type 17)
//-------------------------------------------------------------------------------------------------------------------------
void decodeMemoryDevice(SMBStructHeader *structHeader)
printHeader(structHeader);
DBG("Memory Device\n");
// Aray Handle
DBG("\tError Information Handle: 0x%x\n", ((SMBMemoryDevice *)structHeader)->errorHandle);
if (((SMBMemoryDevice *)structHeader)->errorHandle == 0xFFFF) {
DBG("\tError Information Handle: No Error\n");
} else {
DBG("\tError Information Handle: 0x%x\n", ((SMBMemoryDevice *)structHeader)->errorHandle);
}
// Total Width:
// Data Width:
// Size:
// Form Factor:
switch (((SMBMemoryDevice *)structHeader)->memorySize) {
case 0:
DBG("\tSize: No Module Installed\n");
break;
case 0x7FFF:
DBG("\tSize: 32GB or more\n");
break;
case 0xFFFF:
DBG("\tSize: Unknown\n");
break;
default:
DBG("\tSize: %d %s\n", ((SMBMemoryDevice *)structHeader)->memorySize & 0x7FFF, ((((SMBMemoryDevice *)structHeader)->memorySize & 0x8000) == 0x8000) ? "kB" : "MB");
break;
}
if ((((SMBMemoryDevice *)structHeader)->formFactor < 0x01) || (((SMBMemoryDevice *)structHeader)->formFactor > 0x0F)) {
DBG("\tForm Factor: %s\n", OutOfSpecStr);
} else {
DBG("\tForm Factor: %s\n", SMBMemoryDeviceFormFactors[((SMBMemoryDevice *)structHeader)->formFactor - 1]);
}
// Set:
DBG("\tLocator: %s\n", SMBStringForField(structHeader, ((SMBMemoryDevice *)structHeader)->deviceLocator, neverMask));
DBG("\tBank Locator: %s\n", SMBStringForField(structHeader, ((SMBMemoryDevice *)structHeader)->bankLocator, neverMask));
//}
//-------------------------------------------------------------------------------------------------------------------------
// Specific (Type 134)
// Specific (Type 134)
//-------------------------------------------------------------------------------------------------------------------------
//void decodeOem(SMBStructHeader *structHeader)
//{
branches/Chimera/i386/libsaio/smbios.h
2424
2525
2626
27
28
27
28
2929
3030
3131
......
8181
8282
8383
84
85
86
87
84
8885
8986
9087
9188
92
89
9390
94
91
9592
9693
9794
9895
99
96
10097
101
98
10299
103100
104101
......
120117
121118
122119
123
120
124121
125122
126123
......
132129
133130
134131
135
132
136133
137134
138135
139
136
140137
141
142
138
139
143140
144141
145
146
147
142
143
148144
149145
150146
......
163159
164160
165161
166
167
168
162
163
169164
170165
171166
......
182177
183178
184179
185
186
187
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
188203
189204
190205
......
196211
197212
198213
199
214
200215
201
202216
203217
204218
205219
220
206221
207222
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
223
224
227225
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252226
253
227
254228
255229
256230
......
269243
270244
271245
272
246
273247
274
275
276
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
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
407
408
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
277546
278547
279548
280549
281550
282
283
551
552
284553
285554
286555
......
289558
290559
291560
292
561
293562
294563
295564
......
307576
308577
309578
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
579
580
328581
329582
330583
......
338591
339592
340593
341
342
343
594
595
344596
345597
346598
......
357609
358610
359611
360
361
362
612
613
363614
364615
365616
......
375626
376627
377628
378
379
380
629
630
381631
382632
383633
......
397647
398648
399649
400
401
402
650
651
403652
404653
405654
406655
407656
408657
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
658
659
425660
426
427
428
429
661
662
663
430664
431665
432666
......
435669
436670
437671
438
672
439673
440
441
442
443
674
675
676
444677
445678
446679
......
449682
450683
451684
452
685
453686
454
455
456
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
457704
458705
459706
......
486733
487734
488735
489
490
491
736
737
738
492739
493740
494741
......
502749
503750
504751
505
506
507
752
753
754
508755
509756
510757
......
520767
521768
522769
523
524
525
770
771
526772
527773
528774
......
541787
542788
543789
544
545
546
790
547791
548792
549793
......
555799
556800
557801
802
803
558804
559805
560806
......
564810
565811
566812
567
813
568814
569815
816
817
570818
571819
572820
......
576824
577825
578826
827
828
579829
580830
581831
......
585835
586836
587837
838
839
588840
589841
590842
#define __LIBSAIO_SMBIOS_H
/* Based on System Management BIOS Reference Specification v2.5 */
// http://dmtf.org/sites/default/files/standards/documents/DSP0134_2.8.0.pdf
/* Based on System Management BIOS Reference Specification v2.4 */
// http://dmtf.org/standards/smbios
typedef uint8_t SMBString;
typedef uint8_t SMBByte;
#define SMB_ANCHOR_RESET(x)\
bzero(x, sizeof(typedef struct SMBAnchor));
/*
=======================
SMBIOS structure types.
======================= */
/* ======================= SMBIOS structure types. ======================= */
enum
{
kSMBTypeBIOSInformation= 0, // BIOS information (Type 0)
kSMBTypeSystemInformation= 1, // System Information (Type 1)
kSMBTypeBaseBoard= 2, // BaseBoard Information (Type 2)
kSMBTypeBaseBoard = 2, // BaseBoard Information (Type 2)
kSMBTypeSystemEnclosure= 3, // System Chassis Information (Type 3)
kSMBTypeProcessorInformation= 4, // Processor Information (Type 4)
kSMBTypeProcessorInformation= 4, // Processor Information (Type 4)
// Memory Controller Information (Type 5) Obsolete
kSMBTypeMemoryModule= 6, // Memory Module Information (Type 6) Obsolete
kSMBTypeCacheInformation= 7, // Cache Information (Type 7)
// Port Connector Information (Type 8)
kSMBTypeSystemSlot= 9, // System Slots (Type 9)
kSMBTypeSystemSlot = 9, // System Slots (Type 9)
// On Board Devices Information (Type 10) Obsolete
kSMBOEMStrings= 11 ,// OEM Strings (Type 11)
kSMBOEMStrings = 11 ,// OEM Strings (Type 11)
// System Configuration Options (Type 12)
// BIOS Language Information (Type 13)
// Group Associations (Type 14)
// Out-of-Band Remote Access (Type 30)
// Boot Integrity Service (BIS) Entry Point (Type 31)
// System Boot Information (Type 32)
kSMBType64BitMemoryErrorInfo= 33, // 64-Bit Memory Error Information (Type 33)
kSMBType64BitMemoryErrorInfo = 33, // 64-Bit Memory Error Information (Type 33)
// Managment Device (Type 34)
// Managment Device Component (Type 35)
// Management Device Threshold Data (Type 36)
// Management Controlle Host Interface (Type 42)
// Inactive (Type 126)
kSMBTypeEndOfTable= 127, // End-of-Table (Type 127)
kSMBTypeEndOfTable = 127, // End-of-Table (Type 127)
// Apple Specific Structures
kSMBTypeFirmwareVolume= 128, // FirmwareVolume (TYPE 128)
kSMBTypeMemorySPD= 130, // MemorySPD (TYPE 130)
kSMBTypeMemorySPD = 130, // MemorySPD (TYPE 130)
kSMBTypeOemProcessorType= 131, // Processor Type (Type 131)
kSMBTypeOemProcessorBusSpeed= 132 // Processor Bus Speed (Type 132)
//kSMBTypeOemPlatformFeature= 133 // Platform Feature (Type 133)
kSMBTypeOemProcessorBusSpeed = 132, // Processor Bus Speed (Type 132)
kSMBTypeOemPlatformFeature= 133 // Platform Feature (Type 133)
};
/* =======================
BIOS Information (Type 0)
========================= */
//----------------------------------------------------------------------------------------------------------
// Struct - BIOS Information (Type 0)
typedef struct SMBBIOSInformation
{
SMB_STRUCT_HEADER
SMBByte ECreleaseMinor; // Embedded Controller firmware release (minor)
} __attribute__((packed)) SMBBIOSInformation;
/* =========================
System Information (Type 1)
=========================== */
//----------------------------------------------------------------------------------------------------------
// Struct - System Information (Type 1)
typedef struct SMBSystemInformation
{
// 2.0+ spec (8 bytes)
SMBString family;
} __attribute__((packed)) SMBSystemInformation;
/* =========================================
Base Board (or Module) Information (Type 2)
=========================================== */
//----------------------------------------------------------------------------------------------------------
// Base Board (or Module) Information (Type 2)
// Base Board - Board Type.
// Values for SMBBaseBoard.boardType
typedef enum
{
kSMBBaseBoardUnknown = 0x01,// Unknow
kSMBBaseBoardOther = 0x02,// Other
kSMBBaseBoardServerBlade = 0x03,// Server Blade
kSMBBaseBoardConnectivitySwitch = 0x04,// Connectivity Switch
kSMBBaseBoardSystemMgmtModule = 0x05,// System Management Module
kSMBBaseBoardProcessorModule = 0x06,// Processor Module
kSMBBaseBoardIOModule = 0x07,// I/O Module
kSMBBaseBoardMemoryModule = 0x08,// Memory Module
kSMBBaseBoardDaughter = 0x09,// Daughter Board
kSMBBaseBoardMotherboard = 0x0A,// Motherboard (includes processor, memory, and I/O)
kSMBBaseBoardProcessorMemoryModule = 0x0B,// Processor/Memory Module
kSMBBaseBoardProcessorIOModule = 0x0C,// Processor/IO Module
kSMBBaseBoardInterconnect = 0x0D// Interconnect board
} BASE_BOARD_TYPE;
// Struct - Base Board (or Module) Information (Type 2)
typedef struct SMBBaseBoard
{
SMB_STRUCT_HEADER // Type 2
SMBByte featureFlags;// Collection of flag that identify features of this baseboard
SMBStringlocationInChassis;
SMBWord chassisHandle;
SMBByte boardType;// Type of board
SMBByte boardType;// Type of board, numeration value from BASE_BOARD_TYPE.
SMBByte numberOfContainedHandles;
//SMBWord containedObjectHandles[1];
// 0 - 255 contained handles go here but we do not include
// them in our structure. Be careful to use numberOfContainedHandles
// times sizeof(SMBWord) when computing the actual record size,
// if you need it.
SMBByte containedObjectHandles;
} __attribute__((packed)) SMBBaseBoard;
/* ====================================
Values for boardType in Type 2 records
====================================== */
enum
{
kSMBBaseBoardUnknown = 0x01,// Unknow
kSMBBaseBoardOther = 0x02,// Other
kSMBBaseBoardServerBlade = 0x03,// Server Blade
kSMBBaseBoardConnectivitySwitch = 0x04,// Connectivity Switch
kSMBBaseBoardSystemMgmtModule = 0x05,// System Management Module
kSMBBaseBoardProcessorModule = 0x06,// Processor Module
kSMBBaseBoardIOModule = 0x07,// I/O Module
kSMBBaseBoardMemoryModule = 0x08,// Memory Module
kSMBBaseBoardDaughter = 0x09,// Daughter Board
kSMBBaseBoardMotherboard = 0x0A,// Motherboard (includes processor, memory, and I/O)
kSMBBaseBoardProcessorMemoryModule = 0x0B,// Processor/Memory Module
kSMBBaseBoardProcessorIOModule = 0x0C,// Processor/IO Module
kSMBBaseBoardInterconnect = 0x0D// Interconnect board
};
//----------------------------------------------------------------------------------------------------------
// System Enclosure (Type 3)
/* =======================
System Enclosure (Type 3)
========================= */
typedef struct SMBSystemEnclosure
{
SMB_STRUCT_HEADER // Type 3
SMBString manufacturer;
SMBByte chassisType;// System Enclosure Indicator
SMBString version;// Board Number?
SMBString serialNumber;
SMBString assetTag;// Bungo: renamed from assetTagNumber folowing convention
SMBByte bootupState;// State of enclosure when when it was last booted
SMBByte powerSupplyState;// State of enclosure's power supply when last booted
SMBByte thermalState;// Thermal state of the enclosure when last booted
SMBByte securityStatus;// Physical security status of the enclosure when last booted
SMBDWord oemDefined;// OEM- or BIOS vendor-specific information
SMBByte height;// Height of the enclosure, in 'U's
SMBByte numberOfPowerCords;// Number of power cords associated with the enclosure or chassis
SMBByte containedElementCount;// Number of Contained Element record that follow, in the range 0 to 255
//SMBByte containedElementRecord;// Byte leght of each Contained Element record that follow, in the range 0 to 255
//SMBByte containedElements;// Elements, possibly defined by other SMBIOS structures present in chassis
//SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number (2.7+)
} __attribute__((packed)) SMBSystemEnclosure;
// Bungo: values for SMBSystemEnclosure.chassisType
enum {
typedef enum {
kSMBchassisOther = 0x01,
kSMBchassisUnknown = 0x02,
kSMBchassisDesktop = 0x03,
kSMBchassisLunchBox = 0x10,
// ... fill up if needed ;-)
kSMBchassisBladeEnclosing = 0x1D
};
} MISC_CHASSIS_TYPE;
/* ============================
Processor Information (Type 4)
============================== */
// System Enclosure or Chassis States.
// values for SMBSystemEnclosure.bootupState
// values for SMBSystemEnclosure.powerSupplyState
// values for SMBSystemEnclosure.thermalState
typedef enum {
kSMBChassisStateOther = 0x01,
kSMBChassisStateUnknown = 0x02,
kSMBChassisStateSafe = 0x03,
kSMBChassisStateWarning = 0x04,
kSMBChassisStateCritical = 0x05,
kSMBChassisStateNonRecoverable = 0x06
} MISC_CHASSIS_STATE;
// System Enclosure or Chassis Security Status.
// values for SMBSystemEnclosure.securityStatus
typedef enum {
kSMBChassisSecurityStatusOther = 0x01,
kSMBChassisSecurityStatusUnknown = 0x02,
kSMBChassisSecurityStatusNone = 0x03,
kSMBChassisSecurityStatusExternalInterfaceLockedOut = 0x04,
kSMBChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05
} MISC_CHASSIS_SECURITY_STATE;
// Struct - System Enclosure (Type 3)
typedef struct SMBSystemEnclosure
{
SMB_STRUCT_HEADER // Type 3
SMBString manufacturer;
SMBByte chassisType;// System Enclosure Indicator
SMBString version;// Board Number?
SMBString serialNumber;
SMBString assetTag;// Bungo: renamed from assetTagNumber folowing convention
SMBByte bootupState;// State of enclosure when when it was last booted
SMBByte powerSupplyState;// State of enclosure's power supply when last booted
SMBByte thermalState;// Thermal state of the enclosure when last booted
SMBByte securityStatus;// Physical security status of the enclosure when last booted
SMBDWord oemDefined;// OEM- or BIOS vendor-specific information
SMBByte height;// Height of the enclosure, in 'U's
SMBByte numberOfPowerCords;// Number of power cords associated with the enclosure or chassis
SMBByte containedElementCount;// Number of Contained Element record that follow, in the range 0 to 255
//SMBByte containedElementRecord;// Byte leght of each Contained Element record that follow, in the range 0 to 255
//SMBByte containedElements;// Elements, possibly defined by other SMBIOS structures present in chassis
//SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number (2.7+)
} __attribute__((packed)) SMBSystemEnclosure;
//----------------------------------------------------------------------------------------------------------
// Processor Information (Type 4)
#define kSMBProcessorInformationMinSize 26
// Processor Information - Processor Type.
// Values for SMBProcessorInformation.processorType
typedef enum
{
kSMBprocessorTypeOther = 0x01,
kSMBprocessorTypeUnknown = 0x02,
kSMBprocessorTypeCPU = 0x03,
kSMBprocessorTypeMPU = 0x04,
kSMBprocessorTypeDSP = 0x05,
kSMBprocessorTypeGPU = 0x06
} PROCESSOR_TYPE_DATA;
// Processor Information - Processor Family.
// Values for SMBProcessorInformation.processorFamily
typedef enum {
kSMBprocessorFamilyOther = 0x01,
kSMBprocessorFamilyUnknown = 0x02,
kSMBprocessorFamily8086 = 0x03,
kSMBprocessorFamily80286 = 0x04,
kSMBprocessorFamilyIntel386 = 0x05,
kSMBprocessorFamilyIntel486 = 0x06,
kSMBprocessorFamily8087 = 0x07,
kSMBprocessorFamily80287 = 0x08,
kSMBprocessorFamily80387 = 0x09,
kSMBprocessorFamily80487 = 0x0A,
kSMBprocessorFamilyPentium = 0x0B,
kSMBprocessorFamilyPentiumPro = 0x0C,
kSMBprocessorFamilyPentiumII = 0x0D,
kSMBprocessorFamilyPentiumMMX = 0x0E,
kSMBprocessorFamilyCeleron = 0x0F,
kSMBprocessorFamilyPentiumIIXeon = 0x10,
kSMBprocessorFamilyPentiumIII = 0x11,
kSMBprocessorFamilyM1 = 0x12,
kSMBprocessorFamilyM2 = 0x13,
kSMBprocessorFamilyIntelCeleronM = 0x14,
kSMBprocessorFamilyIntelPentium4Ht = 0x15,
kSMBprocessorFamilyM1Reserved4 = 0x16,
kSMBprocessorFamilyM1Reserved5 = 0x17,
kSMBprocessorFamilyAmdDuron = 0x18,
kSMBprocessorFamilyK5 = 0x19,
kSMBprocessorFamilyK6 = 0x1A,
kSMBprocessorFamilyK6_2 = 0x1B,
kSMBprocessorFamilyK6_3 = 0x1C,
kSMBprocessorFamilyAmdAthlon = 0x1D,
kSMBprocessorFamilyAmd29000 = 0x1E,
kSMBprocessorFamilyK6_2Plus = 0x1F,
kSMBprocessorFamilyPowerPC = 0x20,
kSMBprocessorFamilyPowerPC601 = 0x21,
kSMBprocessorFamilyPowerPC603 = 0x22,
kSMBprocessorFamilyPowerPC603Plus = 0x23,
kSMBprocessorFamilyPowerPC604 = 0x24,
kSMBprocessorFamilyPowerPC620 = 0x25,
kSMBprocessorFamilyPowerPCx704 = 0x26,
kSMBprocessorFamilyPowerPC750 = 0x27,
kSMBprocessorFamilyIntelCoreDuo = 0x28,
kSMBprocessorFamilyIntelCoreDuoMobile = 0x29,
kSMBprocessorFamilyIntelCoreSoloMobile = 0x2A,
kSMBprocessorFamilyIntelAtom = 0x2B,
kSMBprocessorFamilyAlpha3 = 0x30,
kSMBprocessorFamilyAlpha21064 = 0x31,
kSMBprocessorFamilyAlpha21066 = 0x32,
kSMBprocessorFamilyAlpha21164 = 0x33,
kSMBprocessorFamilyAlpha21164PC = 0x34,
kSMBprocessorFamilyAlpha21164a = 0x35,
kSMBprocessorFamilyAlpha21264 = 0x36,
kSMBprocessorFamilyAlpha21364 = 0x37,
kSMBprocessorFamilyAmdTurionIIUltraDualCoreMobileM = 0x38,
kSMBprocessorFamilyAmdTurionIIDualCoreMobileM = 0x39,
kSMBprocessorFamilyAmdAthlonIIDualCoreM = 0x3A,
kSMBprocessorFamilyAmdOpteron6100Series = 0x3B,
kSMBprocessorFamilyAmdOpteron4100Series = 0x3C,
kSMBprocessorFamilyAmdOpteron6200Series = 0x3D,
kSMBprocessorFamilyAmdOpteron4200Series = 0x3E,
kSMBprocessorFamilyMips = 0x40,
kSMBprocessorFamilyMIPSR4000 = 0x41,
kSMBprocessorFamilyMIPSR4200 = 0x42,
kSMBprocessorFamilyMIPSR4400 = 0x43,
kSMBprocessorFamilyMIPSR4600 = 0x44,
kSMBprocessorFamilyMIPSR10000 = 0x45,
kSMBprocessorFamilyAmdCSeries = 0x46,
kSMBprocessorFamilyAmdESeries = 0x47,
kSMBprocessorFamilyAmdSSeries = 0x48,
kSMBprocessorFamilyAmdGSeries = 0x49,
kSMBprocessorFamilySparc = 0x50,
kSMBprocessorFamilySuperSparc = 0x51,
kSMBprocessorFamilymicroSparcII = 0x52,
kSMBprocessorFamilymicroSparcIIep = 0x53,
kSMBprocessorFamilyUltraSparc = 0x54,
kSMBprocessorFamilyUltraSparcII = 0x55,
kSMBprocessorFamilyUltraSparcIIi = 0x56,
kSMBprocessorFamilyUltraSparcIII = 0x57,
kSMBprocessorFamilyUltraSparcIIIi = 0x58,
kSMBprocessorFamily68040 = 0x60,
kSMBprocessorFamily68xxx = 0x61,
kSMBprocessorFamily68000 = 0x62,
kSMBprocessorFamily68010 = 0x63,
kSMBprocessorFamily68020 = 0x64,
kSMBprocessorFamily68030 = 0x65,
kSMBprocessorFamilyHobbit = 0x70,
kSMBprocessorFamilyCrusoeTM5000 = 0x78,
kSMBprocessorFamilyCrusoeTM3000 = 0x79,
kSMBprocessorFamilyEfficeonTM8000 = 0x7A,
kSMBprocessorFamilyWeitek = 0x80,
kSMBprocessorFamilyItanium = 0x82,
kSMBprocessorFamilyAmdAthlon64 = 0x83,
kSMBprocessorFamilyAmdOpteron = 0x84,
kSMBprocessorFamilyAmdSempron = 0x85,
kSMBprocessorFamilyAmdTurion64Mobile = 0x86,
kSMBprocessorFamilyDualCoreAmdOpteron = 0x87,
kSMBprocessorFamilyAmdAthlon64X2DualCore = 0x88,
kSMBprocessorFamilyAmdTurion64X2Mobile = 0x89,
kSMBprocessorFamilyQuadCoreAmdOpteron = 0x8A,
kSMBprocessorFamilyThirdGenerationAmdOpteron = 0x8B,
kSMBprocessorFamilyAmdPhenomFxQuadCore = 0x8C,
kSMBprocessorFamilyAmdPhenomX4QuadCore = 0x8D,
kSMBprocessorFamilyAmdPhenomX2DualCore = 0x8E,
kSMBprocessorFamilyAmdAthlonX2DualCore = 0x8F,
kSMBprocessorFamilyPARISC = 0x90,
kSMBprocessorFamilyPaRisc8500 = 0x91,
kSMBprocessorFamilyPaRisc8000 = 0x92,
kSMBprocessorFamilyPaRisc7300LC = 0x93,
kSMBprocessorFamilyPaRisc7200 = 0x94,
kSMBprocessorFamilyPaRisc7100LC = 0x95,
kSMBprocessorFamilyPaRisc7100 = 0x96,
kSMBprocessorFamilyV30 = 0xA0,
kSMBprocessorFamilyQuadCoreIntelXeon3200Series = 0xA1,
kSMBprocessorFamilyDualCoreIntelXeon3000Series = 0xA2,
kSMBprocessorFamilyQuadCoreIntelXeon5300Series = 0xA3,
kSMBprocessorFamilyDualCoreIntelXeon5100Series = 0xA4,
kSMBprocessorFamilyDualCoreIntelXeon5000Series = 0xA5,
kSMBprocessorFamilyDualCoreIntelXeonLV = 0xA6,
kSMBprocessorFamilyDualCoreIntelXeonULV = 0xA7,
kSMBprocessorFamilyDualCoreIntelXeon7100Series = 0xA8,
kSMBprocessorFamilyQuadCoreIntelXeon5400Series = 0xA9,
kSMBprocessorFamilyQuadCoreIntelXeon = 0xAA,
kSMBprocessorFamilyDualCoreIntelXeon5200Series = 0xAB,
kSMBprocessorFamilyDualCoreIntelXeon7200Series = 0xAC,
kSMBprocessorFamilyQuadCoreIntelXeon7300Series = 0xAD,
kSMBprocessorFamilyQuadCoreIntelXeon7400Series = 0xAE,
kSMBprocessorFamilyMultiCoreIntelXeon7400Series = 0xAF,
kSMBprocessorFamilyPentiumIIIXeon = 0xB0,
kSMBprocessorFamilyPentiumIIISpeedStep = 0xB1,
kSMBprocessorFamilyPentium4 = 0xB2,
kSMBprocessorFamilyIntelXeon = 0xB3,
kSMBprocessorFamilyAS400 = 0xB4,
kSMBprocessorFamilyIntelXeonMP = 0xB5,
kSMBprocessorFamilyAMDAthlonXP = 0xB6,
kSMBprocessorFamilyAMDAthlonMP = 0xB7,
kSMBprocessorFamilyIntelItanium2 = 0xB8,
kSMBprocessorFamilyIntelPentiumM = 0xB9,
kSMBprocessorFamilyIntelCeleronD = 0xBA,
kSMBprocessorFamilyIntelPentiumD = 0xBB,
kSMBprocessorFamilyIntelPentiumEx = 0xBC,
kSMBprocessorFamilyIntelCoreSolo = 0xBD, ///< SMBIOS spec 2.6 correct this value
kSMBprocessorFamilyReserved = 0xBE,
kSMBprocessorFamilyIntelCore2 = 0xBF,
kSMBprocessorFamilyIntelCore2Solo = 0xC0,
kSMBprocessorFamilyIntelCore2Extreme = 0xC1,
kSMBprocessorFamilyIntelCore2Quad = 0xC2,
kSMBprocessorFamilyIntelCore2ExtremeMobile = 0xC3,
kSMBprocessorFamilyIntelCore2DuoMobile = 0xC4,
kSMBprocessorFamilyIntelCore2SoloMobile = 0xC5,
kSMBprocessorFamilyIntelCoreI7 = 0xC6,
kSMBprocessorFamilyDualCoreIntelCeleron = 0xC7,
kSMBprocessorFamilyIBM390 = 0xC8,
kSMBprocessorFamilyG4 = 0xC9,
kSMBprocessorFamilyG5 = 0xCA,
kSMBprocessorFamilyG6 = 0xCB,
kSMBprocessorFamilyzArchitectur = 0xCC,
kSMBprocessorFamilyIntelCoreI5 = 0xCD,
kSMBprocessorFamilyIntelCoreI3 = 0xCE,
kSMBprocessorFamilyViaC7M = 0xD2,
kSMBprocessorFamilyViaC7D = 0xD3,
kSMBprocessorFamilyViaC7 = 0xD4,
kSMBprocessorFamilyViaEden = 0xD5,
kSMBprocessorFamilyMultiCoreIntelXeon = 0xD6,
kSMBprocessorFamilyDualCoreIntelXeon3Series = 0xD7,
kSMBprocessorFamilyQuadCoreIntelXeon3Series = 0xD8,
kSMBprocessorFamilyViaNano = 0xD9,
kSMBprocessorFamilyDualCoreIntelXeon5Series = 0xDA,
kSMBprocessorFamilyQuadCoreIntelXeon5Series = 0xDB,
kSMBprocessorFamilyDualCoreIntelXeon7Series = 0xDD,
kSMBprocessorFamilyQuadCoreIntelXeon7Series = 0xDE,
kSMBprocessorFamilyMultiCoreIntelXeon7Series = 0xDF,
kSMBprocessorFamilyMultiCoreIntelXeon3400Series = 0xE0,
kSMBprocessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,
kSMBprocessorFamilyAmdPhenomTripleCore = 0xE7,
kSMBprocessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,
kSMBprocessorFamilyAmdTurionDualCoreMobile = 0xE9,
kSMBprocessorFamilyAmdAthlonDualCore = 0xEA,
kSMBprocessorFamilyAmdSempronSI = 0xEB,
kSMBprocessorFamilyAmdPhenomII = 0xEC,
kSMBprocessorFamilyAmdAthlonII = 0xED,
kSMBprocessorFamilySixCoreAmdOpteron = 0xEE,
kSMBprocessorFamilyAmdSempronM = 0xEF,
kSMBprocessorFamilyi860 = 0xFA,
kSMBprocessorFamilyi960 = 0xFB,
kSMBprocessorFamilyIndicatorFamily2 = 0xFE,
kSMBprocessorFamilyReserved1 = 0xFF
} PROCESSOR_FAMILY_DATA;
// Processor Information - Processor Upgrade.
// Values for SMBProcessorInformation.processorUpgrade
typedef enum {
kSMBprocessorUpgradeOther = 0x01,
kSMBprocessorUpgradeUnknown = 0x02,
kSMBprocessorUpgradeDaughterBoard = 0x03,
kSMBprocessorUpgradeZIFSocket = 0x04,
kSMBprocessorUpgradePiggyBack = 0x05, ///< Replaceable.
kSMBprocessorUpgradeNone = 0x06,
kSMBprocessorUpgradeLIFSocket = 0x07,
kSMBprocessorUpgradeSlot1 = 0x08,
kSMBprocessorUpgradeSlot2 = 0x09,
kSMBprocessorUpgrade370PinSocket = 0x0A,
kSMBprocessorUpgradeSlotA = 0x0B,
kSMBprocessorUpgradeSlotM = 0x0C,
kSMBprocessorUpgradeSocket423 = 0x0D,
kSMBprocessorUpgradeSocketA = 0x0E, ///< Socket 462.
kSMBprocessorUpgradeSocket478 = 0x0F,
kSMBprocessorUpgradeSocket754 = 0x10,
kSMBprocessorUpgradeSocket940 = 0x11,
kSMBprocessorUpgradeSocket939 = 0x12,
kSMBprocessorUpgradeSocketmPGA604 = 0x13,
kSMBprocessorUpgradeSocketLGA771 = 0x14,
kSMBprocessorUpgradeSocketLGA775 = 0x15,
kSMBprocessorUpgradeSocketS1 = 0x16,
kSMBprocessorUpgradeAM2 = 0x17,
kSMBprocessorUpgradeF1207 = 0x18,
kSMBprocessorUpgradeSocketLGA1366 = 0x19,
kSMBprocessorUpgradeSocketG34 = 0x1A,
kSMBprocessorUpgradeSocketAM3 = 0x1B,
kSMBprocessorUpgradeSocketC32 = 0x1C,
kSMBprocessorUpgradeSocketLGA1156 = 0x1D,
kSMBprocessorUpgradeSocketLGA1567 = 0x1E,
kSMBprocessorUpgradeSocketPGA988A = 0x1F,
kSMBprocessorUpgradeSocketBGA1288 = 0x20,
kSMBprocessorUpgradeSocketrPGA988B = 0x21,
kSMBprocessorUpgradeSocketBGA1023 = 0x22,
kSMBprocessorUpgradeSocketBGA1224 = 0x23,
kSMBprocessorUpgradeSocketBGA1155 = 0x24,
kSMBprocessorUpgradeSocketLGA1356 = 0x25,
kSMBprocessorUpgradeSocketLGA2011 = 0x26,
kSMBprocessorUpgradeSocketFS1 = 0x27,
kSMBprocessorUpgradeSocketFS2 = 0x28,
kSMBprocessorUpgradeSocketFM1 = 0x29,
kSMBprocessorUpgradeSocketFM2 = 0x2A
} PROCESSOR_UPGRADE;
// Struct - Processor Information (Type 4).
typedef struct SMBProcessorInformation
{
// 2.0+ spec (26 bytes)
SMB_STRUCT_HEADER // Type 4
SMBString socketDesignation;
SMBByte processorType; // CPU = 3
SMBByte processorFamily; // processor family enum
SMBByte processorType; // The enumeration value from PROCESSOR_TYPE_DATA.
SMBByte processorFamily; // The enumeration value from PROCESSOR_FAMILY_DATA.
SMBString manufacturer;
SMBQWord processorID; // based on CPUID
SMBString processorVersion;
SMBWord maximumClock; // max internal clock in MHz
SMBWord currentClock; // current internal clock in MHz
SMBByte status;
SMBByte processorUpgrade; // processor upgrade enum
SMBByte processorUpgrade; // The enumeration value from PROCESSOR_UPGRADE.
// 2.1+ spec (32 bytes)
SMBWord L1CacheHandle;
SMBWord L2CacheHandle;
//SMBWord processorFamily2;
} __attribute__((packed)) SMBProcessorInformation;
#define kSMBProcessorInformationMinSize 26
/* ========================================
Values for processorType in Type 4 records
======================================== */
enum
{
kSMBprocessorTypeOther = 0x01,
kSMBprocessorTypeUnknown = 0x02,
kSMBprocessorTypeCPU = 0x03,
kSMBprocessorTypeMPU = 0x04,
kSMBprocessorTypeDSP = 0x05,
kSMBprocessorTypeGPU = 0x06
};
/* ======================================================================
Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1
======================================================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1
typedef struct SMBMemoryControllerInfo {
SMB_STRUCT_HEADER
SMBByteerrorDetectingMethod;
SMBBytenumberOfMemorySlots;
} __attribute__((packed)) SMBMemoryControllerInfo;
/* ==================================================================
Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1
==================================================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1
typedef struct SMBMemoryModule
{
SMB_STRUCT_HEADER // Type 6
#define kSMBMemoryModuleSizeNotEnabled 0x7E
#define kSMBMemoryModuleSizeNotInstalled 0x7F
/* ========================
Cache Information (Type 7)
========================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Cache Information (Type 7)
typedef struct SMBCacheInformation
{
SMB_STRUCT_HEADER // Type 7
SMBByte associativity;
} __attribute__((packed)) SMBCacheInformation;
/* ===================
System Slots (Type 9)
===================== */
//----------------------------------------------------------------------------------------------------------
// Struct - System Slots (Type 9)
typedef struct SMBSystemSlot
{
// 2.0+ spec (12 bytes)
//SMBBytedeviceFunctionNumber;
} __attribute__((packed)) SMBSystemSlot;
/* ===================
OEM Strings (Type 11)
===================== */
//----------------------------------------------------------------------------------------------------------
// Struct - OEM Strings (Type 11)
typedef struct SMBOEMStrings
{
SMB_STRUCT_HEADER // Type 11
SMBBytecount;// number of strings
} __attribute__((packed)) SMBOEMStrings;
/* =============================
Physical Memory Array (Type 16)
=============================== */
typedef struct SMBPhysicalMemoryArray
{
// 2.1+ spec (15 bytes)
SMB_STRUCT_HEADER // Type 16
SMBByte physicalLocation; // physical location
SMBByte arrayUse; // the use for the memory array
SMBByte errorCorrection; // error correction/detection method
SMBDWord maximumCapacity; // maximum memory capacity in kilobytes
SMBWord errorHandle; // handle of a previously detected error
SMBWord numMemoryDevices; // number of memory slots or sockets
// 2.7+ spec
//SMBQWord extMaximumCapacity;// maximum memory capacity in bytes
} __attribute__((packed)) SMBPhysicalMemoryArray;
//----------------------------------------------------------------------------------------------------------
// Physical Memory Array (Type 16)
/* ================
Memory Array - Use
================== */
enum
// Physical Memory Array - Use.
// Values for SMBPhysicalMemoryArray.arrayUse
typedef enum
{
kSMBMemoryArrayUseOther = 0x01,
kSMBMemoryArrayUseUnknown = 0x02,
kSMBMemoryArrayUseFlashMemory = 0x05,
kSMBMemoryArrayUseNonVolatileMemory = 0x06,
kSMBMemoryArrayUseCacheMemory = 0x07
};
} MEMORY_ARRAY_USE;
/* ===================================
Memory Array - Error Correction Types
===================================== */
enum
// Physical Memory Array - Error Correction Types.
// Values for SMBPhysicalMemoryArray.errorCorrection
typedef enum
{
kSMBMemoryArrayErrorCorrectionTypeOther = 0x01,
kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02,
kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05,
kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06,
kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07
};
} MEMORY_ERROR_CORRECTION;
/* =====================
Memory Device (Type 17)
======================= */
// Struct - Physical Memory Array (Type 16)
typedef struct SMBPhysicalMemoryArray
{
// 2.1+ spec (15 bytes)
SMB_STRUCT_HEADER // Type 16
SMBByte physicalLocation; // physical location
SMBByte arrayUse; // the use for the memory array, The enumeration value from MEMORY_ARRAY_USE.
SMBByte errorCorrection; // error correction/detection method, The enumeration value from MEMORY_ERROR_CORRECTION.
SMBDWord maximumCapacity; // maximum memory capacity in kilobytes
SMBWord errorHandle; // handle of a previously detected error
SMBWord numMemoryDevices; // number of memory slots or sockets
// 2.7+ spec
//SMBQWord extMaximumCapacity;// maximum memory capacity in bytes
} __attribute__((packed)) SMBPhysicalMemoryArray;
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Device (Type 17)
typedef struct SMBMemoryDevice
{
// 2.1+ spec (21 bytes)
//SMBWord configuredVolt;
} __attribute__((packed)) SMBMemoryDevice;
/* ===================================
Memory Array Mapped Address (Type 19)
===================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Array Mapped Address (Type 19)
//typedef struct SMBMemoryArrayMappedAddress
//{
// 2.1+ spec
//SMBQWord extEndAddress;
//} __attribute__((packed)) SMBMemoryArrayMappedAddress;
/* ====================================
Memory Device Mapped Address (Type 20)
====================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Device Mapped Address (Type 20)
//typedef struct SMBMemoryDeviceMappedAddress
//{
// 2.1+ spec
//SMBQWord extEndAddress;
//} __attribute__((packed)) SMBMemoryDeviceMappedAddress;
/* =====================================================
Firmware Volume Description (Apple Specific - Type 128)
======================================================= */
//----------------------------------------------------------------------------------------------------------
// Firmware Volume Description (Apple Specific - Type 128)
enum
{
FW_REGION_RESERVED = 0,
SMBDWord EndAddress;
} __attribute__((packed)) FW_REGION_INFO;
/* ========
(Type 128)
========== */
// Struct - Firmware Volume Description (Apple Specific - Type 128)
typedef struct SMBFirmwareVolume
{
SMB_STRUCT_HEADER// Type 128
FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ];
} __attribute__((packed)) SMBFirmwareVolume;
//----------------------------------------------------------------------------------------------------------
/* ===========================================
Memory SPD Data (Apple Specific - Type 130)
============================================= */
SMBWord Type17Handle;
SMBWord Offset;
SMBWord Size;
SMBWord Data[];
SMBWord Data[1];
} __attribute__((packed)) SMBMemorySPD;
//----------------------------------------------------------------------------------------------------------
/* ============================================
OEM Processor Type (Apple Specific - Type 131)
============================================== */
SMBWord ProcessorType;
} __attribute__((packed)) SMBOemProcessorType;
//----------------------------------------------------------------------------------------------------------
/* =================================================
OEM Processor Bus Speed (Apple Specific - Type 132)
=================================================== */
SMBWord ProcessorBusSpeed; // MT/s unit
} __attribute__((packed)) SMBOemProcessorBusSpeed;
//----------------------------------------------------------------------------------------------------------
/* ==============================================
OEM Platform Feature (Apple Specific - Type 133)
================================================ */
branches/Chimera/i386/libsaio/stringTable.c
3636
3737
3838
39
40
3941
4042
4143
......
7072
7173
7274
73
74
7575
7676
7777
bool sysConfigValid;
#if UNUSED
/*
* Compare a string to a key with quoted characters
*/
return 0;
}
#if UNUSED
static void eatThru(char val, const char **table_p)
{
register const char *table = *table_p;
branches/Chimera/i386/libsaio/pci.h
6363
6464
6565
66
66
6767
6868
6969
/* Have pci_addr in the same format as the values written to 0xcf8
* so register accesses can be made easy. */
#define PCIADDR(bus, dev, func) ((1 << 31) | (bus << 16) | (dev << 11) | (func << 8))
#define PCIADDR(bus, dev, func) ((1L << 31) | (bus << 16) | (dev << 11) | (func << 8))
#define PCI_ADDR_REG0xcf8
#define PCI_DATA_REG0xcfc
branches/Chimera/i386/libsaio/saio_types.h
4141
4242
4343
44
44
45
4546
4647
4748
4849
4950
50
51
52
5153
5254
5355
......
7779
7880
7981
80
81
82
83
84
85
8286
8387
8488
......
100104
101105
102106
103
107
108
104109
105110
106111
......
120125
121126
122127
123
128
129
124130
125131
126132
......
129135
130136
131137
132
138
139
133140
134141
135142
......
205212
206213
207214
208
215
216
209217
210218
211219
......
216224
217225
218226
219
227
228
220229
221230
222231
......
225234
226235
227236
228
237
238
229239
230240
231241
......
248258
249259
250260
251
261
262
252263
253264
254265
......
277288
278289
279290
280
291
292
281293
282294
283295
typedef unsigned long entry_t;
typedef struct {
typedef struct
{
unsigned int sectors:8;
unsigned int heads:8;
unsigned int cylinders:16;
} compact_diskinfo_t;
struct driveParameters {
struct driveParameters
{
int cylinders;
int sectors;
int heads;
/*
* BIOS drive information.
*/
struct boot_drive_info {
struct drive_params {
struct boot_drive_info
{
struct drive_params
{
unsigned short buf_size;
unsigned short info_flags;
unsigned long phys_cyls;
unsigned char checksum;
} params;
struct drive_dpte {
struct drive_dpte
{
unsigned short io_port_base;
unsigned short control_port_base;
unsigned char head_flags;
} __attribute__((packed));
typedef struct boot_drive_info boot_drive_info_t;
struct driveInfo {
struct driveInfo
{
boot_drive_info_t di;
int uses_ebios;
int valid;
};
typedef struct FinderInfo {
typedef struct FinderInfo
{
unsigned char data[16];
} FinderInfo;
};
enum {
enum
{
kBVFlagPrimary= 0x01,
kBVFlagNativeBoot= 0x02,
kBVFlagForeignBoot= 0x04,
kBVFlagInstallVolume= 0x80
};
enum {
enum
{
kBIOSDevTypeFloppy= 0x00,
kBIOSDevTypeHardDrive= 0x80,
kBIOSDevTypeNetwork= 0xE0,
kBIOSDevMask= 0xFF
};
enum {
enum
{
//KPartitionTypeFAT12= 0x01, // FAT12
kPartitionTypeHPFS= 0x07, // Mac OS X
kPartitionTypeFAT16= 0x06, // FAT16
// KernBootStruct device types.
enum {
enum
{
DEV_SD = 0,
DEV_HD = 1,
DEV_FD = 2,
kBlockDeviceType = kBIOSDevTypeHardDrive
}; //gBootFileType_t;
enum {
enum
{
kCursorTypeHidden = 0x0100,
kCursorTypeUnderline = 0x0607
};
branches/Chimera/i386/libsaio/md5c.c
5050
5151
5252
53
54
5553
5654
5755
......
151149
152150
153151
154
152
153
155154
156155
157156
......
161160
162161
163162
164
163
164
165165
166166
167167
* These notices must be retained in any copies of any part of this
* documentation and/or software.
*
* $Id: md5c.c,v 1.1 2005/06/24 22:47:12 curtisg Exp $
*
* This code is the same as the code published by RSA Inc. It has been
* edited for clarity and style only.
*/
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((context->count[0] += ((u_int32_t)inputLen << 3)) < ((u_int32_t)inputLen << 3)) {
if ((context->count[0] += ((u_int32_t)inputLen << 3)) < ((u_int32_t)inputLen << 3))
{
context->count[1]++;
}
/* Transform as many times as possible. */
if (inputLen >= partLen) {
if (inputLen >= partLen)
{
memcpy((void *)&context->buffer[index], (const void *)input,
partLen);
MD5Transform (context->state, context->buffer);
branches/Chimera/i386/libsaio/fake_efi.c
9393
9494
9595
96
97
9698
9799
98100
......
146148
147149
148150
151
152
149153
150154
151155
......
572576
573577
574578
575
579
576580
577
581
578582
579583
580584
EFI_SYSTEM_TABLE_64 *gST64 = NULL;
Node *gEfiConfigurationTableNode = NULL;
// ==========================================================================
extern EFI_STATUS addConfigurationTable(EFI_GUID const *pGuid, void *table, char const *alias)
{
EFI_UINTN i = 0;
return EFI_UNSUPPORTED;
}
// ==========================================================================
//Azi: crc32 done in place, on the cases were it wasn't.
/*static inline void fixupEfiSystemTableCRC32(EFI_SYSTEM_TABLE_64 *efiSystemTable)
{
node = DT__AddChild(node, "efi");
/* Bungo
if (archCpuType == CPU_TYPE_I386) {
DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_32_PROP_VALUE), (char*)FIRMWARE_ABI_32_PROP_VALUE);
DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_32_PROP_VALUE), (char*)FIRMWARE_ABI_32_PROP_VALUE);
} else { */
DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_64_PROP_VALUE), (char *)FIRMWARE_ABI_64_PROP_VALUE);
DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_64_PROP_VALUE), (char *)FIRMWARE_ABI_64_PROP_VALUE);
//}
DT__AddProperty(node, EFI_MODE_PROP, sizeof(EFI_UINT8), (EFI_UINT8 *)&bootArgs->efiMode);
branches/Chimera/i386/libsaio/smbios_getters.c
2727
2828
2929
30
3130
31
3232
3333
3434
......
3636
3737
3838
39
40
41
3942
4043
4144
......
163166
164167
165168
166
169
167170
168171
169172
......
238241
239242
240243
244
245
246
241247
242248
243249
......
312318
313319
314320
321
322
323
324
315325
316326
317327
......
322332
323333
324334
325
335
336
326337
327338
328339
......
338349
339350
340351
352
353
354
355
341356
342357
343358
......
348363
349364
350365
351
366
367
352368
353369
354370
......
358374
359375
360376
377
378
379
380
361381
362382
363383
......
368388
369389
370390
371
372
373
374391
375392
376393
......
380397
381398
382399
400
401
402
403
383404
384405
385
406
386407
387408
388409
......
393414
394415
395416
396
397
398
399417
400418
401419
......
405423
406424
407425
426
427
428
429
408430
409431
410432
......
415437
416438
417439
418
419
420
421440
422441
423442
{
switch (Platform.CPU.Model)
{
// removes FSB info from system profiler as on real mac's.
// sets external clock to 0
// removes FSB info from system profiler as on real mac's.
case CPU_MODEL_SANDYBRIDGE:
case CPU_MODEL_IVYBRIDGE_XEON:
case CPU_MODEL_IVYBRIDGE:
case CPU_MODEL_HASWELL_SVR:
case CPU_MODEL_HASWELL_ULT:
case CPU_MODEL_CRYSTALWELL:
case CPU_MODEL_BROADWELL:
case CPU_MODEL_BRODWELL_SVR:
case CPU_MODEL_BRODWELL_MSVR:
value->word = 0;
break;
if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) { // Intel
if (!done) {
/*verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, (uint32_t)Platform.CPU.Family, (uint32_t)Platform.CPU.Model); */
verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, (uint32_t)Platform.CPU.Family, (uint32_t)Platform.CPU.Model);
done = true;
}
// Bungo: fixes Oem Processor Type - better matching IMHO
case CPU_MODEL_SANDYBRIDGE:// 0x2A - Intel Core i3, i5, i7 LGA1155 (32nm)
case CPU_MODEL_IVYBRIDGE:// 0x3A - Intel Core i3, i5, i7 LGA1155 (22nm)
case CPU_MODEL_BROADWELL: // 0x3C - Intel Core i3, i5, i7 (14nm)
case CPU_MODEL_BRODWELL_SVR: // 0x4F
case CPU_MODEL_BRODWELL_MSVR: // 0x56
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x501;// 1281 - Xeon
return true;
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
return false;
value->byte = 2; // means Unknown
return true;
//value->byte = SMB_MEM_TYPE_DDR2;
//return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
return false;
value->dword = 0; // means Unknown
return true;
//value->dword = 800;
//return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
if (!bootInfo->memDetect) {
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
DBG("getSMBMemoryDeviceSerialNumber index: %d, MAX_RAM_SLOTS: %d\n",idx,MAX_RAM_SLOTS);
//DBG("getSMBMemoryDeviceSerialNumber index: %d, MAX_RAM_SLOTS: %d\n",idx,MAX_RAM_SLOTS);
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
if (!bootInfo->memDetect) {
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
if (!bootInfo->memDetect) {
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
branches/Chimera/i386/libsaio/saio_internal.h
8181
8282
8383
84
85
84
8685
8786
8887
/* cache.c */
extern void CacheReset();
extern void CacheInit(CICell ih, long blockSize);
extern long CacheRead(CICell ih, char *buffer, long long offset,
long length, long cache);
extern long CacheRead(CICell ih, char *buffer, long long offset, long length, long cache);
/* console.c */
extern bool gVerboseMode;
branches/Chimera/i386/boot0/boot0.s
9292
9393
9494
95
96
95
96
9797
9898
9999
......
283283
284284
285285
286
286
287287
288288
289289
......
322322
323323
324324
325
325
326326
327327
328328
......
473473
474474
475475
476
476477
477478
478479
......
519520
520521
521522
522
523
523524
524525
525526
......
535536
536537
537538
539
538540
541
539542
540543
541544
......
737740
738741
739742
740
743
741744
742745
743746
; in LBA 0 (that is, the first block) precedes the
; GUID Partition Table Header to maintain compatibility
; with existing tools that do not understand GPT partition structures.
; The Protective MBR has the same format as a legacy MBR
; and contains one partition entry with an OSType set to 0xEE
; The Protective MBR has the same format as a legacy MBR
; and contains one partition entry with an OSType set to 0xEE
; reserving the entire space used on the disk by the GPT partitions,
; including all headers.
; to boot an inactive but boot1h aware HFS+ partition
; by scanning the MBR partition entries again.
.start_scan:
.start_scan:
mov cx, kPartCount ; number of partition entries per table
.loop:
; signature check.
jmp .tryToBoot
.Pass2:
.Pass2:
cmp BYTE [si + part.type], kPartTypeHFS; In pass 2 we're going to find a HFS+ partition
; equipped with boot1h in its boot record
; regardless if it's active or not.
jmp SHORT initBootLoader
.gpt_continue:
add si, bx; advance SI to next partition entry
loop .gpt_loop; loop through all partition entries
je.checkBootSignature
cmpax, kHFSPCaseSignature; 'HX'
je.checkBootSignature
;
; Looking for boot1f32 magic string.
;
cmp WORD [di + kSectorBytes - 2], kBootSignature
.exit:
popa
ret
popad
ret
print_nibble:
and al, 0x0f
add al, '0'
branches/Chimera/i386/boot0/boot0hfs.s
283283
284284
285285
286
286
287287
288288
289289
......
444444
445445
446446
447
447
448448
449449
450450
......
519519
520520
521521
522
522
523523
524524
525525
; to boot an inactive but boot1h aware HFS+ partition
; by scanning the MBR partition entries again.
.start_scan:
.start_scan:
mov cx, kPartCount ; number of partition entries per table
.loop:
.gpt_loop:
mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs]
cmpeax, kAppleGUID; check current GUID Partition for Apple's GUID type
je.gpt_ok
je.checkBootSignature
cmpax, kHFSPCaseSignature; 'HX'
je.checkBootSignature
;
; Looking for boot1f32 magic string.
;
branches/Chimera/i386/boot0/boot0md.s
306306
307307
308308
309
310
309
311310
312311
313312
......
325324
326325
327326
328
327
329328
330329
331330
332331
333332
334333
335
334
336335
337
336
338337
339338
340339
341
340
342341
343342
344343
345344
346
347345
346
348347
349348
350349
351350
352351
353
352
354353
355
354
356355
357356
358357
......
386385
387386
388387
389
388
389
390390
391391
392392
......
418418
419419
420420
421
421
422422
423423
424424
......
499499
500500
501501
502
502
503503
504504
505505
......
546546
547547
548548
549
549
550550
551551
552552
......
623623
624624
625625
626
626
627627
628628
629629
DebugChar('P'); starting new pass
pushdx; save dl (boot drive) for next pass
.scan_drive:
;
jc .next_pass; MBR load error - normally because we scanned all drives
DebugChar('D'); starting disk scanning
;
; Look for the booter partition in the MBR partition table,
; which is at offset kMBRPartTable.
;
mov si, kMBRPartTable; pointer to partition table
call find_boot; will not return on success
; if returns - booter partition is not found
; skip scanning of all drives in Pass1
cmpbh, kPass1
je.next_pass
; try next drive
; if next drive does not exists - will break on the MBR load error above
incdl
jmpshort .scan_drive
.next_pass:
; all drives scanned - move to next pass
popdx; restore orig boot drive
decbh; decrement scan pass counter
jnzpass_loop; if not zero - exec next pass
; we ran all passes - nothing found - error
error:
DebugChar('E')
DebugPause
xor bl, bl; BL will be set to 1 later in case of
; Protective MBR has been found
.start_scan:
.start_scan:
mov cx, kPartCount ; number of partition entries per table
.loop:
;
; Code may be harder to read because I tried to optimized it for minimum size.
;
.testPass:
DebugChar('t'); testing partition
xordh, dh ; DH=0 This will be used in Pass3 (partition is active, not HFS+).
DebugChar('G'); found GPT
mov si, di
;
; Loading GUID Partition Table Array
;
.gpt_loop:
mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs]
cmpeax, kAppleGUID; check current GUID Partition for Apple's GUID type
je.gpt_ok
je.checkBootSignature
cmpax, kHFSPCaseSignature; 'HX'
je.checkBootSignature
;
; Looking for boot1f32 magic string.
;
branches/Chimera/i386/boot0/Makefile
1717
1818
1919
20
21
22
2023
21
24
2225
2326
2427
25
28
2629
all: $(DIRS_NEEDED) $(OBJS)
#To rebuild boot0 if boot0.s is touched
$(SYMROOT)/boot0: boot0.s
$(OBJS): $(SRCROOT)/autoconf.inc
@echo "\t[NASM] $(@F)"
@echo "[NASM] $(@F)"
@$(NASM) $(@F).s -o $@
clean-local:
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "[RM] $${o}"; fi; done
@rm -f $(OBJS)
branches/Chimera/i386/include/sys/socket.h
514514
515515
516516
517
517518
518519
519520
......
523524
524525
525526
527
526528
527529
528530
* peer from lying about its identity. (Note that cmcred_groups[0]
* is the effective GID.)
*/
#if 0
struct cmsgcred {
pid_tcmcred_pid;/* PID of sending process */
uid_tcmcred_uid;/* real UID of sending process */
gid_tcmcred_groups[CMGROUP_MAX];/* groups */
};
#endif
#endif
#endif/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/* given pointer to struct cmsghdr, return pointer to data */
branches/Chimera/i386/boot1/Makefile
3232
3333
3434
35
36
37
3538
36
39
3740
3841
3942
......
4144
4245
4346
44
47
4548
all: $(DIRS_NEEDED) $(PROGRAMS)
#To rebuild boot1h if boot1h.s is touched
$(SYMROOT)/boot1h: boot1h.s
$(PROGRAMS): $(SRCROOT)/autoconf.inc
@echo "\t[NASM] $(@F)"
@echo "[NASM] $(@F)"
@$(NASM) $(@F).s -o $@
install_i386:: all $(INSTALLDIR)
cd $(INSTALLDIR); chmod u+w $(VERSIONED_FILES)
clean-local:
@for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done
@for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "[RM] $${p}"; fi; done
@rm -f $(PROGRAMS)
branches/Chimera/i386/boot1/boot1h.s
11
22
33
4
4
55
66
77
......
99
1010
1111
12
12
1313
1414
1515
......
1717
1818
1919
20
20
2121
2222
2323
......
7474
7575
7676
77
77
7878
7979
8080
......
335335
336336
337337
338
338
339339
340340
341341
......
352352
353353
354354
355
355
356356
357357
358358
......
388388
389389
390390
391
391
392392
393393
394394
......
406406
407407
408408
409
409
410410
411411
412412
......
500500
501501
502502
503
503
504504
505505
506506
......
10581058
10591059
10601060
1061
1061
10621062
10631063
10641064
1065
1065
10661066
10671067
10681068
......
10881088
10891089
10901090
1091
1091
10921092
10931093
10941094
......
10991099
11001100
11011101
1102
1102
11031103
11041104
11051105
......
11151115
11161116
11171117
1118
1118
11191119
11201120
11211121
......
11831183
11841184
11851185
1186
1186
11871187
11881188
11891189
......
11991199
12001200
12011201
1202
1202
12031203
12041204
12051205
12061206
12071207
12081208
1209
1210
1209
1210
12111211
12121212
12131213
......
12301230
12311231
12321232
1233
1233
12341234
12351235
12361236
......
13001300
13011301
13021302
1303
1303
13041304
13051305
13061306
......
13281328
13291329
13301330
1331
1331
13321332
13331333
13341334
13351335
13361336
1337
1337
13381338
13391339
13401340
13411341
13421342
13431343
1344
1344
13451345
13461346
13471347
; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
;
; @APPLE_LICENSE_HEADER_START@
;
;
; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
; Reserved. This file contains Original Code and/or Modifications of
; Original Code as defined in and that are subject to the Apple Public
; except in compliance with the License. Please obtain a copy of the
; License at http://www.apple.com/publicsource and read it before using
; this file.
;
;
; The Original Code and all software distributed under the License are
; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
; License for the specific language governing rights and limitations
; under the License.
;
;
; @APPLE_LICENSE_HEADER_END@
;
; Partition Boot Loader: boot1h
kBoot1Sector1AddrEQUkBoot1RelocAddr + kSectorBytes; boot1 load address for sector 1
kHFSPlusBufferEQUkBoot1Sector1Addr + kSectorBytes; HFS+ Volume Header address
kBoot2SectorsEQU(480 * 1024 - 512) / kSectorBytes; max size of 'boot' file in sectors
kBoot2SectorsEQU(480 * 1024 - 512) / kSectorBytes; max size of 'boot' file in sectors = 448 but I want 472
kBoot2SegmentEQU0x2000; boot2 load segment
kBoot2AddressEQUkSectorBytes; boot2 load address
movsi, %1
callprint_string
%endmacro
%macro LogString 1
movdi, %1
calllog_string
%define PutChar(x)
%define PrintHex(x)
%endif
;--------------------------------------------------------------------------
; Start of text segment.
movcx, kSectorBytes; copy 256 words
repmovsb; repeat string move (word) operation
popsi
;
; Code relocated, jump to startReloc in relocated location.
;
; Initializing global variables.
;
mov eax, [si + part.lba]
mov [gPartLBA], eax; save the current partition LBA offset
mov [gPartLBA], eax; save the current partition LBA offset
mov [gBIOSDriveNumber], dl; save BIOS drive number
movWORD [gMallocPtr], mallocStart; set free space pointer
%if VERBOSE
LogString(error_str)
%endif
hang:
hlt
jmp hang
movbx, [bp + BTree.nodeBuffer + BTNodeDescriptor.numRecords]
xchgbh, bl
decbx
.bsearch:
cmpax, bx
ja.checkResult; jump if lowerBound > upperBound
movcx, ax
addcx, bx
shrcx, 1; test index = (lowerBound + upperBound / 2)
je.checkResult
jl.searchLessThanTrial
jg.searchGreaterThanTrial
jmp.bsearch
jmp.bsearch
.searchLessThanTrial:
movbx, cx
movax, cx
incax; lowerBound = index + 1
jmp.bsearch
.checkResult:
cmpBYTE [bp + BTree.searchResult], 0
jge.foundKey
movbx, [bx]
movedx, [bx]
jmp.readNode
.exit:
cmpBYTE [bp + BTree.searchResult], 0
ret
.exit:
popdi; restore address of trialKey
%if UNUSED
%if UNUSED
;
; Print catalog trial key
;
.printLoop:
lodsw
callprint_char
loop.printLoop
loop.printLoop
.printExit:
popad
;
;
;
%endif ; UNUSED
%if UNUSED
%if UNUSED
;
; Print extent trial key
;
popsi; restore SI
callbx; call key compare proc
popad
ret
ret
;--------------------------------------------------------------------------
; readExtent - read extents from a HFS+ file (multiple extent support)
popebx
jmp.beginExtentBlock
.continue:
movedx, [di + HFSPlusExtentDescriptor.blockCount]
callblockToSector; ECX = converted current extent's blockCount to sectors
movedx, [di + HFSPlusExtentDescriptor.startBlock]
callblockToSector; ECX = converted to sectors
addecx, eax; file offset converted to sectors
pushsi
movax, si
movedx, [bp + BTree.readBufferPtr]
callreadSectors
popsi
addebx, esi
movax, si
cwde
shlax, 9; convert SI (read sector count) to byte unit
add[bp + BTree.readBufferPtr], eax
sub[bp + BTree.readSize], esi
jz.exit
.nextExtent:
branches/Chimera/i386/boot1/boot1hp.s
269269
270270
271271
272
272
273273
274274
275275
mov al, 1; read HFS+ Volume Header
mov edx, kHFSPlusBuffer
call readLBA
jcNEAR bios_read_error
jc NEAR bios_read_error
;
; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature.
branches/Chimera/i386/klibc/Makefile
3434
3535
3636
37
37
3838
39
39
4040
41
41
4242
4343
4444
4545
4646
4747
48
49
48
49
5050
$(LIBS): $(OBJS)
@echo "\t[RM] $@"
@echo "[RM] $@"
@rm -f $@
@echo "\t[AR] $(@F)"
@echo "[AR] $(@F)"
@ar q $@ $^ &> /dev/null
@echo "\t[RANLIB] $(@F)"
@echo "[RANLIB] $(@F)"
@ranlib $@
# dependencies
-include $(OBJROOT)/Makedep
clean-local:
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done
@for l in $(LIBS); do if [ -f "$${l}" ];then echo "\t[RM] $${l}"; fi; done
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "[RM] $${o}"; fi; done
@for l in $(LIBS); do if [ -f "$${l}" ];then echo "[RM] $${l}"; fi; done
@rm -f $(LIBS) $(OBJS)
branches/Chimera/i386/boot2/picopng.c
2323
2424
2525
26
26
27
2728
2829
2930
......
3233
3334
3435
36
37
3538
3639
3740
41
3842
43
3944
45
4046
47
48
49
4150
4251
4352
53
54
55
4456
4557
4658
59
4760
61
4862
49
63
64
65
5066
5167
5268
5369
5470
71
5572
73
5674
75
76
5777
78
5879
80
5981
6082
83
84
6185
6286
6387
/*************************************************************************************************/
typedef struct png_alloc_node {
typedef struct png_alloc_node
{
struct png_alloc_node *prev, *next;
void *addr;
size_t size;
png_alloc_node_t *png_alloc_head = NULL;
png_alloc_node_t *png_alloc_tail = NULL;
//==============================================================================
png_alloc_node_t *png_alloc_find_node(void *addr)
{
png_alloc_node_t *node;
for (node = png_alloc_head; node; node = node->next)
{
if (node->addr == addr)
{
break;
}
}
return node;
}
//==============================================================================
void png_alloc_add_node(void *addr, size_t size)
{
png_alloc_node_t *node;
if (png_alloc_find_node(addr))
{
return;
node = malloc(sizeof (png_alloc_node_t));
}
node = malloc(sizeof(png_alloc_node_t));
node->addr = addr;
node->size = size;
node->prev = png_alloc_tail;
node->next = NULL;
png_alloc_tail = node;
if (node->prev)
{
node->prev->next = node;
}
if (!png_alloc_head)
{
png_alloc_head = node;
}
}
//==============================================================================
void png_alloc_remove_node(png_alloc_node_t *node)
{
if (!node) {
branches/Chimera/i386/boot2/graphics.c
2020
2121
2222
23
24
25
2326
24
25
26
27
2827
2928
3029
......
5049
5150
5251
53
52
5453
5554
5655
5756
5857
59
58
6059
6160
62
61
6362
64
63
6564
6665
6766
......
7978
8079
8180
82
81
8382
8483
85
84
8685
8786
8887
8988
89
9090
91
91
9292
93
94
95
96
97
98
93
94
95
96
97
98
9999
100100
101101
......
163163
164164
165165
166
166
167167
168168
169169
170170
171171
172172
173
174
173175
174176
175177
......
184186
185187
186188
187
189
190
188191
189192
190193
......
208211
209212
210213
211
214
212215
213216
214217
......
219222
220223
221224
222
223
224
225
226
227
228
225
226
227
228
229
230
231
232
229233
230
231
232
233
234
235
234
235
236
237
238
239
236240
237
241
238242
239
243
240244
241
245
242246
243
244
245
246
247
248
249
247
248
249
250
251
252
253
250254
251
255
252256
253
257
258
259
260
254261
255
262
256263
257
258
259
260
264
265
266
267
261268
262
263
264
265
266
267
269
270
271
272
273
274
268275
269276
270
277
271278
272279
273280
274281
275282
276
283
277284
278
285
279286
280
281
282
287
288
289
283290
284
291
285292
286
293
287294
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
317324
318
325
319326
320
321
322
323
324
327
328
329
330
331
325332
326
333
327334
328
329
330
331
332
333
334
335
335
336
337
338
339
340
341
342
336343
337
344
338345
339
340
341
342
343
344
345
346
347
348
349
350
346
347
348
349
350
351
351352
352
353
354
353
354
355
356
357
358
355359
356
360
361
362
363
364
357365
358366
359367
......
506514
507515
508516
509
510
511
512
513
517
518
519
514520
515521
516522
......
525531
526532
527533
528
534
529535
530536
531537
......
533539
534540
535541
536
542
537543
538544
539545
......
543549
544550
545551
552
553
546554
547555
548556
......
595603
596604
597605
606
607
598608
599609
600610
......
623633
624634
625635
636
637
626638
627639
628640
......
640652
641653
642654
643
655
644656
645657
646658
......
669681
670682
671683
672
684
673685
674686
675687
......
677689
678690
679691
680
692
681693
682694
683695
......
687699
688700
689701
690
702
691703
692704
693705
......
704716
705717
706718
707
719
708720
709721
710722
......
725737
726738
727739
728
729
740
741
730742
731743
732744
......
735747
736748
737749
750
751
738752
739753
740754
......
752766
753767
754768
755
756
769
757770
758771
759772
......
787800
788801
789802
790
791
792
793
803
804
805
806
794807
795
808
796809
797810
811
812
798813
799814
800815
......
844859
845860
846861
847
848
862
863
864
849865
850866
851867
......
862878
863879
864880
865
881
866882
867883
868884
......
872888
873889
874890
875
891
876892
877893
878894
......
889905
890906
891907
908
909
892910
893911
894912
......
902920
903921
904922
905
923
906924
907925
908926
......
921939
922940
923941
924
925
942
943
926944
927945
928
946
929947
930948
931949
932
950
933951
934952
935953
......
969987
970988
971989
990
991
972992
973993
974994
......
978998
979999
9801000
981
1001
9821002
9831003
9841004
9851005
986
1006
9871007
9881008
9891009
990
1010
9911011
992
1012
9931013
994
1014
9951015
9961016
9971017
......
10281048
10291049
10301050
1031
1032
1033
1034
1051
10351052
10361053
10371054
......
10681085
10691086
10701087
1071
1072
1088
10731089
10741090
10751091
......
11001116
11011117
11021118
1119
1120
11031121
11041122
11051123
11061124
1107
1125
11081126
11091127
11101128
......
11221140
11231141
11241142
1125
1143
11261144
1127
1145
11281146
11291147
11301148
1131
1149
11321150
11331151
11341152
......
11371155
11381156
11391157
1140
1141
1158
11421159
11431160
11441161
......
11651182
11661183
11671184
1168
1185
11691186
11701187
11711188
11721189
11731190
11741191
1192
11751193
11761194
11771195
......
11801198
11811199
11821200
1183
1201
11841202
11851203
11861204
......
11901208
11911209
11921210
1193
1211
11941212
11951213
11961214
......
12131231
12141232
12151233
1216
1217
1234
1235
1236
12181237
12191238
1220
1239
12211240
12221241
12231242
......
12271246
12281247
12291248
1249
12301250
1251
12311252
12321253
1233
1254
12341255
12351256
12361257
......
12401261
12411262
12421263
1243
1264
12441265
12451266
12461267
......
12521273
12531274
12541275
1255
1256
1276
1277
1278
12571279
1258
1259
1280
1281
12601282
12611283
1262
1284
12631285
12641286
1287
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* Copyright 1993 NeXT, Inc. All rights reserved.
*
*/
/*
* Copyright 1993 NeXT, Inc.
* All rights reserved.
*/
#include "boot.h"
#include "vbe.h"
{
VBEInfoBlock vbeInfo;
int err, small;
bzero( &vbeInfo, sizeof(vbeInfo) );
strcpy( (char*)&vbeInfo, "VBE2" );
err = getVBEInfo( &vbeInfo );
if (err != errSuccess)
return 0;
if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) )
return 0;
small = (vbeInfo.TotalMemory < 16);
return vbeInfo.TotalMemory * 64 * 1024;
}
err = getVBEInfo( &vbeInfo );
if (err != errSuccess)
return 0;
if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) )
return 0;
buff = malloc(sizeof(char) * 256);
if (!buff) {
return 0;
}
small = (vbeInfo.TotalMemory < 16);
snprintf(buff, 256,
"VESA v%d.%d %d%s (%s)\n",
vbeInfo.VESAVersion >> 8,
vbeInfo.VESAVersion & 0xf,
small ? (vbeInfo.TotalMemory * 64) : (vbeInfo.TotalMemory / 16),
small ? "KB" : "MB",
VBEDecodeFP(const char *, vbeInfo.OEMStringPtr) );
"VESA v%d.%d %d%s (%s)\n",
vbeInfo.VESAVersion >> 8,
vbeInfo.VESAVersion & 0xf,
small ? (vbeInfo.TotalMemory * 64) : (vbeInfo.TotalMemory / 16),
small ? "KB" : "MB",
VBEDecodeFP(const char *, vbeInfo.OEMStringPtr) );
return buff;
}
clearScreenRows(0, 24);
setCursorPosition( 0, 0, 1 );
}
}
}
if (line != 0) {
pause();
}
setActiveDisplayPage(0);
}
//==============================================================================
char *getVBEModeInfoString()
{
VBEInfoBlock vbeInfo;
return 0;
}
char *buff=malloc(sizeof(char)*3072);
if(!buff) {
if(!buff)
{
return 0;
}
*modePtr, modeInfo.XResolution, modeInfo.YResolution,
modeInfo.BitsPerPixel, modeInfo.MemoryModel,
modeInfo.ModeAttributes);
}
}
return buff;
}
// If a mode is not found, then return the "best" available mode.
static unsigned short
getVESAModeWithProperties( unsigned short width,
unsigned short height,
unsigned char bitsPerPixel,
unsigned short attributesSet,
unsigned short attributesClear,
VBEModeInfoBlock * outModeInfo,
unsigned short * vesaVersion )
getVESAModeWithProperties( unsigned shortwidth,
unsigned shortheight,
unsigned charbitsPerPixel,
unsigned shortattributesSet,
unsigned shortattributesClear,
VBEModeInfoBlock*outModeInfo,
unsigned short*vesaVersion
)
{
VBEInfoBlock vbeInfo;
unsigned short * modePtr;
VBEModeInfoBlock modeInfo;
unsigned char modeBitsPerPixel;
unsigned short matchedMode = modeEndOfList;
int err;
VBEInfoBlock vbeInfo;
unsigned short * modePtr;
VBEModeInfoBlock modeInfo;
unsigned char modeBitsPerPixel;
unsigned short matchedMode = modeEndOfList;
int err;
// Clear output mode info.
// Clear output mode info.
bzero( outModeInfo, sizeof(*outModeInfo) );
bzero( outModeInfo, sizeof(*outModeInfo) );
// Get VBE controller info containing the list of supported modes.
// Get VBE controller info containing the list of supported modes.
bzero( &vbeInfo, sizeof(vbeInfo) );
strcpy( (char*)&vbeInfo, "VBE2" );
err = getVBEInfo( &vbeInfo );
if ( err != errSuccess )
{
return modeEndOfList;
}
bzero( &vbeInfo, sizeof(vbeInfo) );
strcpy( (char*)&vbeInfo, "VBE2" );
err = getVBEInfo( &vbeInfo );
if ( err != errSuccess )
{
return modeEndOfList;
}
// Report the VESA major/minor version number.
// Report the VESA major/minor version number.
if (vesaVersion) *vesaVersion = vbeInfo.VESAVersion;
if (vesaVersion)
{
*vesaVersion = vbeInfo.VESAVersion;
}
// Loop through the mode list, and find the matching mode.
// Loop through the mode list, and find the matching mode.
for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr );
*modePtr != modeEndOfList; modePtr++ )
{
// Get mode information.
for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr );
*modePtr != modeEndOfList; modePtr++ )
{
// Get mode information.
bzero( &modeInfo, sizeof(modeInfo) );
err = getVBEModeInfo( *modePtr, &modeInfo );
if ( err != errSuccess )
{
continue;
}
bzero( &modeInfo, sizeof(modeInfo) );
err = getVBEModeInfo( *modePtr, &modeInfo );
if ( err != errSuccess )
{
continue;
}
#if DEBUG
printf("Mode %x: %dx%dx%d mm:%d attr:%x\n",
printf("Mode %x: %dx%dx%d mm:%d attr:%x\n",
*modePtr, modeInfo.XResolution, modeInfo.YResolution,
modeInfo.BitsPerPixel, modeInfo.MemoryModel,
modeInfo.ModeAttributes);
#endif
// Filter out unwanted modes based on mode attributes.
// Filter out unwanted modes based on mode attributes.
if ( ( ( modeInfo.ModeAttributes & attributesSet ) != attributesSet )
if ( ( ( modeInfo.ModeAttributes & attributesSet ) != attributesSet )
|| ( ( modeInfo.ModeAttributes & attributesClear ) != 0 ) )
{
continue;
}
{
continue;
}
// Pixel depth in bits.
// Pixel depth in bits.
modeBitsPerPixel = modeInfo.BitsPerPixel;
modeBitsPerPixel = modeInfo.BitsPerPixel;
if ( ( modeBitsPerPixel == 4 ) && ( modeInfo.MemoryModel == 0 ) )
{
// Text mode, 16 colors.
}
else if ( ( modeBitsPerPixel == 8 ) && ( modeInfo.MemoryModel == 4 ) )
{
// Packed pixel, 256 colors.
}
else if ( ( ( modeBitsPerPixel == 16 ) || ( modeBitsPerPixel == 15 ) )
&& ( modeInfo.MemoryModel == 6 )
&& ( modeInfo.RedMaskSize == 5 )
&& ( modeInfo.GreenMaskSize == 5 )
&& ( modeInfo.BlueMaskSize == 5 ) )
{
// Direct color, 16 bpp (1:5:5:5).
modeInfo.BitsPerPixel = modeBitsPerPixel = 16;
}
else if ( ( modeBitsPerPixel == 32 )
&& ( modeInfo.MemoryModel == 6 )
&& ( modeInfo.RedMaskSize == 8 )
&& ( modeInfo.GreenMaskSize == 8 )
&& ( modeInfo.BlueMaskSize == 8 ) )
{
// Direct color, 32 bpp (8:8:8:8).
}
else
{
continue; // Not a supported mode.
}
if ( ( modeBitsPerPixel == 4 ) && ( modeInfo.MemoryModel == 0 ) )
{
// Text mode, 16 colors.
}
else if ( ( modeBitsPerPixel == 8 ) && ( modeInfo.MemoryModel == 4 ) )
{
// Packed pixel, 256 colors.
}
else if ( ( ( modeBitsPerPixel == 16 ) || ( modeBitsPerPixel == 15 ) )
&& ( modeInfo.MemoryModel == 6 )
&& ( modeInfo.RedMaskSize == 5 )
&& ( modeInfo.GreenMaskSize == 5 )
&& ( modeInfo.BlueMaskSize == 5 ) )
{
// Direct color, 16 bpp (1:5:5:5).
modeInfo.BitsPerPixel = modeBitsPerPixel = 16;
}
else if ( ( modeBitsPerPixel == 32 )
&& ( modeInfo.MemoryModel == 6 )
&& ( modeInfo.RedMaskSize == 8 )
&& ( modeInfo.GreenMaskSize == 8 )
&& ( modeInfo.BlueMaskSize == 8 ) )
{
// Direct color, 32 bpp (8:8:8:8).
}
else
{
continue; // Not a supported mode.
}
// Modes larger than the specified dimensions are skipped.
// Modes larger than the specified dimensions are skipped.
if ( ( modeInfo.XResolution > width ) ||
( modeInfo.YResolution > height ) )
{
continue;
}
if ( ( modeInfo.XResolution > width ) ||
( modeInfo.YResolution > height ) )
{
continue;
}
// Perfect match, we're done looking.
// Perfect match, we're done looking.
if ( ( modeInfo.XResolution == width ) &&
( modeInfo.YResolution == height ) &&
( modeBitsPerPixel == bitsPerPixel ) )
{
matchedMode = *modePtr;
bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) );
break;
}
if ( ( modeInfo.XResolution == width ) &&
( modeInfo.YResolution == height ) &&
( modeBitsPerPixel == bitsPerPixel ) )
{
matchedMode = *modePtr;
bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) );
break;
}
// Save the next "best" mode in case a perfect match is not found.
// Save the next "best" mode in case a perfect match is not found.
if ( modeInfo.XResolution == outModeInfo->XResolution &&
modeInfo.YResolution == outModeInfo->YResolution &&
modeBitsPerPixel <= outModeInfo->BitsPerPixel )
{
continue; // Saved mode has more depth.
}
if ( modeInfo.XResolution < outModeInfo->XResolution ||
modeInfo.YResolution < outModeInfo->YResolution ||
modeBitsPerPixel < outModeInfo->BitsPerPixel )
{
continue; // Saved mode has more resolution.
}
if ( modeInfo.XResolution == outModeInfo->XResolution &&
modeInfo.YResolution == outModeInfo->YResolution &&
modeBitsPerPixel <= outModeInfo->BitsPerPixel )
{
continue; // Saved mode has more depth.
}
matchedMode = *modePtr;
bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) );
}
if ( modeInfo.XResolution < outModeInfo->XResolution ||
modeInfo.YResolution < outModeInfo->YResolution ||
modeBitsPerPixel < outModeInfo->BitsPerPixel )
{
continue; // Saved mode has more resolution.
}
return matchedMode;
matchedMode = *modePtr;
bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) );
}
return matchedMode;
}
//==========================================================================
return err;
}
int
convertImage( unsigned short width,
unsigned short height,
const unsigned char *imageData,
unsigned char **newImageData )
//==============================================================================
int convertImage( unsigned short width, unsigned short height, const unsigned char *imageData, unsigned char **newImageData )
{
int cnt;
unsigned char *img = 0;
img16[cnt] = lookUpCLUTIndex(imageData[cnt], 16);
img = (unsigned char *)img16;
break;
case 32 :
img32 = malloc(width * height * 4);
if ( !img32 ) break;
img32[cnt] = lookUpCLUTIndex(imageData[cnt], 32);
img = (unsigned char *)img32;
break;
default :
img = malloc(width * height);
bcopy(imageData, img, width * height);
return 0;
}
//==============================================================================
int loadPngImage(const char *filename, uint16_t *width, uint16_t *height,
uint8_t **imageData)
{
return error;
}
//==============================================================================
int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData) {
PNG_info_t *info;
int error = 0;
return error;
}
//==============================================================================
void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height,
uint8_t *data)
{
uint32_t a; // Alpha
uint32_t dstrb, dstg, srcrb, srcg, drb, dg, rb, g, tempB; // Intermediate variables
uint16_t pos;
for (pos = 0; pos < drawWidth * 4; pos += 4) {
// Fast pseudo-vector alpha blending, adapted from: http://www.stereopsis.com/doubleblend.html
s = *((uint32_t*) (data + pos));
}
}
break;
default: /*Universal version*/
{
uint32_t s;
uint32_t dr, dg, db, sr, sg, sb; // Intermediate variables
uint16_t pos;
int bpp = (VIDEO (depth) + 7)/8;
for (pos = 0; pos < drawWidth; pos ++) {
// Fast pseudo-vector alpha blending, adapted from: http://www.stereopsis.com/doubleblend.html
s = *((uint32_t*) (data + 4*pos));
sr = (s & 0xFF);
a = (s >> 24) + 1;
switch (VIDEO (depth))
{
case 24:
db = ((*(uint16_t *)(vram + bpp*pos))&0x1f)<<3;
dg = ((*(uint16_t *)(vram + bpp*pos))&0x03e0)>>2;
dr = ((*(uint16_t *)(vram + bpp*pos))&0x7c00)>>7;
break;
break;
default:
return;
}
*(uint16_t *)(vram + bpp*pos) = ((db&0xf8)>>3) | ((dg&0xf8)<<2) | ((dr&0xf8)<<7);
break;
}
}
}
}
break;
}
}
}
//==============================================================================
void drawCheckerBoard()
{
uint32_t *vram = (uint32_t *) VIDEO(baseAddr);
//==========================================================================
// LookUpCLUTIndex
unsigned long lookUpCLUTIndex( unsigned char index,
unsigned char depth )
unsigned long lookUpCLUTIndex( unsigned char index, unsigned char depth )
{
long result, red, green, blue;
void * stosl(void * dst, long val, long len)
{
asm volatile ( "rep; stosl"
: "=c" (len), "=D" (dst)
: "0" (len), "1" (dst), "a" (val)
: "memory" );
asm volatile ( "rep; stosl"
: "=c" (len), "=D" (dst)
: "0" (len), "1" (dst), "a" (val)
: "memory" );
return dst;
return dst;
}
//==============================================================================
void drawColorRectangle( unsigned short x,
unsigned short y,
unsigned short width,
}
}
void
loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or)
//==============================================================================
void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or)
{
int x,y, off;
int red=0x7f, green=0x7f, blue=0x7f;
red=(val>>7)&0xf8;
green=(val>>2)&0xf8;
blue=(val<<3)&0xf8;
break;
break;
}
case 32:
{
green=(val>>8)&0xff;
blue=(val)&0xff;
break;
}
}
}
char *ptr=(char *)output+x*(op/8)+y*or;
switch (op)
}
}
//==============================================================================
DECLARE_IOHIBERNATEPROGRESSALPHA
void drawPreview(void *src, uint8_t * saveunder)
void *uncomp;
int origwidth, origheight, origbpx;
uint32_t saveindex[kIOHibernateProgressCount] = { 0 };
if (src && (uncomp=DecompressData(src, &origwidth, &origheight, &origbpx)))
{
if (!setVESAGraphicsMode(origwidth, origheight, origbpx, 0))
// Set the screen to 75% grey.
drawColorRectangle(0, 0, VIDEO(width), VIDEO(height), 0x01 /* color index */);
}
pixelShift = VIDEO (depth) >> 4;
if (pixelShift < 1) return;
screen += ((VIDEO (width)
- kIOHibernateProgressCount * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << (pixelShift - 1))
+ (VIDEO (height) - kIOHibernateProgressOriginY - kIOHibernateProgressHeight) * rowBytes;
for (y = 0; y < kIOHibernateProgressHeight; y++)
{
out = screen + y * rowBytes;
}
}
//==============================================================================
void updateProgressBar(uint8_t * saveunder, int32_t firstBlob, int32_t select)
{
uint8_t * screen;
uint32_t alpha, in, color, result;
uint8_t * out;
uint32_t saveindex[kIOHibernateProgressCount] = { 0 };
pixelShift = VIDEO(depth) >> 4;
if (pixelShift < 1) return;
screen = (uint8_t *) VIDEO (baseAddr);
rowBytes = VIDEO (rowBytes);
screen += ((VIDEO (width)
- kIOHibernateProgressCount * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << (pixelShift - 1))
+ (VIDEO (height) - kIOHibernateProgressOriginY - kIOHibernateProgressHeight) * rowBytes;
lastBlob = (select < kIOHibernateProgressCount) ? select : (kIOHibernateProgressCount - 1);
screen += (firstBlob * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << pixelShift;
for (y = 0; y < kIOHibernateProgressHeight; y++)
{
out = screen + y * rowBytes;
//==========================================================================
// setVESATextMode
static int
setVESATextMode( unsigned short cols,
unsigned short rows,
unsigned char bitsPerPixel )
static int setVESATextMode( unsigned short cols, unsigned short rows, unsigned char bitsPerPixel )
{
VBEModeInfoBlock minfo;
unsigned short mode = modeEndOfList;
//==========================================================================
// getNumberArrayFromProperty
static int
getNumberArrayFromProperty( const char * propKey,
static int getNumberArrayFromProperty( const char * propKey,
unsigned long numbers[],
unsigned long maxArrayCount )
{
return count;
}
//==============================================================================
int initGraphicsMode ()
{
unsigned long params[4];
int count;
params[3] = 0;
count = getNumberArrayFromProperty( kGraphicsModeKey, params, 4 );
params[1] = gui.screen.height;
params[2] = 32;
}
// Map from pixel format to bits per pixel.
if ( params[2] == 256 ) params[2] = 8;
if ( params[2] == 555 ) params[2] = 16;
if ( params[2] == 888 ) params[2] = 32;
return setVESAGraphicsMode( params[0], params[1], params[2], params[3] );
}
//
// Set the video mode to VGA_TEXT_MODE or GRAPHICS_MODE.
void
setVideoMode( int mode, int drawgraphics)
void setVideoMode( int mode, int drawgraphics)
{
unsigned long params[4];
int count;
params[1] = 25;
}
setVESATextMode( params[0], params[1], 4 );
setVESATextMode( params[0], params[1], 4 );
bootArgs->Video.v_display = VGA_TEXT_MODE;
}
currentIndicator = 0;
}
//==============================================================================
void getGraphicModeParams(unsigned long params[]) {
params[3] = 0;
unsigned short vesaVersion;
unsigned short mode = modeEndOfList;
getNumberArrayFromProperty( kGraphicsModeKey, params, 4);
mode = getVESAModeWithProperties( params[0], params[1], params[2],
maLinearFrameBufferAvailBit,
0,
&minfo, &vesaVersion );
params[0] = minfo.XResolution;
params[1] = minfo.YResolution;
params[2] = 32;
// ensure a minimum of 1/9 sec between animation frames.
#define MIN_TICKS 2
void
spinActivityIndicator(int sectors)
//==============================================================================
void spinActivityIndicator(int sectors)
{
static unsigned long lastTickTime = 0, currentTickTime;
if (previewTotalSectors && previewSaveunder)
{
int blob, lastBlob;
blob = (previewLoadedSectors * kIOHibernateProgressCount) / previewTotalSectors;
if (blob!=lastBlob)
{
updateProgressBar (previewSaveunder, lastBlob, blob);
}
return;
}
currentTickTime = time18(); // late binding
if (currentTickTime < lastTickTime + MIN_TICKS)
{
{
lastTickTime = currentTickTime;
}
if (getVideoMode() == VGA_TEXT_MODE)
{
if (currentIndicator >= sizeof(indicator))
}
}
void
clearActivityIndicator( void )
//==============================================================================
void clearActivityIndicator( void )
{
if ( getVideoMode() == VGA_TEXT_MODE )
{
if ( getVideoMode() == VGA_TEXT_MODE )
{
putchar(' ');
putchar('\b');
}
}
}
//==============================================================================
branches/Chimera/i386/boot2/graphics.h
11
22
3
43
4
55
66
77
......
2626
2727
2828
29
29
3030
3131
3232
3333
3434
35
36
37
3835
3936
4037
/*
* graphics.h
*
*
*
* Created by fassl on 22.12.08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
void drawDataRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char * data );
int convertImage( unsigned short width, unsigned short height, const unsigned char *imageData, unsigned char **newImageData );
int initGraphicsMode ();
int initGraphicsMode();
void drawCheckerBoard();
void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *data);
void drawCheckerBoard();
void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *data);
int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData);
uint32_t getVBEVideoRam();
branches/Chimera/i386/boot2/mboot.c
1515
1616
1717
18
19
1820
1921
2022
......
6163
6264
6365
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
66
8767
8868
8969
......
344324
345325
346326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
347352
348353
349354
int multiboot_skip_partition=0;
int multiboot_skip_partition_set=0;
void boot(int biosdev);
// Global multiboot info, if using multiboot.
struct multiboot_info *gMI;
// would be on the stack which would possibly be using way too much stack.
void multiboot_to_boot(int multiboot_magic, struct multiboot_info *mi_orig)
{
uint32_t bootdevice = hi_multiboot(multiboot_magic, mi_orig);
if(bootdevice != BAD_BOOT_DEVICE)
{
// boot only returns to do a chain load.
for(;;)
{ // NOTE: boot only uses the last byte (the drive number)
common_boot(bootdevice);
if(chainbootflag)
chainLoad();
else
waitThenReload();
}
}
// Avoid returning to high-memory address which isn't valid in the segment
// we are now in.
// Calling sleep() ensures the user ought to be able to use Ctrl+Alt+Del
// because the BIOS will have interrupts on.
for(;;)
sleep(10);
// NOTE: *IF* we needed to return we'd have to fix up our return address to
// be in low memory using the same trick as below.
// However, there doesn't seem to be any point in returning to assembly
// particularly when the remaining code merely halts the processor.
hi_multiboot(multiboot_magic, mi_orig);
}
void chainLoad()
// Since we call multiboot ourselves, its return address will be correct.
// That is unless it's inlined in which case it does not matter.
uint32_t bootdevice = multiboot(multiboot_magic, mi_p);
if(bootdevice != BAD_BOOT_DEVICE)
{
// boot only returns to do a chain load.
for(;;)
{ // NOTE: boot only uses the last byte (the drive number)
boot(bootdevice);
if(chainbootflag)
chainLoad();
else
waitThenReload();
}
}
// Avoid returning to high-memory address which isn't valid in the segment
// we are now in.
// Calling sleep() ensures the user ought to be able to use Ctrl+Alt+Del
// because the BIOS will have interrupts on.
for(;;)
sleep(10);
// NOTE: *IF* we needed to return we'd have to fix up our return address to
// be in low memory using the same trick as below.
// However, there doesn't seem to be any point in returning to assembly
// particularly when the remaining code merely halts the processor.
// We're about to exit and temporaryBootArgs will no longer be valid
bootArgs = NULL;
return bootdevice;
branches/Chimera/i386/boot2/prompt.c
2828
2929
3030
31
31
3232
33
33
3434
35
36
3537
3638
3739
#include <vers.h>
char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chameleon 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";
"%dMB memory\n";*/
char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v4.1.0\n" "Build date: " I386BOOT_BUILDDATE "\n" "%dMB memory\n";
char bootPrompt[] =
"Press Enter to start up Darwin/x86 with no options, or you can:\n"
" Type -v and press Enter to start up with diagnostic messages\n"
branches/Chimera/i386/boot2/Makefile
8282
8383
8484
85
85
8686
8787
8888
......
9494
9595
9696
97
97
9898
9999
100
100
101101
102102
103103
......
114114
115115
116116
117
117
118118
119119
120
120
121121
122122
123123
......
142142
143143
144144
145
145
146146
147147
148148
......
155155
156156
157157
158
158
159159
160160
161161
......
190190
191191
192192
193
193
194194
195195
196196
......
204204
205205
206206
207
208
207
208
209209
210210
@${MKDIRS} $(OBJROOT)/../boot2_modules/
@### First pass, don't worry abount segment alignment.
@echo "\t[LD] boot.sys"
@echo "[LD] boot.sys"
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-read_only_relocs,suppress \
ifeq (${CONFIG_MODULES}, y)
@# Generate the Symbols.dylib file
@echo "\t[dyldsymboltool] Symbols.dylib"
@echo "[dyldsymboltool] Symbols.dylib"
@$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@echo "\t[LD] boot.sys"
@echo "[LD] boot.sys"
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \
@${RM} $(SYMROOT)/${SYMBOLS_MODULE}
@# Generate the Symbols.dylib file
@echo "\t[dyldsymboltool] Symbols.dylib"
@echo "[dyldsymboltool] Symbols.dylib"
@$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@echo "\t[LD] boot.sys"
@echo "[LD] boot.sys"
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \
-o $(OBJROOT)/Symbols_LINKER_ONLY.dylib
else
@echo "\t[LD] boot.sys"
@echo "[LD] boot.sys"
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \
endif
@echo "\t[MACHOCONV] boot"
@echo "[MACHOCONV] boot"
@$(SYMROOT)/machOconv ${SYMROOT}/$@.sys $(SYMROOT)/$@ &> /dev/null
@( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
@echo "" >> $(SYMROOT)/art.h
@echo "embeddedpng_t embeddedImages[] = {" >> $(SYMROOT)/art.h
@cd $(SYMROOT)/embed && find . -name '*.png' | sort | cut -f 2 -d '/' | cut -f 1 -d '.' | \
awk '{ printf "\t{.name = \"%s\", .pngdata = __%s_png, .length = &__%s_png_len},\n", $$1, $$1, $$1 }' >> $(SYMROOT)/art.h
awk '{ printf "{.name = \"%s\", .pngdata = __%s_png, .length = &__%s_png_len},\n", $$1, $$1, $$1 }' >> $(SYMROOT)/art.h
@echo "};" >> $(SYMROOT)/art.h
@echo "#endif /* !__BOOT2_ART_H */" >> $(SYMROOT)/art.h ;\
clean-local:
@for o in $(SYMROOT)/boot $(SYMROOT)/boot.sys $(SYMROOT)/embedded.h $(OBJROOT)/Symbols_LINKER_ONLY.dylib; do \
if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done
@if [ -d "$(OBJROOT)" ];then echo "\t[RM] all objects in $(OBJROOT)"; fi
if [ -f "$${o}" ];then echo "[RM] $${o}"; fi; done
@if [ -d "$(OBJROOT)" ];then echo "[RM] all objects in $(OBJROOT)"; fi
@rm -f $(SYMROOT)/boot $(SYMROOT)/boot.sys $(SYMROOT)/embedded.h $(OBJS)
@rm -rf $(OBJROOT)
branches/Chimera/i386/boot2/modules.c
105105
106106
107107
108
109
110
111
112
108113
109114
110115
......
121126
122127
123128
129
124130
125131
126132
......
282288
283289
284290
291
292
293
294
295
285296
286297
287298
long flags;
long time;
struct dirstuff* moduleDir = opendir("/Extra/modules/");
if(!moduleDir)
{
verbose("Warning: Unable to open modules folder at '/Extra/modules/'. Ingoring modules.\n");
return;
}
while (readdir(moduleDir, (const char**)&name, &flags, &time) >= 0) {
if(strcmp(&name[strlen(name) - sizeof("dylib")], ".dylib") == 0) {
char* tmp = malloc(strlen(name) + 1);
}
}
closedir(moduleDir);
}
//DBG("External symbol %s located at 0x%X\n", name, entry->addr);
return entry->addr;
}
else if(strcmp(entry->symbol, name + 1) == 0 && *name == '_') // Allow _strstr to bing to strstr, etc
{
//DBG("External symbol %s located at 0x%X\n", name, entry->addr);
return entry->addr;
}
else
{
entry = entry->next;
branches/Chimera/i386/boot2/gui.c
3131
3232
3333
34
3435
3536
3637
......
7475
7576
7677
77
7878
7979
8080
......
120120
121121
122122
123
124
123125
124126
125127
......
159161
160162
161163
162
163164
164165
165166
......
205206
206207
207208
209
210
208211
209212
210213
......
352355
353356
354357
358
359
355360
356361
357362
......
442447
443448
444449
450
451
445452
446453
447454
......
460467
461468
462469
470
471
463472
464473
465474
......
472481
473482
474483
484
485
475486
476487
477488
......
496507
497508
498509
510
511
499512
500513
501514
......
515528
516529
517530
531
532
518533
519534
520535
......
535550
536551
537552
553
554
538555
539556
540557
......
545562
546563
547564
565
566
548567
549568
550569
......
557576
558577
559578
579
580
560581
561582
562583
......
577598
578599
579600
601
602
580603
581604
582605
......
649672
650673
651674
675
676
652677
653678
654679
......
848873
849874
850875
876
877
851878
852879
853880
......
929956
930957
931958
959
960
932961
933962
934963
935964
936965
966
967
937968
938969
939970
......
9741005
9751006
9761007
977
1008
9781009
979
1010
9801011
9811012
9821013
......
10291060
10301061
10311062
1063
1064
10321065
10331066
10341067
......
11331166
11341167
11351168
1169
1170
11361171
11371172
11381173
......
11501185
11511186
11521187
1188
1189
11531190
11541191
11551192
......
11751212
11761213
11771214
1215
1216
11781217
11791218
11801219
......
12091248
12101249
12111250
1251
1252
12121253
12131254
12141255
......
12341275
12351276
12361277
1278
1279
12371280
12381281
12391282
12401283
12411284
12421285
1286
1287
12431288
12441289
12451290
......
12531298
12541299
12551300
1301
1302
12561303
12571304
12581305
......
13351382
13361383
13371384
1385
1386
13381387
13391388
13401389
......
14181467
14191468
14201469
1470
1471
14211472
14221473
14231474
......
14931544
14941545
14951546
1547
1548
14961549
14971550
14981551
......
15021555
15031556
15041557
1558
1559
15051560
15061561
15071562
......
15121567
15131568
15141569
1570
1571
15151572
15161573
15171574
......
15351592
15361593
15371594
1595
1596
15381597
15391598
15401599
......
15661625
15671626
15681627
1628
1629
15691630
15701631
15711632
......
15811642
15821643
15831644
1645
1646
15841647
15851648
15861649
......
16371700
16381701
16391702
1703
1704
16401705
16411706
16421707
......
16631728
16641729
16651730
1731
1732
16661733
16671734
16681735
......
17071774
17081775
17091776
1777
1778
17101779
17111780
17121781
......
18371906
18381907
18391908
1909
1910
18401911
18411912
18421913
......
18571928
18581929
18591930
1931
1932
18601933
18611934
18621935
......
19171990
19181991
19191992
1993
1994
19201995
19211996
19221997
......
19592034
19602035
19612036
2037
2038
19622039
19632040
19642041
......
19702047
19712048
19722049
2050
2051
19732052
19742053
19752054
......
20272106
20282107
20292108
2030
2031
2032
2109
2110
2111
2112
2113
20332114
20342115
20352116
......
21282209
21292210
21302211
2131
2132
2212
2213
21332214
2215
int lasttime = 0; // we need this for animating maybe
// ====================================================================
/*
* ATTENTION: the enum and the following array images[] MUST match !!!
iDeviceHFSRAID_Leo_o,
iDeviceHFSRAID_Tiger,
iDeviceHFSRAID_Tiger_o,
iDeviceEXT3,
iDeviceEXT3_o,
iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iFontSmall,
};
// ====================================================================
image_t images[] = {
{.name = "background", .image = NULL},
{.name = "logo", .image = NULL},
{.name = "device_hfsraid_leo_o", .image = NULL},
{.name = "device_hfsraid_tiger", .image = NULL},
{.name = "device_hfsraid_tiger_o", .image = NULL},
{.name = "device_ext3", .image = NULL},
{.name = "device_ext3_o", .image = NULL},
{.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "font_small", .image = NULL},
};
// ====================================================================
int imageCnt = 0;
extern intgDeviceCount;
return 1;
}
// ====================================================================
static int loadGraphics(void)
{
LOADPNG(background, IMG_REQUIRED);
return 0;
}
// ====================================================================
static int unloadGraphics(void)
{
int i;
return 0;
}
// ====================================================================
int freeBackBuffer( window_t *window )
{
if (gui.backbuffer && gui.backbuffer->pixels) {
return 1;
}
// ====================================================================
pixmap_t *getCroppedPixmapAtPosition( pixmap_t *from, position_t pos, uint16_t width, uint16_t height )
{
pixmap_t *cropped = malloc( sizeof( pixmap_t ) );
return cropped;
}
// ====================================================================
int createBackBuffer( window_t *window )
{
gui.backbuffer = malloc(sizeof(pixmap_t));
return 0;
}
// ====================================================================
int createWindowBuffer( window_t *window )
{
window->pixmap = malloc(sizeof(pixmap_t));
return 0;
}
// ====================================================================
int freeWindowBuffer( window_t *window )
{
if (window->pixmap && window->pixmap->pixels) {
return 1;
}
// ====================================================================
void fillPixmapWithColor(pixmap_t *pm, uint32_t color)
{
int x,y;
}
}
// ====================================================================
void drawBackground()
{
// reset text cursor
memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 );
}
// ====================================================================
void setupDeviceList(config_file_t *theme)
{
unsigned int pixel;
}
}
// ====================================================================
void loadThemeValues(config_file_t *theme)
{
unsigned int screen_width = gui.screen.width;
}
}
// ====================================================================
int initGUI(void)
{
intval;
return 1;
}
// ====================================================================
bool is_image_loaded(int i)
{
return (images[i].image != NULL) ? true : false;
}
// ====================================================================
void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected)
{
int devicetype;
devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID : iDeviceHFS);
break;
}
break;
}
case kPartitionTypeHPFS:
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
}
// ====================================================================
void drawDeviceList (int start, int end, int selection)
{
inti;
}
// ====================================================================
void clearGraphicBootPrompt()
{
// clear text buffer
return;
}
// ====================================================================
void updateGraphicBootPrompt()
{
fillPixmapWithColor( gui.bootprompt.pixmap, gui.bootprompt.bgcolor);
return;
}
// ====================================================================
static inline
void vramwrite (void *data, int width, int height)
{
}
}
// ====================================================================
void updateVRAM()
{
if (gui.redraw) {
}
}
// ====================================================================
struct putc_info //Azi: exists on console.c & printf.c
{
char * str;
char * last_str;
};
// ====================================================================
static int
sputc(int c, struct putc_info * pi) //Azi: same as above
{
return c;
}
// ====================================================================
int gprintf( window_t * window, const char * fmt, ...)
{
char *formattedtext;
return 1;
}
// ====================================================================
int dprintf( window_t * window, const char * fmt, ...)
{
char *formattedtext;
return 1;
}
// ====================================================================
int vprf(const char * fmt, va_list ap)
{
int i;
return 1;
}
// ====================================================================
pixmap_t* charToPixmap(unsigned char ch, font_t *font) {
unsigned int cha = (unsigned int)ch - 32;
if (cha >= font->count) {
return font->chars[cha] ? font->chars[cha] : NULL;
}
// ====================================================================
position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p) {
pixmap_t* pm = charToPixmap(ch, font);
if (pm && ((p.x + pm->width) < blendInto->width)) {
}
}
// ====================================================================
void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p)
{
int i=0;
}
}
// ====================================================================
void drawStrCenteredAt(char *text, font_t *font, pixmap_t *blendInto, position_t p)
{
int i = 0;
drawStr(text, font, blendInto, p);
}
// ====================================================================
int destroyFont(font_t *font)
{
int i;
return 0;
}
// ====================================================================
int initFont(font_t *font, image_t *data)
{
unsigned int x = 0, y = 0, x2 = 0, x3 = 0;
return 0;
}
// ====================================================================
void colorFont(font_t *font, uint32_t color)
{
if( !color ) {
}
}
// ====================================================================
void makeRoundedCorners(pixmap_t *p)
{
int x,y;
}
}
// ====================================================================
void showInfoBox(char *title, char *text_orig)
{
char* text;
free(text);
}
// ====================================================================
void animateProgressBar()
{
int y;
}
}
// ====================================================================
void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress)
{
if(progress>100) {
free(progressbar.pixels);
}
// ====================================================================
void drawInfoMenuItems()
{
int i,n;
gui.redraw = true;
}
// ====================================================================
int drawInfoMenu()
{
drawInfoMenuItems();
return 1;
}
// ====================================================================
int updateInfoMenu(int key)
{
switch (key)
return DO_NOT_BOOT;
}
uint16_t bootImageWidth = 0;
uint16_t bootImageHeight = 0;
uint8_t *bootImageData = NULL;
// ====================================================================
uint16_t bootImageWidth = 0;
uint16_t bootImageHeight = 0;
uint8_t *bootImageData = NULL;
static bool usePngImage = true;
//==========================================================================
free(bootImageData);
}
free(appleBootPict);
}
}
}
}
}
// ====================================================================
branches/Chimera/i386/boot2/modules_support.s
33
44
55
6
6
77
88
99
LABEL(dyld_stub_binder)
jmp_dyld_stub_binder
LABEL(dyld_void_start)
ret
branches/Chimera/i386/boot2/appleClut8.h
22
33
44
5
5
66
77
88
......
1010
1111
1212
13
13
1414
1515
1616
......
1818
1919
2020
21
21
2222
2323
2424
......
3131
3232
3333
34
3435
3536
3637
3738
39
3840
3941
4042
4143
44
4245
4346
4447
45
48
49
4650
4751
4852
4953
54
5055
5156
5257
5358
59
5460
5561
5662
5763
64
5865
5966
6067
6168
69
6270
6371
6472
6573
74
6675
6776
6877
6978
79
7080
7181
7282
7383
84
7485
7586
7687
7788
89
7890
7991
8092
8193
94
8295
8396
84
97
8598
99
86100
87101
88102
89103
104
90105
91106
92107
* Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*
* Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* Original Code as defined in and that are subject to the Apple Public
* except in compliance with the License. Please obtain a copy of the
* License at http://www.apple.com/publicsource and read it before using
* this file.
*
*
* The Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
*
* @APPLE_LICENSE_HEADER_END@
*/
0xbc,0xbc,0xbc, 0xff,0xff,0x00, 0xba,0xba,0xba, 0xb9,0xb9,0xb9,
0xb8,0xb8,0xb8, 0xb7,0xb7,0xb7, 0xb6,0xb6,0xb6, 0xb5,0xb5,0xb5,
0xb4,0xb4,0xb4, 0xb3,0xb3,0xb3, 0xb2,0xb2,0xb2, 0x00,0x00,0x00,
0xb1,0xb1,0xb1, 0xb0,0xb0,0xb0, 0xaf,0xaf,0xaf, 0xae,0xae,0xae,
0xad,0xad,0xad, 0xac,0xac,0xac, 0xab,0xab,0xab, 0xaa,0xaa,0xaa,
0xff,0x00,0xff, 0xa9,0xa9,0xa9, 0xa8,0xa8,0xa8, 0xa7,0xa7,0xa7,
0xa6,0xa6,0xa6, 0xa5,0xa5,0xa5, 0xa4,0xa4,0xa4, 0xa3,0xa3,0xa3,
0xa2,0xa2,0xa2, 0xa1,0xa1,0xa1, 0xa0,0xa0,0xa0, 0xff,0x00,0x00,
0x9f,0x9f,0x9f, 0x9e,0x9e,0x9e, 0x9d,0x9d,0x9d, 0x9c,0x9c,0x9c,
0x9b,0x9b,0x9b, 0x9a,0x9a,0x9a, 0xcc,0xcc,0xff, 0xcc,0xcc,0xcc,
0x99,0x99,0x99, 0x98,0x98,0x98, 0x97,0x97,0x97, 0x96,0x96,0x96,
0x95,0x95,0x95, 0x94,0x94,0x94, 0x93,0x93,0x93, 0x92,0x92,0x92,
0x91,0x91,0x91, 0x90,0x90,0x90, 0x8f,0x8f,0x8f, 0x8e,0x8e,0x8e,
0x8d,0x8d,0x8d, 0x8c,0x8c,0x8c, 0x8b,0x8b,0x8b, 0x8a,0x8a,0x8a,
0x89,0x89,0x89, 0x87,0x87,0x87, 0x86,0x86,0x86, 0x85,0x85,0x85,
0x89,0x89,0x89, 0x88,0x88,0x88, 0x86,0x86,0x86, 0x85,0x85,0x85,
0x84,0x84,0x84, 0x83,0x83,0x83, 0x82,0x82,0x82, 0x81,0x81,0x81,
0x80,0x80,0x80, 0x7f,0x7f,0x7f, 0x7e,0x7e,0x7e, 0x7d,0x7d,0x7d,
0x7c,0x7c,0x7c, 0x7b,0x7b,0x7b, 0x7a,0x7a,0x7a, 0x79,0x79,0x79,
0x78,0x78,0x78, 0x76,0x76,0x76, 0x75,0x75,0x75, 0x74,0x74,0x74,
0x73,0x73,0x73, 0x72,0x72,0x72, 0x71,0x71,0x71, 0x70,0x70,0x70,
0x6f,0x6f,0x6f, 0x6e,0x6e,0x6e, 0x6d,0x6d,0x6d, 0x6c,0x6c,0x6c,
0x6b,0x6b,0x6b, 0x6a,0x6a,0x6a, 0x69,0x69,0x69, 0x68,0x68,0x68,
0x67,0x67,0x67, 0x66,0x66,0x66, 0x64,0x64,0x64, 0x63,0x63,0x63,
0x62,0x62,0x62, 0x61,0x61,0x61, 0x60,0x60,0x60, 0x5f,0x5f,0x5f,
0x5e,0x5e,0x5e, 0x5d,0x5d,0x5d, 0x5c,0x5c,0x5c, 0x5b,0x5b,0x5b,
0x5a,0x5a,0x5a, 0x59,0x59,0x59, 0x58,0x58,0x58, 0x57,0x57,0x57,
0x56,0x56,0x56, 0x54,0x54,0x54, 0x53,0x53,0x53, 0x52,0x52,0x52,
0x51,0x51,0x51, 0x50,0x50,0x50, 0x4f,0x4f,0x4f, 0x4e,0x4e,0x4e,
0x4d,0x4d,0x4d, 0x4c,0x4c,0x4c, 0x4b,0x4b,0x4b, 0x4a,0x4a,0x4a,
0x49,0x49,0x49, 0x48,0x48,0x48, 0x47,0x47,0x47, 0x46,0x46,0x46,
0x45,0x45,0x45, 0x43,0x43,0x43, 0x42,0x42,0x42, 0x41,0x41,0x41,
0x40,0x40,0x40, 0x3f,0x3f,0x3f, 0x3e,0x3e,0x3e, 0x3d,0x3d,0x3d,
0x3c,0x3c,0x3c, 0x3b,0x3b,0x3b, 0x3a,0x3a,0x3a, 0x39,0x39,0x39,
0x38,0x38,0x38, 0x37,0x37,0x37, 0x36,0x36,0x36, 0x35,0x35,0x35,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x00,0xff,0xff, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x00,0xff,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x00,0x00,0xff, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0xdd,0x00,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0xd0,0x00,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x00,0xbb,0x00,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65,
0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0xbb,0xbb,0xbb,
0x65,0x65,0x65, 0x88,0x88,0x88, 0x77,0x77,0x77, 0x55,0x55,0x55,
branches/Chimera/i386/boot2/gui.h
3333
3434
3535
36
37
3638
3739
3840
3941
4042
43
44
4145
4246
4347
......
4953
5054
5155
56
57
5258
5359
5460
......
5763
5864
5965
66
67
6068
6169
6270
......
6775
6876
6977
78
79
7080
7181
7282
......
8696
8797
8898
89
99
100
101
90102
91103
92104
#define MENU_SHOW_VIDEO_INFO5
#define MENU_SHOW_HELP6
// ====================================================================
enum {
HorizontalLayout= 0,
VerticalLayout= 1,
};
// ====================================================================
/*
* Menu item structure.
*/
boolexpandable;
} menuitem_t;
// ====================================================================
/*
* Image structure.
*/
charname[32];
} image_t;
// ====================================================================
/*
* Font structure.
*/
uint16_tcount;// Number of chars in font
} font_t;
// ====================================================================
/*
* Window structure.
*/
uint32_tfont_console_color;// Color for consle font AARRGGBB
booldraw;// Draw flag
} window_t;
// ====================================================================
/*
* gui structure
*/
branches/Chimera/i386/boot2/lzss.c
6464
6565
6666
67
67
68
6869
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
109
110
111
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
109
110
111
112
112113
113
114
114115
115116
116117
......
231232
232233
233234
234
235
235236
236237
237238
238239
239
240
240241
241242
242243
243
244
244245
245246
246247
......
249250
250251
251252
252
253
253254
254255
255
256
256257
257258
258259
259260
260261
261
262
262263
263264
264265
......
266267
267268
268269
269
270
270271
271272
272273
......
302303
303304
304305
305
306
306307
307308
308309
309310
310311
311312
312
313
313314
314315
315316
316
317
317318
318319
319320
320321
321322
322
323
323324
324325
325326
......
328329
329330
330331
331
332
332333
333334
334335
......
336337
337338
338339
340
339341
340342
int match_position, match_length;
};
int decompress_lzss( u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srclen )
int
decompress_lzss( u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srclen )
{
/* ring buffer of size N, with extra F-1 bytes to aid string comparison */
u_int8_t text_buf[N + F - 1];
u_int8_t *dststart = dst;
u_int8_t *dstend = dst + dstlen;
u_int8_t *srcend = src + srclen;
int i, j, k, r, c;
unsigned int flags;
dst = dststart;
srcend = src + srclen;
for (i = 0; i < N - F; i++)
text_buf[i] = ' ';
r = N - F;
flags = 0;
for ( ; ; ) {
if (((flags >>= 1) & 0x100) == 0) {
if (src < srcend) c = *src++; else break;
flags = c | 0xFF00; /* uses higher byte cleverly */
} /* to count eight */
if (flags & 1) {
if (src < srcend) c = *src++; else break;
*dst++ = c;
if (dst >= dstend) {
goto finish;
}
text_buf[r++] = c;
r &= (N - 1);
} else {
if (src < srcend) i = *src++; else break;
if (src < srcend) j = *src++; else break;
i |= ((j & 0xF0) << 4);
j = (j & 0x0F) + THRESHOLD;
for (k = 0; k <= j; k++) {
c = text_buf[(i + k) & (N - 1)];
*dst++ = c;
if (dst >= dstend) {
goto finish;
}
text_buf[r++] = c;
r &= (N - 1);
}
}
}
/* ring buffer of size N, with extra F-1 bytes to aid string comparison */
u_int8_t text_buf[N + F - 1];
u_int8_t *dststart = dst;
u_int8_t *dstend = dst + dstlen;
u_int8_t *srcend = src + srclen;
int i, j, k, r, c;
unsigned int flags;
dst = dststart;
srcend = src + srclen;
for (i = 0; i < N - F; i++)
text_buf[i] = ' ';
r = N - F;
flags = 0;
for ( ; ; ) {
if (((flags >>= 1) & 0x100) == 0) {
if (src < srcend) c = *src++; else break;
flags = c | 0xFF00; /* uses higher byte cleverly */
} /* to count eight */
if (flags & 1) {
if (src < srcend) c = *src++; else break;
*dst++ = c;
if (dst >= dstend) {
goto finish;
}
text_buf[r++] = c;
r &= (N - 1);
} else {
if (src < srcend) i = *src++; else break;
if (src < srcend) j = *src++; else break;
i |= ((j & 0xF0) << 4);
j = (j & 0x0F) + THRESHOLD;
for (k = 0; k <= j; k++) {
c = text_buf[(i + k) & (N - 1)];
*dst++ = c;
if (dst >= dstend) {
goto finish;
}
text_buf[r++] = c;
r &= (N - 1);
}
}
}
finish:
return dst - dststart;
return dst - dststart;
}
/*
{
/* Encoding state, mostly tree but some current match stuff */
struct encode_state *sp;
int i, c, len, r, s, last_match_length, code_buf_ptr;
u_int8_t code_buf[17], mask;
u_int8_t *srcend = src + srclen;
u_int8_t *dstend = dst + dstlen;
/* initialize trees */
sp = (struct encode_state *) malloc(sizeof(*sp));
init_state(sp);
/*
* code_buf[1..16] saves eight units of code, and code_buf[0] works
* as eight flags, "1" representing that the unit is an unencoded
*/
code_buf[0] = 0;
code_buf_ptr = mask = 1;
/* Clear the buffer with any character that will appear often. */
s = 0; r = N - F;
/* Read F bytes into the last F bytes of the buffer */
for (len = 0; len < F && src < srcend; len++)
sp->text_buf[r + len] = *src++;
if (!len)
return (void *) 0; /* text of size zero */
/*
* Insert the F strings, each of which begins with one or more
* 'space' characters. Note the order in which these strings are
*/
for (i = 1; i <= F; i++)
insert_node(sp, r - i);
/*
* Finally, insert the whole string just read.
* The global variables match_length and match_position are set.
delete_node(sp, s); /* Delete old strings and */
c = *src++;
sp->text_buf[s] = c; /* read new bytes */
/*
* If the position is near the end of buffer, extend the buffer
* to make string comparison easier.
*/
if (s < F - 1)
sp->text_buf[s + N] = c;
/* Since this is a ring buffer, increment the position modulo N. */
s = (s + 1) & (N - 1);
r = (r + 1) & (N - 1);
/* Register the string in text_buf[r..r+F-1] */
insert_node(sp, r);
}
while (i++ < last_match_length) {
delete_node(sp, s);
/* After the end of text, no need to read, */
s = (s + 1) & (N - 1);
r = (r + 1) & (N - 1);
insert_node(sp, r);
}
} while (len > 0); /* until length of string to be processed is zero */
if (code_buf_ptr > 1) { /* Send remaining code. */
for (i = 0; i < code_buf_ptr; i++)
if (dst < dstend)
else
return (void *) 0;
}
return dst;
}
branches/Chimera/i386/boot2/options.c
192192
193193
194194
195
195
196
196197
197198
198199
......
10951096
10961097
10971098
1098
1099
1099
1100
11001101
11011102
1102
1103
11031104
1104
1105
11051106
1106
1107
1108
1109
1107
1108
1109
1110
11101111
1111
1112
1113
1114
1115
1116
1112
1113
1114
1115
1116
1117
1118
11171119
1118
1119
1120
1121
1120
1121
1122
1123
1124
11221125
1123
1124
1126
11251127
11261128
11271129
......
12161218
12171219
12181220
1219
1221
12201222
12211223
12221224
......
12281230
12291231
12301232
1233
1234
1235
1236
12311237
1232
1233
12341238
12351239
12361240
1237
1241
1242
1243
12381244
12391245
1240
1246
1247
1248
12411249
12421250
12431251
12441252
12451253
1246
1254
12471255
12481256
12491257
......
12821290
12831291
12841292
1285
1293
12861294
12871295
12881296
......
13091317
13101318
13111319
1312
1313
1314
1320
1321
1322
1323
1324
13151325
13161326
1317
1327
1328
1329
13181330
13191331
13201332
......
13891401
13901402
13911403
1392
1404
1405
1406
13931407
13941408
13951409
......
14811495
14821496
14831497
1484
1498
1499
1500
14851501
14861502
14871503
......
14931509
14941510
14951511
1496
1512
1513
14971514
14981515
14991516
15001517
15011518
15021519
1503
1520
1521
15041522
15051523
15061524
......
15271545
15281546
15291547
1530
1548
1549
15311550
1532
1551
1552
15331553
15341554
15351555
......
15381558
15391559
15401560
1541
1561
1562
1563
15421564
15431565
15441566
......
15461568
15471569
15481570
1549
1571
1572
15501573
15511574
15521575
......
15611584
15621585
15631586
1564
1587
1588
15651589
15661590
1567
1591
1592
1593
15681594
15691595
15701596
......
15771603
15781604
15791605
1580
1606
1607
15811608
1582
1609
1610
1611
15831612
15841613
15851614
gBootArgsPtr = gBootArgs;
memset(gBootArgs, '\0', BOOT_STRING_LEN);
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE)
{
clearGraphicBootPrompt();
}
execute_hook("ClearArgs", NULL, NULL, NULL, NULL);
bool copyArgument(const char *argName, const char *val, int cnt, char **argP, int *cntRemainingP)
{
int argLen = argName ? strlen(argName) : 0;
int len = argLen + cnt + 1; // +1 to account for space
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;
}
if (len > *cntRemainingP) {
error("Warning: boot arguments too long, truncating\n");
return false;
}
if (argName) {
strncpy( *argP, argName, argLen );
*argP += argLen;
*argP[0] = '=';
(*argP)++;
}
if (argName)
{
strncpy(*argP, argName, argLen);
*argP += argLen;
*argP[0] = '=';
(*argP)++;
}
strncpy( *argP, val, cnt );
*argP += cnt;
*argP[0] = ' ';
(*argP)++;
strncpy(*argP, val, cnt);
*argP += cnt;
*argP[0] = ' ';
(*argP)++;
*cntRemainingP -= len;
*cntRemainingP -= len;
return true;
return true;
}
//
// Load com.apple.Boot.plist from the selected volume
// and use its contents to override default bootConfig.
loadSystemConfig(&bootInfo->bootConfig);
loadSystemConfig(&bootInfo->bootConfig);
loadChameleonConfig(&bootInfo->chameleonConfig, NULL);
// Use the kernel name specified by the user, or fetch the name
gOverrideKernel = false;
if (( kernel = extractKernelName((char **)&cp) ))
{
strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) );
}
else
{
strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) );
} else {
if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) )
{
strlcpy( bootInfo->bootFile, val, cnt+1 );
} else {
}
else
{
if ((checkOSVersion("10.10"))) {
strlcpy( bootInfo->bootFile, kDefaultKernelYosemite, sizeof(bootInfo->bootFile) );
} else {
}
else
{
strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) );
}
}
}
if ((strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) && (strcmp( bootInfo->bootFile, kDefaultKernelYosemite ) != 0))
{
{
gOverrideKernel = true;
}
/*
// Try to get the volume uuid string
if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid)
{
{
gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString);
}
*/
cnt++;
strlcpy(valueBuffer + 1, val, cnt);
val = valueBuffer;
} else { /*
if (strlen(gBootUUIDString))
{
}
else
{ /*
if (strlen(gBootUUIDString))
{
val = "*uuid";
cnt = 5;
} else { */
}
else
{ */
// Don't set "rd=.." if there is no boot device key
// and no UUID.
val = "";
if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )
{
strlcpy(gMKextName, val, cnt + 1);
} else {
}
else
{
gMKextName[0]=0;
}
{
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);
}
}
intfd;
intsize;
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);
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;
// Overwrite with space without moving cursor position
putca(' ', 0x07, 1);
digitsI--;
} else {
}
else
{
// TODO: Beep or something
}
break;
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;
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;
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;
}
}
branches/Chimera/i386/config/confdata.c
1313
1414
1515
16
17
18
19
20
21
22
23
24
25
26
27
1628
1729
1830
......
101113
102114
103115
104
116
105117
106118
107119
......
118130
119131
120132
121
133
122134
123135
124136
#include <time.h>
#include <unistd.h>
char *
int_stpncpy (dst, src, len)
char *dst;
const char *src;
size_t len;
{
size_t n = strlen (src);
if (n > len)
n = len;
return strncpy (dst, src, len) + n;
}
#define LKC_DIRECT_LINK
#include "lkc.h"
char *name_ptr = name;
size_t n = min(res_rem, src - in);
res_ptr = stpncpy(res_ptr, in, n);
res_ptr = int_stpncpy(res_ptr, in, n);
if (!(res_rem -= n)) {
return res_value; /* buffer full, quit now */
}
symval = sym_get_string_value(sym);
n = min(res_rem, strlen(symval));
res_ptr = stpncpy(res_ptr, symval, n);
res_ptr = int_stpncpy(res_ptr, symval, n);
if (!(res_rem -= n)) {
return res_value; /* buffer full, quit now */
}
branches/Chimera/i386/config/textbox.c
320320
321321
322322
323
324323
325324
326325
......
329328
330329
331330
332
333331
334332
333
335334
336335
337336
*/
static void print_line(WINDOW * win, int row, int width)
{
int y, x;
char *line;
line = get_line();
waddch(win, ' ');
waddnstr(win, line, MIN(strlen(line), width - 2));
getyx(win, y, x);
/* Clear 'residue' of previous line */
#if OLD_NCURSES
getyx(win, y, x);
{
int i;
for (i = 0; i < width - x; i++)
branches/Chimera/i386/modules/KernelPatcher/Makefile
11
2
23
3
4
4
55
66
77
......
1313
1414
1515
16
16
1717
1818
1919
MODULE_NAME = KernelPatcher
MODULE_DESCRIPTION = Kernel patcher
MODULE_AUTHOR = Evan Lojewski
MODULE_DESCRIPTION = Kernel patcher
MODULE_VERSION = "1.1.0"
MODULE_VERSION = "1.1.3"
MODULE_COMPAT_VERSION = "1.0.0"
MODULE_START = $(MODULE_NAME)_start
MODULE_DEPENDENCIES =
include ../MakeInc.dir
$(SYMROOT)/modules/$(MODULE_NAME).dylib:
@echo "\t[CP] $(MODULE_NAME).dylib"
@echo "[[CP] $(MODULE_NAME).dylib"
@cp $(MODULE_NAME).dylib $(SRCROOT)/sym/i386/modules/$(MODULE_NAME).dylib
$(SRCROOT)/sym/i386/boot_modules.c:
branches/Chimera/i386/modules/AcpiCodec/acpi_codec.c
196196
197197
198198
199
200
199
200
201
201202
202203
203204
return entry;\
}
__RES(pss, long)
__RES(cst, int)
#if UNUSED
__RES(cst, int)
#endif /* UNUSED */
static ACPI_TABLE_HEADER * get_new_table_in_list(U32 *new_table_list, U32 Signature, U8 *retIndex )
{
branches/Chimera/i386/cdboot/Makefile
1616
1717
1818
19
19
2020
2121
2222
......
2626
2727
2828
29
29
3030
all embedtheme optionrom: $(DIRS_NEEDED) $(SYMROOT)/cdboot
$(SYMROOT)/cdboot:
@echo "\t[NASM] cdboot.s"
@echo "[NASM] cdboot.s"
@$(NASM) cdboot.s -o $(SYMROOT)/cdboot
@dd if=$(SYMROOT)/boot of=$(SYMROOT)/cdboot conv=sync bs=2k seek=1 &> /dev/null
| dd of=$(SYMROOT)/cdboot bs=1 count=4 seek=2044 conv=notrunc &> /dev/null
clean-local:
@if [ -f "$(SYMROOT)/cdboot" ];then echo "\t[RM] $(SYMROOT)/cdboot"; fi
@if [ -f "$(SYMROOT)/cdboot" ];then echo "[RM] $(SYMROOT)/cdboot"; fi
@rm -f $(SYMROOT)/cdboot
branches/Chimera/i386/libsa/zalloc.c
5757
5858
5959
60
60
6161
6262
6363
......
7878
7979
8080
81
81
82
8283
8384
8485
......
108109
109110
110111
111
112
112
113
114
115
113116
114117
115118
......
155158
156159
157160
158
161
162
159163
160164
161165
162166
163
167
168
164169
165170
166171
......
186191
187192
188193
189
194
195
190196
191197
192198
......
207213
208214
209215
210
211
216
217
218
219
212220
213221
214222
......
218226
219227
220228
221
229
230
222231
223232
224233
......
227236
228237
229238
230
239
240
231241
232242
233243
234244
235245
236
237
238
246
247
248
249
250
251
239252
240253
241254
......
246259
247260
248261
249
250
262
263
264
265
251266
252267
253268
......
270285
271286
272287
273
274
288
289
290
291
275292
276293
277294
......
287304
288305
289306
290
307
308
291309
292310
293311
......
301319
302320
303321
304
322
323
305324
306325
307326
......
311330
312331
313332
314
315
333
334
335
336
316337
317338
318339
static void zcoalesce(void);
#if ZDEBUG
size_t zalloced_size;
size_t zalloced_size;
#endif
#define ZALLOC_NODES32767 /* was 16384 */
zavailable = (zmem *) zalloc_base + sizeof(zmem) * totalNodes;
zavailable[0].start = (char *)zavailable + sizeof(zmem) * totalNodes;
if (size == 0) {
if (size == 0)
{
size = ZALLOC_LEN;
}
size = ((size + 0xf) & ~0xf);
if (size == 0) {
if (zerror) {
if (size == 0)
{
if (zerror)
{
(*zerror)((char *)0xdeadbeef, 0, file, line);
}
}
done:
if ((ret == 0) || (ret + size >= zalloc_end)) {
if (zerror) {
if (zerror)
{
(*zerror)(ret, size, file, line);
}
}
if (ret != 0) {
if (ret != 0)
{
bzero(ret, size);
}
#if ZDEBUG
rp = 0;
#endif
if (!start) {
if (!start)
{
return;
}
break;
}
}
if (!found) {
if (zerror) {
if (!found)
{
if (zerror)
{
(*zerror)(pointer, rp, "free", 0);
} else {
return;
zalloced_size -= tsize;
#endif
for (i = 0; i < availableNodes; i++) {
for (i = 0; i < availableNodes; i++)
{
if ((start + tsize) == zavailable[i].start) // merge it in
{
zavailable[i].start = start;
return;
}
if ((i > 0) && (zavailable[i-1].start + zavailable[i-1].size == start)) {
if ((i > 0) && (zavailable[i-1].start + zavailable[i-1].size == start))
{
zavailable[i-1].size += tsize;
zcoalesce();
return;
}
if ((start + tsize) < zavailable[i].start) {
if (++availableNodes > totalNodes) {
if (zerror) {
if ((start + tsize) < zavailable[i].start)
{
if (++availableNodes > totalNodes)
{
if (zerror)
{
(*zerror)((char *)0xf000f000, 0, "free", 0);
}
}
}
}
if (++availableNodes > totalNodes) {
if (zerror) {
if (++availableNodes > totalNodes)
{
if (zerror)
{
(*zerror)((char *)0xf000f000, 1, "free", 0);
}
}
zalloced[allocedNodes].start = start;
zalloced[allocedNodes].size = size;
if (++allocedNodes > totalNodes) {
if (zerror) {
if (++allocedNodes > totalNodes)
{
if (zerror)
{
(*zerror)((char *)0xf000f000, 2, "zallocate", 0);
}
};
z1 = zp + i;
z2 = z1 + 1;
for (; i >= ndx; i--, z1--, z2--) {
for (; i >= ndx; i--, z1--, z2--)
{
*z2 = *z1;
}
}
z1 = zp + ndx;
z2 = z1 + 1;
for (i = ndx; i < totalNodes - 1; i++, z1++, z2++) {
for (i = ndx; i < totalNodes - 1; i++, z1++, z2++)
{
*z1 = *z2;
}
}
{
int i;
for (i = 0; i < availableNodes-1; i++) {
if ( zavailable[i].start + zavailable[i].size == zavailable[i + 1].start ) {
for (i = 0; i < availableNodes-1; i++)
{
if ( zavailable[i].start + zavailable[i].size == zavailable[i + 1].start )
{
zavailable[i].size += zavailable[i + 1].size;
zdelete(zavailable, i + 1); availableNodes--;
return;
branches/Chimera/i386/libsa/Makefile
3636
3737
3838
39
39
4040
41
41
4242
43
43
4444
4545
4646
4747
4848
4949
50
51
50
51
5252
$(LIBS): $(OBJS)
@echo "\t[RM] $@"
@echo "[RM] $@"
@rm -f $@
@echo "\t[AR] $(@F)"
@echo "[AR] $(@F)"
@ar q $@ $^ &> /dev/null
@echo "\t[RANLIB] $(@F)"
@echo "[RANLIB] $(@F)"
@ranlib $@
# dependencies
-include $(OBJROOT)/Makedep
clean-local:
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done
@for l in $(LIBS); do if [ -f "$${l}" ];then echo "\t[RM] $${l}"; fi; done
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "[RM] $${o}"; fi; done
@for l in $(LIBS); do if [ -f "$${l}" ];then echo "[RM] $${l}"; fi; done
@rm -f $(LIBS) $(OBJS)
branches/Chimera/i386/util/Makefile
1212
1313
1414
15
1615
1716
1817
......
4342
4443
4544
46
45
4746
48
47
4948
50
49
5150
5251
5352
......
5554
5655
5756
58
59
57
58
6059
IMGSKELROOT = $(SRCROOT)/imgskel
CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot
DIR = util
include ${SRCROOT}/Make.rules
all: $(DIRS_NEEDED) $(SYMPROG) all-recursive
$(SYMPROG): $(OBJS)
@echo "\t[LD32] $(@F)_32"
@echo " [LD32] $(@F)_32"
@$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32
@echo "\t[LD64] $(@F)_64"
@echo " [LD64] $(@F)_64"
@$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64
@echo "\t[LIPO] $(@F)"
@echo " [LIPO] $(@F)"
@lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 -output $(SYMROOT)/$(@F)
@$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64
-include $(OBJROOT)/Makedep
clean-local:
@for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done
@for p in $(SYMPROG); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done
@for o in $(OBJS); do if [ -f "$${o}" ];then echo " [RM] $${o}"; fi; done
@for p in $(SYMPROG); do if [ -f "$${p}" ];then echo " [RM] $${p}"; fi; done
@rm -f $(SYMPROG) $(OBJS)
branches/Chimera/Chimera 4.1.0 Changes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Chimera 4.0.0 includes:
Used Chameleon 2.2 r2421 as the code base and incorporated any changes that didn't break Chimera 4.0.1 enhancements
Added Broadwell CPU and IGP support.
Added addition LPC device IDs in spd.c
Files edited:
i386/boot2/options.c
i386/boot2/prompt.c
i386/libsaio/acpi_patcher.c
i386/libsaio/aml_generator.c
i386/libsaio/ati.c
i386/libsaio/ati.h
i386/libsaio/bootargs.h
i386/libsaio/bootstruct.c
i386/libsaio/bootstruct.h
i386/libsaio/console.c
i386/libsaio/device_inject.c
i386/libsaio/device_tree.c
i386/libsaio/device_tree.h
i386/libsaio/disk.c
i386/libsaio/dram_controllers.c
i386/libsaio/efi.h
i386/libsaio/fake_efi.c
i386/libsaio/hda.c
i386/libsaio/load.c
i386/libsaio/md5c.c
i386/libsaio/nvidia.c
i386/libsaio/platform.h
i386/libsaio/saio_internal.h
i386/libsaio/saio_types.h
i386/libsaio/smbios_decode.c
i386/libsaio/smbios_getters.c
i386/libsaio/smbios_getters.h
i386/libsaio/smbios.c
i386/libsaio/smbios.h
i386/libsaio/spd.c
i386/libsaio/stringTable.c
i386/libsaio/sys.c
i386/libsaio/vbe.c
Make.rules Changed to add -Wno-unused-const-variable to CFLAGS

Archive Download the corresponding diff file

Revision: 2658