Chameleon

Chameleon Commit Details

Date:2010-08-10 00:57:43 (9 years 14 days ago)
Author:Azimutz
Commit:335
Parents: 334
Message:Ok, this were the fun stops :) - two keys to do the same thing, two keys to remember... thought it was a good idea to merge the best of the two, the educational side of arch=i386 + the practical one of -x32. And while i'm at it, why not make it even more practical!? Typing just 32 to get i386 arch. - -legacy kernel flag was not being passed on 10.6.x; the reason why is on the kernel code, Legacy mode is only available when i386 arch is specified (makes sense). So, while testing Meklort's kernel patcher, i felt the need to add the key. -legacy flag, sets i386 arch on the booter side & Legacy mode on the kernel side. - and how do we override the last two if they are flagged on Boot.plist? Typing just 64 to get x86_64 arch. - changed the code so x86_64 arch becomes default, seems more natural. And also added these flags to BootHelp.txt
Changes:
M/branches/azimutz/CleanCut/doc/BootHelp.txt
M/branches/azimutz/CleanCut/i386/boot2/boot.c
M/branches/azimutz/CleanCut/i386/boot2/boot.h

File differences

branches/azimutz/CleanCut/doc/BootHelp.txt
1414
1515
1616
17
18
17
18
19
20
1921
2022
2123
kernel: kernel name (e.g. "mach_kernel" - must be in "/" )
flags: -v (verbose) -s (single user mode),
-x (safe mode) -F (ignore boot configuration file)
flags: -v (verbose) -s (single user mode),
-x (safe mode) -F (ignore boot configuration file)
32 (i386 arch) -legacy (no 64 bit apps - kernel flag)
64 (x86_64 arch)
"Graphics Mode"="WIDTHxHEIGHTxDEPTH" (e.g. "1024x768x32")
branches/azimutz/CleanCut/i386/boot2/boot.c
407407
408408
409409
410
411
412
410
411
412
413
414
415
416
417
413418
414419
415
416
417
418
420
421
422
423
419424
420
421
425
426
427
428
422429
423430
424431
}
}
if (platformCPUFeature(CPU_FEATURE_EM64T)) {
archCpuType = CPU_TYPE_X86_64;
} else {
// If cpu doesn't handle 64 bit instructions,...
if (!platformCPUFeature(CPU_FEATURE_EM64T) ||
// ... user forced i386 kernel architecture on cpu with "em64t"...
getValueForKey(kArchI386Flag, &val, &len, &bootInfo->bootConfig) ||
// ... or forced Legacy Mode...
getValueForKey(kLegacyModeFlag, &val, &len, &bootInfo->bootConfig))
{
// ... use i386 kernel arch.
archCpuType = CPU_TYPE_I386;
}
if (getValueForKey(karch, &val, &len, &bootInfo->bootConfig)) {
if (strncmp(val, "i386", 4) == 0) {
archCpuType = CPU_TYPE_I386;
}
else
{
// Else use x86_64 kernel arch.
archCpuType = CPU_TYPE_X86_64;
}
if (getValueForKey(k32BitModeFlag, &val, &len, &bootInfo->bootConfig)) {
archCpuType = CPU_TYPE_I386;
// Override i386/-legacy, if flagged on Boot.plist.
if (getValueForKey(kArchX86_64Flag, &val, &len, &bootInfo->bootConfig))
{
archCpuType = CPU_TYPE_X86_64;
}
if (!getBoolForKey (kWake, &tryresume, &bootInfo->bootConfig)) {
branches/azimutz/CleanCut/i386/boot2/boot.h
9898
9999
100100
101
101
102102
103103
104104
105105
106106
107107
108
108
109
110
109111
110112
111113
#define kMD0Image"md0"// ramdisk.h
/*
* Flags to the booter or kernel
* Flags to the booter and/or kernel - these end with "Flag".
*/
#define kVerboseModeFlag"-v"// options.c
#define kSafeModeFlag"-x"// options.c
#define kOldSafeModeFlag"-f"// options.c
#define kIgnoreBootFileFlag"-F"// options.c
#define kSingleUserModeFlag"-s"// options.c
#define k32BitModeFlag"-x32"// boot.c
#define kArchI386Flag"32"// boot.c
#define kLegacyModeFlag"-legacy"// boot.c
#define kArchX86_64Flag"64"// boot.c
/*
* Booter behavior control

Archive Download the corresponding diff file

Revision: 335