Index: branches/ErmaC/Enoch/i386/libsaio/fake_efi.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/fake_efi.c (revision 2817) +++ branches/ErmaC/Enoch/i386/libsaio/fake_efi.c (revision 2818) @@ -718,7 +718,7 @@ // Pike R. Alpha - 12 October 2014 // UInt8 index = 0; - EFI_UINT16 PMTimerValue = 0; + EFI_UINT16 PMTimerValue = 0, PMRepeatCount = 0xffff; #if RANDOMSEED EFI_UINT32 randomValue = 0, cpuTick = 0; @@ -772,8 +772,18 @@ if (esi < ecx) // cmp %ecx, %esi { + /* + * This is a workaround to prevent an infinite loop + * if PMTimer is not at port 0x408 - zenith432 + */ + if (PMRepeatCount) + { + --PMRepeatCount; continue; // jb 0x17e55 (retry) + } } + else + PMRepeatCount = 0xffff; cpuTick = (EFI_UINT32) getCPUTick(); // callq 0x121a7 // printf("value: 0x%x\n", getCPUTick()); Index: branches/ErmaC/Enoch/i386/boot2/boot.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/boot.c (revision 2817) +++ branches/ErmaC/Enoch/i386/boot2/boot.c (revision 2818) @@ -140,6 +140,10 @@ malloc_init(0, 0, 0, malloc_error); } +// ========================================================================= + + + //========================================================================== // ExecKernel - Load the kernel image (mach-o) and jump to its entry point. @@ -189,7 +193,7 @@ if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan and Up! { // ErmaC - int crsValue; + int csrValue; #if 0 /* @@ -208,15 +212,16 @@ bootArgs->flags |= kBootArgsFlagCSRActiveConfig; // Set limit to 7bit - if ( getIntForKey(kCsrActiveConfig, &crsValue, &bootInfo->chameleonConfig) && (crsValue >= 0 && crsValue <= 127) ) + if ( getIntForKey(kCsrActiveConfig, &csrValue, &bootInfo->chameleonConfig) && (csrValue >= 0 && csrValue <= 127) ) { - bootArgs->csrActiveConfig = crsValue; + bootArgs->csrActiveConfig = csrValue; } else { // zenith432 bootArgs->csrActiveConfig = 0x67; } + verbose("CsrActiveConfig set to 0x%x\n", bootArgs->csrActiveConfig); bootArgs->csrCapabilities = CSR_VALID_FLAGS; bootArgs->boot_SMC_plimit = 0; } @@ -858,7 +863,7 @@ // bootFile must start with a / if it not start with a device name if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/') { - if ( !YOSEMITE || !ELCAPITAN ) //Is not Yosemite 10.10 or El Capitan 10.11 + if ( MacOSVerCurrent < MacOSVer2Int("10.10") ) // Micky1979 - Is prior to Yosemite 10.10 { snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading / }