Chameleon

Chameleon Commit Details

Date:2014-10-21 19:15:33 (6 years 1 month ago)
Author:ErmaC
Commit:2428
Parents: 2427
Message:Move checkOSVersion to boot header, use macro instead of full checkOSVersion.
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/boot2/boot.c
M/trunk/i386/libsaio/bootstruct.c
M/trunk/i386/boot2/boot.h
M/trunk/CHANGES
M/trunk/i386/boot2/options.c

File differences

trunk/i386/libsaio/bootstruct.c
2727
2828
2929
30
3031
3132
3233
......
115116
116117
117118
118
119
119
120120
121
122
121
123122
124123
125124
*/
#include "libsaio.h"
#include "boot.h"
#include "bootstruct.h"
#ifndef DEBUG_BOOTSTRUCT
/* Copy boot args after kernel and record address. */
void
reserveKernBootStruct(void)
void reserveKernBootStruct(void)
{
if ((gMacOSVersion[0] == '1') && (gMacOSVersion[1] == '0')
&& (gMacOSVersion[2] == '.') && (gMacOSVersion[3] == '7' || gMacOSVersion[3] == '8' || gMacOSVersion[3] == '9'))
if ( LION || MOUNTAIN_LION || MAVERICKS )
{
void *oldAddr = bootArgs;
bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args));
trunk/i386/boot2/drivers.c
241241
242242
243243
244
244
245245
246246
247247
return -1;
}
} else {
if (gMacOSVersion[3] == '9') {
if ( MAVERICKS ) {
strlcpy(gExtensionsSpec, dirSpec, 4087); /* 4096 - sizeof("Library/") */
strcat(gExtensionsSpec, "Library/");
FileLoadDrivers(gExtensionsSpec, 0);
trunk/i386/boot2/boot.c
9191
9292
9393
94
95
9694
9795
9896
......
342340
343341
344342
345
346
343
347344
348345
349346
......
551548
552549
553550
554
555
556
557551
558552
559553
......
768762
769763
770764
771
772
765
766
767
768
769
770
771
772
773773
774774
775
776
777
778
779
780775
781776
782777
longgBootMode; /* defaults to 0 == kBootModeNormal */
BVRefbvr, menuBVR, bvChain;
static boolcheckOSVersion(const char * version);
static voidgetOSVersion();
static unsigned longAdler32(unsigned char *buffer, long length);
//static voidselectBiosDevice(void);
ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime);
// Check if the S/L/E directory time is more recent than the cache file
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)
&& (exttime > cachetime))
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) && (exttime > cachetime))
{
DBG("Folder: '/System/Library/Extensions' is more recent than Kernel Cache file (%s)! Ignoring Kernel Cache.\n",
kernelCacheFile);
updateVRAM();
}
// Find out which version mac os we're booting.
getOSVersion();
if (platformCPUFeature(CPU_FEATURE_EM64T)) {
archCpuType = CPU_TYPE_X86_64;
} else {
bool checkOSVersion(const char * version)
{
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
if ( (sizeof(version) > 4) && (version[3] == '1') ) {
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3])
&& (gMacOSVersion[4] == version[4]));
} else {
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
}
}
static void getOSVersion()
{
strncpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion));
}
#define BASE 65521L /* largest prime smaller than 65536 */
#define NMAX 5000
// NMAX (was 5521) the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1
trunk/i386/boot2/boot.h
324324
325325
326326
327
328
327329
/* bmdecompress.c */
void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
bool checkOSVersion(const char * version);
#endif /* !__BOOT2_BOOT_H */
trunk/i386/boot2/options.c
12021202
12031203
12041204
1205
1206
1207
12051208
12061209
12071210
return -1;
}
// Find out which version mac os we're booting.
strncpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion));
// Load config table specified by the user, or use the default.
if (!getValueForBootKey(cp, "config", &val, &cnt)) {
trunk/CHANGES
1
2
13
24
35
- ErmaC : Use macro instead of full checkOSVersion
- viv xix : Move checkOSVersion into boot header
- ErmaC : define macro for OS X Versions
- Slice and Clover Team : Replace "NULL" terminated strings and fit Boot2 Sectors size
- ErmaC : Update bootargs

Archive Download the corresponding diff file

Revision: 2428