Chameleon

Chameleon Commit Details

Date:2016-05-17 09:34:44 (7 years 11 months ago)
Author:zenith432
Commit:2817
Parents: 2816
Message:prevent infinite loop in setupChosenNode() + kernel path by Micky1979
Changes:
M/branches/zenith432/i386/boot2/boot.c
M/branches/zenith432/i386/libsaio/fake_efi.c
M/trunk/i386/boot2/boot.c
M/trunk/i386/libsaio/fake_efi.c

File differences

trunk/i386/libsaio/fake_efi.c
699699
700700
701701
702
702
703703
704704
705705
......
753753
754754
755755
756
757
758
759
760
761
762
756763
764
757765
766
767
758768
759769
760770
// 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;
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;// jb0x17e55(retry)
}
}
else
PMRepeatCount = 0xffff;
cpuTick = (EFI_UINT32) getCPUTick();// callq0x121a7
//printf("value: 0x%x\n", getCPUTick());
trunk/i386/boot2/boot.c
863863
864864
865865
866
866
867867
868868
869869
// 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 /
}
branches/zenith432/i386/libsaio/fake_efi.c
699699
700700
701701
702
702
703703
704704
705705
......
753753
754754
755755
756
757
758
759
760
761
762
756763
764
757765
766
767
758768
759769
760770
// 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;
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;// jb0x17e55(retry)
}
}
else
PMRepeatCount = 0xffff;
cpuTick = (EFI_UINT32) getCPUTick();// callq0x121a7
//printf("value: 0x%x\n", getCPUTick());
branches/zenith432/i386/boot2/boot.c
863863
864864
865865
866
866
867867
868868
869869
// 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 /
}

Archive Download the corresponding diff file

Revision: 2817