Chameleon

Chameleon Commit Details

Date:2011-07-11 15:11:27 (9 years 4 months ago)
Author:armel cadet-petit
Commit:1142
Parents: 1141
Message:combo fix + doc update
Changes:
M/branches/cparm/i386/modules/Keymapper/Makefile
M/branches/cparm/i386/modules/USBFix/Makefile
M/branches/cparm/i386/modules/SMBiosPatcher/Makefile
M/branches/cparm/i386/modules/Resolution/Makefile
M/branches/cparm/doc/ModuleHelp.txt
M/branches/cparm/i386/modules/Memory/Makefile
M/branches/cparm/i386/modules/ACPICodec/Makefile
M/branches/cparm/i386/modules/HelloWorld/Makefile
M/branches/cparm/i386/boot2/Makefile
M/branches/cparm/i386/modules/NetbookInstaller/Makefile
M/branches/cparm/i386/modules/KernelPatcher/kernel_patcher.c
M/branches/cparm/i386/modules/KextPatcher/Makefile
M/branches/cparm/doc/README
M/branches/cparm/i386/boot2/boot.c
M/branches/cparm/i386/modules/GUI/Makefile
M/branches/cparm/i386/modules/KernelPatcher/Makefile
M/branches/cparm/i386/boot2/modules.c
M/branches/cparm/i386/modules/GraphicsEnabler/Makefile
M/branches/cparm/CHANGES
M/branches/cparm/i386/modules/SMBiosGetters/Makefile

File differences

