Index: branches/azimutz/Chazi/doc-azi/CHANGES.txt =================================================================== --- branches/azimutz/Chazi/doc-azi/CHANGES.txt (revision 485) +++ branches/azimutz/Chazi/doc-azi/CHANGES.txt (revision 486) @@ -299,14 +299,16 @@ ---------------//---------------//--------------- -- (rev 480) +- (starting at rev 480) Change: Added Meklort's Modules support, plus Kernel Patcher (Kptchr) module. Check Modules.txt for more info. Some talk here: http://forum.voodooprojects.org/index.php/topic,1556.0.html here: http://forum.voodooprojects.org/index.php/topic,1153.0.html and here: http://forum.voodooprojects.org/index.php/topic,1565.0.html - Note: Only i386 arch is supported at the moment; x86_64 support to be added. + PatchKernel=n disables Kernel Patcher. "Temporarily" enabled by default!! + + Note: Only i386 arch is supported at the moment; x86_64 support being added... Motif: ... as if, booting vanilla kernel, is not reason enough!? Index: branches/azimutz/Chazi/doc-azi/Modules.txt =================================================================== --- branches/azimutz/Chazi/doc-azi/Modules.txt (revision 485) +++ branches/azimutz/Chazi/doc-azi/Modules.txt (revision 486) @@ -9,12 +9,12 @@ "old" in RC5 world means before rev 168 (atm). How to use? - - nothing to do! Modules are loaded at startup, before the Gui loads, providing you place - them in the correct place (check Issues below). - - - Symbols.dylib is always and the first module loaded. The booter will still perform as - usual if this module fails to load. + - Check if a key is needed to activate the module you pretend to use. + Modules are loaded at startup, before the Gui loads, providing they are located in + the right place (check Issues below). + ---------------//---------------//--------------- + What are modules? - good question! Well, can't add much on the "geek" side... need to study the stuff so i don't start dumping bs. The easy answer is they are like plugins, adding/replacing @@ -22,19 +22,32 @@ integrated on boot file like any other Chameleon function; with Modules support Kptchr can now live as a module, freeing the space it occupied on boot file (one of module's advantages). + The booter will still perform as usual if a module fails to load. + +Featured modules: + - Symbols.dylib: first and always loaded. No key is foreseen for this module. + No other module will work if this one fails to load. -Kernel Patcher module: - - features cpuid_set, commpage_stuff and lapic_init patches (atm). + - KernelPatcher.dylib: + - "will" need PatchKernel=y to be enabled. + Note:*** this is still under consideration/testing so, for now the patcher is enabled by default*** + + - features cpuid_set, commpage_stuff and lapic_init patches (atm). - - as it is, Kptchr allows my Pentium D 925 to boot vanilla kernel, with the help of - -legacy flag; to enter x86_64 world i still need to patch the kernel, as the 925 has no - Supplemental SSE3 instructions. I assume that, the great majority of the legacy/unsupported - processors with at least SSE3 instructions, will benefit of the same treatment! - For now let's just say that the only patch needed by the 925 on Legacy Mode(*) is - cpuid_set! + - as it is, Kptchr allows my Pentium D 925 to boot vanilla kernel, with the help of + -legacy flag; to enter x86_64 world i still need to patch the kernel, as the 925 has + no Supplemental SSE3 instructions. I assume that, the great majority of the + legacy/unsupported processors with at least SSE3 instructions, + will benefit of the same treatment! + Let's just say that the only patch needed by the 925 on Legacy Mode(*) is cpuid_set! + + - HelloWorld.dylib: just a notifier, i guess :P -(*) For those who "missed" the lesson, Legacy Mode is the mode, 32 bit only cpu's run on OS X. +(*) For those who "missed" the lesson, Legacy Mode is the mode 32 bit only cpu's run on OS X. + + ---------------//---------------//--------------- + Issues: - modules may fail to load, if you have the booter on a separate device/partition and try to load modules from selected volume. Confirmed on MBR/boot0hfs install only. @@ -45,7 +58,9 @@ - this is work in progress; i will add updates as Meklort commits and only if they are in functional state. + ---------------//---------------//--------------- + Smith@@'s news :D « Sent to: Azimutz on: Fri 03/09/2010 at 05:55:08 » @@ -58,8 +73,12 @@ ---------------//---------------//--------------- + Huge thanks fly out to Meklort for this precious work! + ---------------//---------------//--------------- + + Azimutz Index: branches/azimutz/Chazi/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/Chazi/i386/libsaio/saio_types.h (revision 485) +++ branches/azimutz/Chazi/i386/libsaio/saio_types.h (revision 486) @@ -242,7 +242,7 @@ enum { kNetworkDeviceType = kBIOSDevTypeNetwork, kBlockDeviceType = kBIOSDevTypeHardDrive -} gBootFileType_t; //Azi: kernel patcher module, rev 307 +};// gBootFileType_t; //Kptchr module, rev 307 enum { kCursorTypeHidden = 0x0100, Index: branches/azimutz/Chazi/i386/boot2/boot.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.c (revision 485) +++ branches/azimutz/Chazi/i386/boot2/boot.c (revision 486) @@ -396,6 +396,7 @@ bool tryresume; bool tryresumedefault; bool forceresume; + bool patchKernel = true; //Kptchr - temporarely set to true, ude to testing! // additional variable for testing alternate kernel image locations on boot helper partitions. char bootFileSpec[512]; @@ -666,7 +667,12 @@ } else { /* Won't return if successful. */ // Notify modules that ExecKernel is about to be called - execute_hook("ExecKernel", binary, NULL, NULL, NULL); + getBoolForKey(kKPatcherKey, &patchKernel, &bootInfo->bootConfig); + + if (patchKernel == true) + { + execute_hook("ExecKernel", binary, NULL, NULL, NULL); + } ret = ExecKernel(binary); } } Index: branches/azimutz/Chazi/i386/boot2/boot.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.h (revision 485) +++ branches/azimutz/Chazi/i386/boot2/boot.h (revision 486) @@ -97,6 +97,7 @@ #define kTestConfigKey "config" // stringTable.c #define kCanOverrideKey "CanOverride" // stringTable.c #define kAutoResolutionKey "AutoResolution" // boot.c +#define kKPatcherKey "PatchKernel" // boot.c /* * Flags to the booter and/or kernel - these end with "Flag". Index: branches/azimutz/Chazi/i386/modules/KernelPatcher/kernel_patcher.c =================================================================== --- branches/azimutz/Chazi/i386/modules/KernelPatcher/kernel_patcher.c (revision 485) +++ branches/azimutz/Chazi/i386/modules/KernelPatcher/kernel_patcher.c (revision 486) @@ -215,7 +215,7 @@ { struct load_command *loadCommand; - struct symtab_command *symtableData; + struct symtab_command *symtableData = 0; //Azi:warning // struct nlist *symbolEntry; char* symbolString; @@ -286,7 +286,8 @@ } } - handle_symtable((UInt32)kernelData, symtableData, &symbol_handler, determineKernelArchitecture(kernelData) == KERNEL_64); + return handle_symtable((UInt32)kernelData, symtableData, &symbol_handler, + determineKernelArchitecture(kernelData) == KERNEL_64); } long long symbol_handler(char* symbolName, long long addr, char is64) Index: branches/azimutz/Chazi/i386/modules/HelloWorld/HelloWorld.c =================================================================== --- branches/azimutz/Chazi/i386/modules/HelloWorld/HelloWorld.c (revision 485) +++ branches/azimutz/Chazi/i386/modules/HelloWorld/HelloWorld.c (revision 486) @@ -4,12 +4,13 @@ */ #include "libsaio.h" +#include "modules.h" //Azi:warning void helloWorld(void* binary, void* arg2, void* arg3, void* arg4) { printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary); - getc(); + //getc(); }