Chameleon

Chameleon Commit Details

Date:2011-06-13 21:36:21 (8 years 1 month ago)
Author:Azimutz
Commit:1007
Parents: 1006
Message:Sync with trunk r1005. Includes some edits to boot.h & drivers.c, to be merged with trunk later. Still doomed by mergeinfo; every time i try to merge from the trunk i get this beauty: svn:mergeinfo /branches/rekursor/trunkAutoResolution:3-22 <--- wonderful :P /trunk:945-1006 Had to resort to diff; i have the feeling it's not over yet... Don't do this at home, kids :)
Changes:
M/branches/azimutz/trunkAutoResolution/i386/libsaio/smbios.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/hpet.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/console.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/dram_controllers.c
M/branches/azimutz/trunkAutoResolution/i386/libsa/printf.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/nvidia.c
M/branches/azimutz/trunkAutoResolution/i386/boot2/boot.h
M/branches/azimutz/trunkAutoResolution/i386/libsaio/bootstruct.h
M/branches/azimutz/trunkAutoResolution/i386/libsaio/load.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/biosfn.c
M/branches/azimutz/trunkAutoResolution/i386/boot2/drivers.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/acpi_patcher.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/platform.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/spd.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/usb.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/smbios_getters.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c

File differences

branches/azimutz/trunkAutoResolution/i386/libsaio/console.c
6767
6868
6969
70
70
7171
7272
7373
7474
7575
7676
77
77
7878
7979
8080
......
263263
264264
265265
266
266
267
267268
char *msgbuf = 0;
char *cursor = 0;
struct putc_info
struct putc_info //Azi: exists on gui.c & printf.c
{
char * str;
char * last_str;
};
static int
sputc(int c, struct putc_info * pi)
sputc(int c, struct putc_info * pi) //Azi: same as above
{
if (pi->last_str)
if (pi->str == pi->last_str)
void pause()
{
printf("Press a key to continue...\n");
getc();
getchar(); //getc(); //Azi: getc works here because the function is up above; changed for now.
// replace getchar() by pause() ??
}
branches/azimutz/trunkAutoResolution/i386/libsaio/bootstruct.h
137137
138138
139139
140
141
140142
141143
142144
config_file_t smbiosConfig; // smbios.plist
config_file_t helperConfig; // boot helper partition's boot.plist
config_file_t ramdiskConfig; // RAMDisk.plist
bool memDetect;
} PrivateBootInfo_t;
extern PrivateBootInfo_t *bootInfo;
branches/azimutz/trunkAutoResolution/i386/libsaio/acpi_patcher.c
10581058
10591059
10601060
1061
1061
10621062
10631063
10641064
}
#if DEBUG_ACPI
printf("Press a key to continue... (DEBUG_ACPI)\n");
getc();
getchar();
#endif
return 1;
}
branches/azimutz/trunkAutoResolution/i386/libsaio/spd.c
344344
345345
346346
347
348
347
348
349
349350
350351
351352
slot->SerialNo);
#if DEBUG_SPD
dumpPhysAddr("spd content: ", slot->spd, spd_size);
getc();
//Azi: this was gone with mem.c... remove??
dumpPhysAddr("spd content: ", slot->spd, spd_size);
getchar();
#endif
}
branches/azimutz/trunkAutoResolution/i386/libsaio/usb.c
107107
108108
109109
110
110
111111
112112
113113
{
// Set usb legacy off modification by Signal64
// NOTE: This *must* be called after the last file is loaded from the drive in the event that we are booting form usb.
// NOTE2: This should be called after any getc() call. (aka, after the Wait=y keyworkd is used)
// NOTE2: This should be called after any getc()/getchar() call. (aka, after the Wait=y keyworkd is used)
// AKA: Make this run immediatly before the kernel is called
uint32_tcapaddr, opaddr;
uint8_teecp;
branches/azimutz/trunkAutoResolution/i386/libsaio/dram_controllers.c
557557
558558
559559
560
561
560
562561
563562
,Platform.RAM.CAS, Platform.RAM.TRC, Platform.RAM.TRP, Platform.RAM.RAS
,Platform.RAM.CAS, Platform.RAM.TRC, Platform.RAM.TRP, Platform.RAM.RAS
);
/* getc();
*/
//getchar();
}
}
branches/azimutz/trunkAutoResolution/i386/libsaio/nvidia.c
13711371
13721372
13731373
1374
1374
1375
1376
1377
1378
1379
13751380
13761381
13771382
devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN);
devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN);
//add HDMI Audio back to nvidia
//http://forge.voodooprojects.org/p/chameleon/issues/67/
// uint8_t connector_type_1[]= {0x00, 0x08, 0x00, 0x00};
// devprop_add_value(device, "@1,connector-type",connector_type_1, 4);
//end Nvidia HDMI Audio
if (getBoolForKey(kVBIOS, &doit, &bootInfo->bootConfig) && doit) {
devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512));
}
branches/azimutz/trunkAutoResolution/i386/libsaio/load.c
135135
136136
137137
138
138
139139
140140
141141
......
213213
214214
215215
216
216
217
218
219
220
221
222
223
217224
218225
219226
......
226233
227234
228235
229
236
237
238
239
240
241
242
243
230244
231245
232246
......
235249
236250
237251
238
239
240
241
242
243
244
245252
246253
247254
......
310317
311318
312319
313
320
314321
315322
316323
printf("ncmds: %x\n", (unsigned)mH->ncmds);
printf("sizeofcmds: %x\n", (unsigned)mH->sizeofcmds);
printf("flags: %x\n", (unsigned)mH->flags);
getc();
getchar();
#endif
ncmds = mH->ncmds;
fileaddr = (gBinaryAddress + segCmd->fileoff);
filesize = segCmd->filesize;
segname=segCmd->segname;
segname=segCmd->segname;
#ifdef DEBUG
printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n",
segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize,
(unsigned) segCmd->nsects, (unsigned)segCmd->flags);
getchar();
#endif
}
else
{
fileaddr = (gBinaryAddress + segCmd->fileoff);
filesize = segCmd->filesize;
segname=segCmd->segname;
segname=segCmd->segname;
#ifdef DEBUG
printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n",
segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize,
(unsigned) segCmd->nsects, (unsigned)segCmd->flags);
getchar();
#endif
}
if (vmsize == 0 || filesize == 0) {
return 0;
}
#if DEBUG
printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n",
segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize,
(unsigned) segCmd->nsects, (unsigned)segCmd->flags);
getc();
#endif
if (! ((vmaddr >= KERNEL_ADDR &&
(vmaddr + vmsize) <= (KERNEL_ADDR + KERNEL_LEN)) ||
(vmaddr >= HIB_ADDR &&
#if DEBUG
printf("symoff: %x, nsyms: %x, stroff: %x, strsize: %x\n",
symTab->symoff, symTab->nsyms, symTab->stroff, symTab->strsize);
getc ();
getchar();
#endif
symsSize = symTab->stroff - symTab->symoff;
branches/azimutz/trunkAutoResolution/i386/libsaio/platform.c
4141
4242
4343
44
45
44
45
46
47
48
49
50
4651
47
48
52
53
4954
5055
5156
static bool done = false;
if (done) return;
bool useAutodetection = true;
getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig);
/* our code only works on Intel chipsets so make sure here */
if (pci_config_read16(PCIADDR(0, 0x00, 0), 0x00) != 0x8086)
bootInfo->memDetect = false;
else
bootInfo->memDetect = true;
/* manually */
getBoolForKey(kUseMemDetect, &bootInfo->memDetect, &bootInfo->bootConfig);
if (useAutodetection) {
if (dram_controller_dev!=NULL) {
if (bootInfo->memDetect) {
if (dram_controller_dev != NULL) {
scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ...
}
scan_spd(&Platform);
branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c
16361636
16371637
16381638
1639
1639
16401640
16411641
16421642
printf(" bvr: %d, dev: %d, part: %d, flags: %d, vis: %d\n", bvr, bvr->biosdev, bvr->part_no, bvr->flags, bvr->visible);
}
printf("count: %d\n", bvCount);
getc();
getchar();
#endif
*count = bvCount;
branches/azimutz/trunkAutoResolution/i386/libsaio/smbios.c
448448
449449
450450
451
452
451453
452454
453455
......
481483
482484
483485
484
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
485505
486
487
488
489
506
490507
508
491509
492510
493511
{
const char *string = 0;
int len;
bool parsed;
int val;
if (numOfSetters <= idx)
return false;
//case kSMBQWord:
if (SMBSetters[idx].keyString)
{
if (getIntForKey(SMBSetters[idx].keyString, (int *)&(value->dword), SMBPlist))
parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist);
if (!parsed)
if (structPtr->orig->type == kSMBTypeMemoryDevice)// MemoryDevice only
parsed = getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, NULL, (returnType *)&val);
if (parsed)
{
switch (SMBSetters[idx].valueType)
{
case kSMBByte:
value->byte = (uint8_t)val;
break;
case kSMBWord:
value->word = (uint16_t)val;
break;
case kSMBDWord:
default:
value->dword = (uint32_t)val;
break;
}
return true;
else
if (structPtr->orig->type == kSMBTypeMemoryDevice)// MemoryDevice only
if (getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, NULL, value))
return true;
}
}
if (SMBSetters[idx].getSMBValue)
if (SMBSetters[idx].getSMBValue(value))
return true;
branches/azimutz/trunkAutoResolution/i386/libsaio/hpet.c
9898
9999
100100
101
101
102102
103103
#if DEBUG_HPET
printf("Press [Enter] to continue...\n");
getc();
getchar();
#endif
}
branches/azimutz/trunkAutoResolution/i386/libsaio/biosfn.c
3939
4040
4141
42
4243
4344
4445
46
4547
4648
4749
......
183185
184186
185187
186
188
187189
188190
189191
......
250252
251253
252254
253
255
254256
255257
256
258
257259
258260
259261
......
507509
508510
509511
510
512
511513
512514
513515
......
673675
674676
675677
676
678
677679
678680
679681
2007-12-29 dfe
- Added ebiosEjectMedia
*/
#include "bootstruct.h"
#include "libsaio.h"
#define MAX_DRIVES 8
static biosBuf_t bb;
// Some BIOSes will simply ignore the value of ECX on entry.
// Probably best to keep its value at 20 to avoid surprises.
//printf("Get memory map 0x%x, %d\n", rangeArray);getc();
//printf("Get memory map 0x%x, %d\n", rangeArray); getchar();
if (maxRangeCount > (BIOS_LEN / sizeof(MemoryRange))) {
maxRangeCount = (BIOS_LEN / sizeof(MemoryRange));
}
#if DEBUG
{
int i;
printf("%d total ranges\n", count);getc();
printf("%d total ranges\n", count); getchar();
for (i=0, range = rangeArray; i<count; i++, range++) {
printf("range: type %d, base 0x%x, length 0x%x\n",
range->type, (unsigned int)range->base, (unsigned int)range->length); getc();
range->type, (unsigned int)range->base, (unsigned int)range->length); getchar();
}
}
#endif
printf("media_type: %x\n", pkt.media_type);
printf("drive_num: %x\n", pkt.drive_num);
printf("device_spec: %x\n", pkt.device_spec);
printf("press a key->\n");getc();
printf("press a key->\n"); getchar();
#endif
/* Some BIOSes erroneously return cf = 1 */
print_drive_info(di);
printf("uses_ebios = 0x%x\n", dp->uses_ebios);
printf("result %d\n", ret);
printf("press a key->\n");getc();
printf("press a key->\n"); getchar();
#endif
if (ret == 0) {
branches/azimutz/trunkAutoResolution/i386/libsaio/smbios_getters.c
66
77
88
9
910
1011
1112
......
245246
246247
247248
248
249
250
249
250
251
252
251253
252254
253255
......
267269
268270
269271
270
271
272
272
273
274
275
273276
274277
275278
......
289292
290293
291294
292
293
294
295
296
297
298
295299
296300
297301
*/
#include "smbios_getters.h"
#include "bootstruct.h"
#ifndef DEBUG_SMBIOS
#define DEBUG_SMBIOS 0
}
}
return false;
//value->string = NOT_AVAILABLE;
//return true;
if (!bootInfo->memDetect)
return false;
value->string = NOT_AVAILABLE;
return true;
}
bool getSMBMemoryDeviceSerialNumber(returnType *value)
}
}
return false;
//value->string = NOT_AVAILABLE;
//return true;
if (!bootInfo->memDetect)
return false;
value->string = NOT_AVAILABLE;
return true;
}
bool getSMBMemoryDevicePartNumber(returnType *value)
}
}
return false;
//value->string = NOT_AVAILABLE;
//return true;
if (!bootInfo->memDetect)
return false;
value->string = NOT_AVAILABLE;
return true;
}
branches/azimutz/trunkAutoResolution/i386/boot2/drivers.c
183183
184184
185185
186
186
187187
188188
189189
......
222222
223223
224224
225
226225
226
227227
228228
229229
230
231
230
231
232232
233
233
234234
235235
236236
237237
238
239
240
241
242
243
244
245
246
247
248
249
238
239
240
241
242
243
244
245
246
247
248
249
250
250251
251
252252
253253
254254
}
else if ( gBootFileType == kBlockDeviceType )
{
if(!gHaveKernelCache)
if (!gHaveKernelCache)
{
// Non-prelinked kernel, load system mkext.
// NOTE: In it's default state, XNU cannot be both prelinked, and load additional drivers
}
}
//Azi: dependencies still need to be added to E/E.mkext!!
// First try to load Extra extensions from the ramdisk if isn't aliased as bt(0,0).
if (gRAMDiskVolume && !gRAMDiskBTAliased)
{
strcpy(dirSpecExtra, "rd(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
strcpy(dirSpecExtra, "rd(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
// Next try to load Extra extensions from the selected root partition.
strcpy(dirSpecExtra, "/Extra/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// If failed, then try to load Extra extensions from the boot partition
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
// If failed, then try to load Extra extensions from the boot partition
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
}
}
else
branches/azimutz/trunkAutoResolution/i386/boot2/boot.h
3838
3939
4040
41
42
4143
4244
4345
46
4447
4548
4649
......
6871
6972
7073
71
72
73
74
7574
7675
7776
78
79
80
8177
8278
8379
......
8581
8682
8783
84
8885
8986
87
9088
9189
9290
91
92
93
94
95
96
97
98
9399
94100
95101
96102
97103
98
99
100
101104
102105
103106
104107
105
106
107108
108109
109
110
111
112
113110
114111
115112
#define kTextModeKey"Text Mode"
#define kQuietBootKey"Quiet Boot"
#define kKernelFlagsKey"Kernel Flags"
#define karch"arch"/* boot.c */
#define kProductVersion"ProductVersion"/* boot.c */
#define kMKextCacheKey"MKext Cache"
#define kKernelNameKey"Kernel"
#define kKernelCacheKey"Kernel Cache"
#define kUseKernelCache"UseKernelCache"/* boot.c */
#define kBootDeviceKey"Boot Device"
#define kTimeoutKey"Timeout"
#define kRootDeviceKey"rd"
#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
#define kUseAtiROM"UseAtiROM"/* ati.c */
#define kAtiConfig"AtiConfig"/* ati.c */
#define kATYbinimage"ATYbinimage"/* ati.c */
#define kWake"Wake"/* boot.c */
#define kForceWake"ForceWake"/* boot.c */
#define kWakeImage"WakeImage"/* boot.c */
#define kProductVersion"ProductVersion"/* boot.c */
#define karch"arch"/* boot.c */
#define kUseKernelCache"UseKernelCache"/* boot.c */
#define kbusratio"busratio"/* cpu.c */
#define kHidePartition"Hide Partition"/* disk.c */
#define kRenamePartition"Rename Partition"/* disk.c */
#define kDefaultPartition"Default Partition"/* sys.c */
#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
#define kSystemID"SystemId"/* fake_efi.c */
#define kSystemType"SystemType"/* fake_efi.c */
#define kUseMemDetect"UseMemDetect" /* platform.c */
#define kPCIRootUID"PCIRootUID"/* pci_root.c */
#define kUseAtiROM"UseAtiROM"/* ati.c */
#define kAtiConfig"AtiConfig"/* ati.c */
#define kATYbinimage"ATYbinimage"/* ati.c */
#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
#define kVBIOS"VBIOS"/* nvidia.c */
#define kdcfg0 "display_0"/* nvidia.c */
#define kdcfg1 "display_1"/* nvidia.c */
#define kPCIRootUID"PCIRootUID"/* pci_root.c */
#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
#define kForceHPET"ForceHPET"/* pci_setup.c */
#define kUseMemDetect"UseMemDetect" /* platform.c */
#define kMD0Image"md0"/* ramdisk.h */
#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
#define kDefaultPartition"Default Partition"/* sys.c */
#define kUSBBusFix"USBBusFix"/* usb.c */
#define kEHCIacquire"EHCIacquire"/* usb.c */
#define kUHCIreset"UHCIreset"/* usb.c */
branches/azimutz/trunkAutoResolution/i386/libsa/printf.c
2828
2929
3030
31
31
3232
3333
3434
3535
3636
3737
38
38
3939
4040
4141
#include "libsa.h"
struct putc_info //Azi: same as below
struct putc_info //Azi: exists on console.c & gui.c
{
char * str;
char * last_str;
};
static int
sputc(int c, struct putc_info * pi) //Azi: exists on console.c & gui.c
sputc(int c, struct putc_info * pi) //Azi: same as above
{
if (pi->last_str)
if (pi->str == pi->last_str) {

Archive Download the corresponding diff file

Revision: 1007