Chameleon

Chameleon Commit Details

Date:2014-10-21 20:10:09 (6 years 1 month ago)
Author:ErmaC
Commit:2431
Parents: 2430
Message:getCPUTick() helper function http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-r eally-random
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/libsaio/fake_efi.c
M/trunk/i386/boot2/boot.h
M/trunk/CHANGES

File differences

trunk/i386/libsaio/fake_efi.c
6868
6969
7070
71
72
73
74
75
76
77
78
79
80
7181
7282
7383
7484
7585
76
86
7787
7888
7989
......
699709
700710
701711
712
702713
714
715
716
717
703718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
704734
705735
706736
return ((uint64_t)addr | 0xFFFFFF8000000000ULL);
}
// ==========================================================================
// ErmaC
static inline uint64_t getCPUTick(void)
{
uint32_t lowest;
uint32_t highest;
__asm__ volatile ("rdtsc" : "=a" (lowest), "=d" (highest));
return (uint64_t) highest << 32 | lowest;
}
/*==========================================================================
* Fake EFI implementation
*/
/* Identify ourselves as the EFI firmware vendor */
static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','2', 0};
static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','3', 0};
// Bungo
//static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */
static EFI_UINT32 const FIRMWARE_REVISION = 0x0001000a; // got from real MBP6,1
length = strlen(bootInfo->bootFile);
DT__AddProperty(chosenNode, "boot-file", length + 1, bootInfo->bootFile);
//DT__AddProperty(chosenNode, "boot-device-path", bootDPsize, gBootDP);
//DT__AddProperty(chosenNode, "boot-file-path", bootFPsize, gBootFP);
//DT__AddProperty(chosenNode, "boot-kernelcache-adler32", sizeof(adler32), adler32);
DT__AddProperty(chosenNode, "machine-signature", sizeof(EFI_UINT32), (EFI_UINT32 *)&MachineSig);
//
//
//
}
/*
trunk/i386/boot2/drivers.c
240240
241241
242242
243
244
243
244
245
246
247
245248
246249
247250
error("Could not load %s\n", gMKextName);
return -1;
}
} else {
if ( MAVERICKS ) {
}
else
{
if ( MAVERICKS || YOSEMITE ) // issue 352
{
strlcpy(gExtensionsSpec, dirSpec, 4087); /* 4096 - sizeof("Library/") */
strcat(gExtensionsSpec, "Library/");
FileLoadDrivers(gExtensionsSpec, 0);
trunk/i386/boot2/boot.h
3030
3131
3232
33
33
3434
3535
3636
#include "libsaio.h"
// OS X Versions
#define YOSEMITE checkOSVersion("10.10") // Yosemite
#define MAVERICKS checkOSVersion("10.9") // Mavericks
#define MOUNTAIN_LION checkOSVersion("10.8") // Mountain Lion
#define LION checkOSVersion("10.7") // Lion
trunk/CHANGES
1
12
23
34
- ErmaC : getCPUTick() helper function ( http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-really-random/ )
- ErmaC : Add Yosemite Icons detection for chameleon UI
- blackosx : Add chameleon UI Icons for Yosemite
- ErmaC : Use macro instead of full checkOSVersion

Archive Download the corresponding diff file

Revision: 2431