Index: branches/azimutz/trunkAutoResolution/i386/libsaio/console.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/console.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/console.c (revision 1007) @@ -67,14 +67,14 @@ 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) @@ -263,5 +263,6 @@ 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() ?? } Index: branches/azimutz/trunkAutoResolution/i386/libsaio/bootstruct.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/bootstruct.h (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/bootstruct.h (revision 1007) @@ -137,6 +137,8 @@ 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; Index: branches/azimutz/trunkAutoResolution/i386/libsaio/acpi_patcher.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/acpi_patcher.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/acpi_patcher.c (revision 1007) @@ -1058,7 +1058,7 @@ } #if DEBUG_ACPI printf("Press a key to continue... (DEBUG_ACPI)\n"); - getc(); + getchar(); #endif return 1; } Index: branches/azimutz/trunkAutoResolution/i386/libsaio/spd.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/spd.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/spd.c (revision 1007) @@ -344,8 +344,9 @@ 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 } Index: branches/azimutz/trunkAutoResolution/i386/libsaio/usb.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/usb.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/usb.c (revision 1007) @@ -107,7 +107,7 @@ { // 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_t capaddr, opaddr; uint8_t eecp; Index: branches/azimutz/trunkAutoResolution/i386/libsaio/dram_controllers.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/dram_controllers.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/dram_controllers.c (revision 1007) @@ -557,7 +557,6 @@ ,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(); } } Index: branches/azimutz/trunkAutoResolution/i386/libsaio/nvidia.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/nvidia.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/nvidia.c (revision 1007) @@ -1371,7 +1371,12 @@ 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)); } Index: branches/azimutz/trunkAutoResolution/i386/libsaio/load.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/load.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/load.c (revision 1007) @@ -135,7 +135,7 @@ 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; @@ -213,7 +213,14 @@ 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 { @@ -226,7 +233,14 @@ 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) { @@ -235,13 +249,6 @@ 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 && @@ -310,7 +317,7 @@ #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; Index: branches/azimutz/trunkAutoResolution/i386/libsaio/platform.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/platform.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/platform.c (revision 1007) @@ -41,11 +41,16 @@ 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); Index: branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c (revision 1007) @@ -1636,7 +1636,7 @@ 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; Index: branches/azimutz/trunkAutoResolution/i386/libsaio/smbios.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/smbios.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/smbios.c (revision 1007) @@ -448,6 +448,8 @@ { const char *string = 0; int len; + bool parsed; + int val; if (numOfSetters <= idx) return false; @@ -481,13 +483,29 @@ //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; Index: branches/azimutz/trunkAutoResolution/i386/libsaio/hpet.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/hpet.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/hpet.c (revision 1007) @@ -98,6 +98,6 @@ #if DEBUG_HPET printf("Press [Enter] to continue...\n"); - getc(); + getchar(); #endif } Index: branches/azimutz/trunkAutoResolution/i386/libsaio/biosfn.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/biosfn.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/biosfn.c (revision 1007) @@ -39,9 +39,11 @@ 2007-12-29 dfe - Added ebiosEjectMedia */ + #include "bootstruct.h" #include "libsaio.h" + #define MAX_DRIVES 8 static biosBuf_t bb; @@ -183,7 +185,7 @@ // 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)); } @@ -250,10 +252,10 @@ #if DEBUG { int i; - printf("%d total ranges\n", count);getc(); + printf("%d total ranges\n", count); getchar(); for (i=0, range = rangeArray; itype, (unsigned int)range->base, (unsigned int)range->length); getc(); + range->type, (unsigned int)range->base, (unsigned int)range->length); getchar(); } } #endif @@ -507,7 +509,7 @@ 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 */ @@ -673,7 +675,7 @@ 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) { Index: branches/azimutz/trunkAutoResolution/i386/libsaio/smbios_getters.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/smbios_getters.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/smbios_getters.c (revision 1007) @@ -6,6 +6,7 @@ */ #include "smbios_getters.h" +#include "bootstruct.h" #ifndef DEBUG_SMBIOS #define DEBUG_SMBIOS 0 @@ -245,9 +246,10 @@ } } - return false; -// value->string = NOT_AVAILABLE; -// return true; + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; } bool getSMBMemoryDeviceSerialNumber(returnType *value) @@ -267,9 +269,10 @@ } } - return false; -// value->string = NOT_AVAILABLE; -// return true; + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; } bool getSMBMemoryDevicePartNumber(returnType *value) @@ -289,9 +292,10 @@ } } - return false; -// value->string = NOT_AVAILABLE; -// return true; + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; } Index: branches/azimutz/trunkAutoResolution/i386/boot2/drivers.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/boot2/drivers.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/boot2/drivers.c (revision 1007) @@ -183,7 +183,7 @@ } 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 @@ -222,33 +222,33 @@ } } - + //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 Index: branches/azimutz/trunkAutoResolution/i386/boot2/boot.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/boot2/boot.h (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/boot2/boot.h (revision 1007) @@ -38,9 +38,12 @@ #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" @@ -68,16 +71,9 @@ #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 */ @@ -85,31 +81,32 @@ #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 */ Index: branches/azimutz/trunkAutoResolution/i386/libsa/printf.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsa/printf.c (revision 1006) +++ branches/azimutz/trunkAutoResolution/i386/libsa/printf.c (revision 1007) @@ -28,14 +28,14 @@ #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) {