branches/cparm/doc/ModuleHelp.txt
103103
104104
105105
106
107
106
107
108
109
110
108111
109112
110113
111114
112115
113116
114
117
118
119
120
121
115122
116
123
117124
118125
119126
EnableAcpiModule=Yes|NoFully enable/disable the Acpipatcher module (Enabled by default, if the module is installed)
RestartFix=Yes|NoEnable/Disable internal restart fix patch(Enabled by default, only available for intel platform).
RestartFix=Yes|NoEnable/Disable internal restart fix patch (Enabled by default, only available for intel platform).
ResetType=0|10 : PCI reset (Default)
1 : keyboard reset
EnableSpeedStep=Yes|NoEnable/Disable GenerateCStates & GeneratePStates (Disabled by default).
GeneratePStates=Yes|NoEnable/Disable Generate P-states SSDT table (Disabled by default).
GenerateCStates=Yes|NoEnable/Disable Generate C-states SSDT table (Disabled by default).
EnableC4State=Yes|NoEnable C4 state in C-states SSDT table, GenerateCStates=Yes is needed (Disabled by default).
P-States=<dict>P-States fine tuning method, see usage below(GeneratePStates=Yes is needed).
IntelFADTSpec=Yes|NoEnable/Disable Intel recommendations for the FADT table (Enabled by default).
Warning : When enabled, this setting disable the C2 and C3 C-states, but be aware that these are the Intel's recommendations for the newest CPU,
if you really need those c-states please disable IntelFADTSpec.
P-States=<dict>P-States fine tuning method, see usage below(GeneratePStates=Yes is needed).
ACPIDropTables=<dict>drop acpi table(s) method (can drop any unwanted tables), see usage below.
C-States=<dict>C-States fine tuning method, see usage below(GenerateCStates=Yes is needed).
C-States=<dict>C-States fine tuning method, see usage below(GenerateCStates=Yes is needed).
UpdateACPI=Yes|No Enable/Disable ACPI version update(Disabled by default).
branches/cparm/doc/README
1919
2020
2121
22
2223
2324
2425
......
4950
5051
5152
52
53
53
54
5455
5556
5657
57
58
5859
59
60
60
61
6162
6263
6364
64
65
65
66
6667
6768
68
69
6970
7071
7172
- Apple Software RAID support.
- stage2 loader (boot) can be placed as a regular file in the boot
partition's root folder.
- Modules
Installation
No need to use startupfiletool anymore!
IMPORTANT NOTE ABOUT THE MODULES: PLEASE NOTE THAT ALL MODULES ARE NOT NECESSARILY NEEDED TO BE INSTALLED, YOU JUST HAVE TO INSTALL WHAT YOU NEED,
FOR EXEMPLE:
- IF YOU DON'T PLAN TO USE A RAMDISK (PREBBOT.DMG OR POSTBOOT.IMG), YOU WILL SURELY NOT NEED TO INSTALL THE RAMDISKLOADER MODULE,
FOR EXAMPLE:
- IF YOU DON'T PLAN TO USE A RAMDISK (PREBOOT.DMG OR POSTBOOT.IMG), YOU WILL SURELY NOT NEED TO INSTALL THE RAMDISKLOADER MODULE,
- IF YOU DON'T PLAN TO BOOT FROM AN HIBERNATE IMAGE YOU WILL SURELY NOT NEED TO INSTALL THE HIBERNATEENABLER MODULE,
- IF YOUR MACHINE IS NOT A NETBOOK, YOU WILL SURELY NOT NEED TO INSTALL THE NETBOOKINSTALLER MODULE,
- IF YOU DON'T NEED TO PATCH THE KERNEL ON THE FLY, PLEASE DO NOT INSTALL THE KERNELPATCHER MODULE,
- ETC,ETC,ETC
PLEASE DO NOT USE ACPIPATCHER AND ACPICODEC TOGETHER, THEY DO THE SAME THING BUT IN A DIFFERENT WAY, YOU HAVE TO CHOOSE ONE OF THEM (ACPICODEC IS RECOMMENDED), THIS ISSUE WILL BE FIXED WITH THE BUNDLED MODULE VERSION
PLEASE DO NOT USE SMBIOSGETTERS AND SMBIOSPATCHER TOGETHER, THEY DO THE SAME THING BUT IN A DIFFERENT WAY, YOU HAVE TO CHOOSE ONE OF THEM (SMBIOSGETTERS IS RECOMMENDED), THIS ISSUE WILL BE FIXED WITH THE BUNDLED MODULE VERSION
PLEASE DO NOT USE ACPIPATCHER AND ACPICODEC TOGETHER, THEY DO THE SAME THING BUT IN A DIFFERENT WAY, YOU HAVE TO CHOOSE ONE OF THEM (ACPICODEC IS RECOMMENDED), THIS ISSUE WILL BE FIXED WITH THE BUNDLED MODULES
PLEASE DO NOT USE SMBIOSGETTERS AND SMBIOSPATCHER TOGETHER, THEY DO THE SAME THING BUT IN A DIFFERENT WAY, YOU HAVE TO CHOOSE ONE OF THEM (SMBIOSGETTERS IS RECOMMENDED), THIS ISSUE WILL BE FIXED WITH THE BUNDLED MODULES
HERE IS ONE OF THE MOST COMMON USAGE:
- ACPICODEC (FOR ACPI FIXES, AND IF YOU DON'T HAVE A ALREADY PATCHED BIOS)
- GRAPGHICENABLER (IF YOU HAVE NOT FIXED THIS BY THE DSDT, THIS MODULE CAN ADD THE EFI STING FOR YOUR GRAPHIC CARD)
- ACPICODEC (FOR ACPI FIXES, AND IF YOU DON'T HAVE AN ALREADY PATCHED BIOS)
- GRAPGHICENABLER (IF YOU HAVE NOT FIXED THIS BY THE DSDT, THIS MODULE CAN ADD THE EFI STRING FOR YOUR GRAPHIC CARD)
- GUI (IF YOU WANT A GUI)
- KEYMAPPER (IF YOU WANT TO REMAP YOUR KEYBOARD (AN AZERTY PRESET IS AVAILABLE), SEE MODULEHELP.TXT FOR USAGE)
- SMBIOSGETTERS (FOR SMBIOS FIXES, AND IF YOU DON'T HAVE A ALREADY PATCHED BIOS)
- SMBIOSGETTERS (FOR SMBIOS FIXES, AND IF YOU DON'T HAVE AN ALREADY PATCHED BIOS)
- MEMORY (FOR RAM DETECTION, THIS MODULE IS ACTUALLY A PLUGIN FOR SMBIOSGETTERS OR SMBIOSPATCHER, AND IT WILL NOT WORK WITHOUT ONE OF THEM, IT WILL BE MORE CLEAR WITH THE BUNDLED MODULES)
- SYMBOLS IS ABSOLUTELY NEEDED IF YOU USE AT LEAST ONE OTHER MODULE
branches/cparm/CHANGES
1
12
23
34
- Fixed an issue with kernelPatcher, it seems that kernelPatcher is unable to patch the kernelCache
- Applied some fix from the trunk
- Applied many under the hood fix
- Added Andy Vandijck Server spoof
branches/cparm/i386/boot2/boot.c
107107
108108
109109
110
110111
111112
112113
......
300301
301302
302303
303
304
305
306
307
308
309
310
311304
312
305
313306
314
315
307
308
316309
317310
318311
319
312
320313
321
314
322315
323
324
325
326316
327317
328318
......
564554
565555
566556
567
557
568558
569559
570560
......
624614
625615
626616
627
617
618
628619
629620
630621
......
769760
770761
771762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
772831
773832
774833
static bool getOSVersion(char *str);
static void getRootDevice();
void getKernelCachePath();
#ifdef NBP_SUPPORT
static bool gUnloadPXEOnExit = false;
if (gMacOSVersion[3] <= '6')
reserveKernLegacyBootStruct();
//uint8_t Pic1,Pic2;
//Pic1 = inb(0x21); /* Save all interrupts Pic1 */
//Pic2 = inb(0xa1); /* Save all interrupts Pic2 */
execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgs, NULL, NULL, NULL, NULL);// Notify modules that the kernel is about to be started
//#if UNUSED
#if UNUSED
turnOffFloppy();
//#endif
//#if BETA
#endif
#if BETA
#include "smp.h"
#include "apic.h"
IMPS_LAPIC_WRITE(LAPIC_LVT1, LAPIC_ICR_DM_NMI);
//#endif
#endif
if (gMacOSVersion[3] <= '6') {
if (gMacOSVersion[3] <= '6') {
//outb(0x21, Pic1); /* Restore all interrupts Pic1 */
//outb(0xa1, Pic2); /* Restore all interrupts Pic2 */
// Jump to kernel's entry point. There's no going back now. XXX LEGACY OS XXX
startprog( kernelEntry, bootArgsLegacy );
}
if (!getValueForBootKey(bootArgs->CommandLine, kIgnorePrelinkKern, &val, &len)) {
if(gMacOSVersion[3] == '7'){
/*if(gMacOSVersion[3] == '7'){
sprintf(gBootKernelCacheFile, "%s", kDefaultCachePath);
}
else if(gMacOSVersion[3] <= '6')
sprintf(gBootKernelCacheFile, "%s_%s.%08lX", kDefaultCachePath, (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64", bootInfo->adler32); //Snow Leopard
}
}*/
getKernelCachePath();
}
#endif
}
void getKernelCachePath()
{
long flags, cachetime;
int ret = -1;
if(gMacOSVersion[3] == '7'){
sprintf(gBootKernelCacheFile, "%s", kDefaultCachePath);
}
else if(gMacOSVersion[3] <= '6')
{
PlatformInfo *platformInfo = malloc(sizeof(PlatformInfo));
if (platformInfo) {
bzero(platformInfo, sizeof(PlatformInfo));
if (gPlatformName)
strlcpy(platformInfo->platformName,gPlatformName, sizeof(platformInfo->platformName)+1);
if (gRootDevice) {
char *rootPath_p = platformInfo->rootPath;
int len = strlen(gRootDevice) + 1;
if ((unsigned)len > sizeof(platformInfo->rootPath)) {
len = sizeof(platformInfo->rootPath);
}
memcpy(rootPath_p, gRootDevice,len);
rootPath_p += len;
len = strlen(bootInfo->bootFile);
if ((unsigned)(rootPath_p - platformInfo->rootPath + len) >=
sizeof(platformInfo->rootPath)) {
len = sizeof(platformInfo->rootPath) -
(rootPath_p - platformInfo->rootPath);
}
memcpy(rootPath_p, bootInfo->bootFile, len);
}
if (!platformInfo->platformName[0] || !platformInfo->rootPath[0]) {
platformInfo->platformName[0] = platformInfo->rootPath[0] = 0;
}
//memcpy(gRootPath,platformInfo->rootPath, sizeof(platformInfo->rootPath));
bootInfo->adler32 = OSSwapHostToBigInt32(local_adler32((unsigned char *)platformInfo, sizeof(*platformInfo)));
free(platformInfo);
}
DBG("Adler32: %08lX\n",bootInfo->adler32);
if (gMacOSVersion[3] < '6') {
sprintf(gBootKernelCacheFile, "%s.%08lX", "/System/Library/Caches/com.apple.kernelcaches/kernelcache",bootInfo->adler32);
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {
bootInfo->adler32 = 0;
sprintf(gBootKernelCacheFile, "%s", "/System/Library/Caches/com.apple.kernelcaches/kernelcache");
}
} else
sprintf(gBootKernelCacheFile, "%s_%s.%08lX", kDefaultCachePath, (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64", bootInfo->adler32); //Snow Leopard
}
}
// Maximum config table value size
#define VALUE_SIZE 2048
static void getRootDevice()
branches/cparm/i386/boot2/modules.c
339339
340340
341341
342
342
343343
344344
345345
......
12381238
12391239
12401240
1241
1242
12411243
12421244
12431245
}
else
{
printf("Invalid mach magic\n");
printf("Modules: Invalid mach magic\n");
getc();
return NULL;
}
/* Nedded to divide 64bit numbers correctly. TODO: look into why modules need this
* And why it isn't needed when compiled into boot2
*
* In the next versions, this will be surely replaced by the Apple's libcc_kext or the meklort's klibc
*/
uint64_t __udivdi3(uint64_t numerator, uint64_t denominator)
branches/cparm/i386/boot2/Makefile
129129
130130
131131
132
133132
134133
135134
-compatibility_version 1.0.0 \
-final_output Symbols \
-exported_symbols_list ${OBJROOT}/Symbols.save \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
${OBJROOT}/Symbols.o \
-o $(SYMROOT)/${SYMBOLS_MODULE}
branches/cparm/i386/modules/NetbookInstaller/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/*.o \
-weak_library $(SYMROOT)/Symbols.dylib \
-o $(SYMROOT)/$(MODULE_NAME).dylib
branches/cparm/i386/modules/KextPatcher/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/*.o \
-weak_library $(SYMROOT)/Symbols.dylib \
-o $(SYMROOT)/$(MODULE_NAME).dylib
branches/cparm/i386/modules/GUI/Makefile
8181
8282
8383
84
8584
8685
8786
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/rand.o \
$(OBJROOT)/GUI_module.o \
$(OBJROOT)/gui.o \
branches/cparm/i386/modules/KernelPatcher/kernel_patcher.c
1212
1313
1414
15
1516
17
1618
1719
1820
......
4648
4749
4850
51
52
53
4954
5055
5156
patchRoutine_t* patches = NULL;
kernSymbols_t* kernelSymbols = NULL;
void kernel_patcher_ignore_cache(void* arg1, void* arg2, void* arg3, void *arg4, void* arg5, void* arg6){}
void KernelPatcher_start()
{
register_kernel_patch(patch_cpuid_set_info_all, KERNEL_ANY, CPUID_MODEL_UNKNOWN);
register_hook_callback("ExecKernel", &patch_kernel);
replace_function("_getKernelCachePath", &kernel_patcher_ignore_cache);
}
/*
branches/cparm/i386/modules/KernelPatcher/Makefile
6969
7070
7171
72
7372
7473
7574
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/*.o \
-weak_library $(SYMROOT)/Symbols.dylib \
-o $(SYMROOT)/$(MODULE_NAME).dylib
branches/cparm/i386/modules/GraphicsEnabler/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/ati.o \
$(OBJROOT)/nvidia.o \
$(OBJROOT)/gma.o \
branches/cparm/i386/modules/SMBiosGetters/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/SMBiosGetters.o \
$(OBJROOT)/mysmbios.o \
$(OBJROOT)/smbios_getters.o \
branches/cparm/i386/modules/Keymapper/Makefile
6969
7070
7171
72
7372
7473
7574
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/Keymapper.o \
-o $(SYMROOT)/$(MODULE_NAME).dylib
branches/cparm/i386/modules/USBFix/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/USBFix.o \
$(OBJROOT)/usb.o \
-o $(SYMROOT)/$(MODULE_NAME).dylib
branches/cparm/i386/modules/SMBiosPatcher/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/SMBiosPatcher.o \
$(OBJROOT)/smbios_patcher.o \
-o $(SYMROOT)/$(MODULE_NAME).dylib
branches/cparm/i386/modules/Resolution/Makefile
6969
7070
7171
72
7372
7473
7574
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/edid.o \
$(OBJROOT)/915resolution.o \
$(OBJROOT)/Resolution.o \
branches/cparm/i386/modules/Memory/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/dram_controllers.o \
$(OBJROOT)/mem.o \
$(OBJROOT)/spd.o \
branches/cparm/i386/modules/ACPICodec/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/acpicode.o \
$(OBJROOT)/acpidecode.o \
$(OBJROOT)/ACPICodec.o \
branches/cparm/i386/modules/HelloWorld/Makefile
7070
7171
7272
73
7473
7574
7675
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
"/usr/lib/gcc/i686-apple-darwin10/4.2.1/libcc_kext.a" \
$(OBJROOT)/HelloWorld.o -o $(SYMROOT)/$(MODULE_NAME).dylib

Archive Download the corresponding diff file

Revision: 1142