Jump to content

Mavericks kernel testing on AMD (formerly Mountain Lion kernel testing on AMD)


theconnactic
 Share

6,414 posts in this topic

Recommended Posts

Thank you guys very much!

 

Both tests i proposed are meant only for Bulldozer CPUs, mac_carol: old AMDs will need a perfected ssse3 emulator. Do you have a FX-series CPU? If you have, that's a progress: no more instant reboots.

 

The fact the boot got stuck at Kernel=LP64 means that the kernel boots fine, but the user land doesn't. Strange: that's typical of a non-Bulldozer CPU trying to boot a patched x86_64 kernel (it usually gets stuck at that point because is where the userland should show up and while we can trick the kernel to believe the CPU supports ssse3, this is not possible with the user land, thus the need of a ssse3 emulator).

 

I'll take a look on it again later tonight.

Link to comment
Share on other sites

Just thought id add in another processor testing and findings.

 

The kernel needs to be modified, we get the same error as you.

 

we are all waiting for the new modified kernel to test

 

please, test them with boot flag; -v-f . I want to know if you get the same error.

 

I do not use kextcache so a -f isnt needed. it always loads all kexts

Link to comment
Share on other sites

Thank you guys very much!

 

Both tests i proposed are meant only for Bulldozer CPUs, mac_carol: old AMDs will need a perfected ssse3 emulator. Do you have a FX-series CPU? If you have, that's a progress: no more instant reboots.

 

The fact the boot got stuck at Kernel=LP64 means that the kernel boots fine, but the user land doesn't. Strange: that's typical of a non-Bulldozer CPU trying to boot a patched x86_64 kernel (it usually gets stuck at that point because is where the userland should show up and while we can trick the kernel to believe the CPU supports ssse3, this is not possible with the user land, thus the need of a ssse3 emulator).

 

I'll take a look on it again later tonight.

 

Mac_carol has Phenom II 965:

 

FYI, both Lion 10.7.5 & ML 10.8.0 were running within Chameleon v2.2-r2117 on AMD P-II x4 965

Link to comment
Share on other sites

I once had received a patch specifically targetting AMD for Lion.

I'm sharing it here because some of the things done (like -msse4a and some other patches including to the OSKext:: parts...)

We could use some usefull parts of it.

Still haven't got around to experimenting myself but I'll get on it as soon as I have the time...

Hope it's useful...

 

On CPUID patching, something which I dug up from Leopard days: http://www.insanelym...cpuidtxt-files/

 

From my understanding the OS will boot with no CPUID, but some apps will crash. Good luck!

Unfortunately it won't...

Some CoreServices use CPUID instructions too... including WindowServer...

diff_1699.24.23.diff.zip

  • Like 2
Link to comment
Share on other sites

Hi, Andy!

 

Glad to see you here!

 

We've been extensively using RAWx86's 10.7.4 patches (which, by their turn, are based on Bronzovka's and yours, hence the name "BronzovkAnVoodoo") to make a working 10.8.x for AMD machines (and based on the same patches, i made a working 10.7.5 kernel for bulldozer CPUs). We'd been stuck with the lack of ssse3 support on most of AMD CPUs until recently, when Sinetek came up with his ssse3 emulator. It's not ready yet, but it's a light at the end of the tunnel.

 

I downloaded the patch you posted, and i'll start experiencing with it both with 10.7.5 and 10.8.x. Thank you!

 

P.S.: add, if you can, the chat room #legacykernel on the server irc.osx86.hu

Link to comment
Share on other sites

Do I need to update my Lion to 10.7.5 to test accurately or is it fine on 10.7.4? I have Chameleon v2.1svn r1819 installed.

 

The test is destined for now to Bulldozer (FX-series) CPUs. Old AMDs will have to wait for an improved ssse3 emulator. And the revision of chameleon should be exactly the one i posted, with the kernel patcher module installed.

 

P.S.: i'm on the chatroom now, it is at www.irc.osx86.hu

Link to comment
Share on other sites

Hey guys

 

Currently at work and i have a number of FX4100 (about 30) at my disposal at the moment. ive not done the hackintosh scene for a while however ive been reading this thread for the last week and would like to offer my services/ hardware for tests....

 

all i need is to be told what i need to do or what to download

 

Regards

Slowie

  • Like 1
Link to comment
Share on other sites

I've been running some tests...

The kernel stops after core crypto even on an Intel CPU...

It must be something generic...

I'm still investigating... kernel = for ML...

Posting my diff now...

Still more work to do on the SSSE3emu in order to get it to work on 64bit kernel too...

remember: %ebp = 32bit %rbp = 64bit + size = 8, not 4...

Also other problem... the pointer to bp gets passed from memory to memory...

Don't know about Xcode 3.2.6 but latest from app store with command line tools installed makes a big fuzz about passing into 8(%rbp) or 4(%ebp)

xnu-2050.18.24-BAV_sinactic.diff.zip

Link to comment
Share on other sites

@Andy,

 

Besides the emu, what is the difference in the patches for AMD CPUs and legacy Intel CPUs? Or are they one and the same (I'm speaking strictly about the kernel, not any binpatching)

 

I have a legacy Intel rig (breadboarded lol) that I can test kernel development with. Assuming we're working on legacy Intel as well.

 

There is also something I'm wondering: what about Lion? I'll try applying the diff to the Lion kernels and see what happens. :)

Link to comment
Share on other sites

We all have us very much love. I would like to once again apologize to Alessandro. It was not my intention to see Alessandro here on display. I asked iPoco produce all posts by me again.

let us to work on a Mountain Lion AMD kernel continue.

  • Like 2
Link to comment
Share on other sites

I've just booted the kernel succesfully on my Intel...

Attached are the compiled kernel and the diff I used.

It seemed that the new IOCatalogue mods and OSKext mods are the thing that made the damn thing hang.

I removed the following from the diff:

diff -Nur xnu-2050.18.24-orig/iokit/IOKit/IOCatalogue.h xnu-2050.18.24/iokit/IOKit/IOCatalogue.h
--- xnu-2050.18.24-orig/iokit/IOKit/IOCatalogue.h 2011-10-06 22:35:33.000000000 +0200
+++ xnu-2050.18.24/iokit/IOKit/IOCatalogue.h 2012-12-10 16:50:02.000000000 +0100
@@ -276,4 +276,16 @@
extern const OSSymbol * gIOProbeScoreKey;
extern IOCatalogue    * gIOCatalogue;

+
+extern "C" {
+    /* kaitek: see ::addDrivers() and StartIOKit() for more information about the built-in kernel
+	 * kext blacklist. */
+    typedef struct {
+	    const char *name;
+	    uint32_t hits;
+    } blacklist_mod_t;
+    extern boolean_t blacklistEnabled;
+    extern blacklist_mod_t blacklistMods[];
+};
+
#endif /* ! _IOKIT_IOCATALOGUE_H */

diff -Nur xnu-2050.18.24-orig/iokit/Kernel/IOCatalogue.cpp xnu-2050.18.24/iokit/Kernel/IOCatalogue.cpp
--- xnu-2050.18.24-orig/iokit/Kernel/IOCatalogue.cpp 2012-12-10 18:24:44.000000000 +0100
+++ xnu-2050.18.24/iokit/Kernel/IOCatalogue.cpp 2012-12-10 19:59:31.000000000 +0100
@@ -74,6 +74,29 @@
#pragma mark Utility functions
#endif

+static void
+UniqueProperties(OSDictionary * dict)
+{
+    OSString * data;
+   
+    data = OSDynamicCast(OSString, dict->getObject(gIOClassKey));
+    if (data) {
+	    const OSSymbol *classSymbol = OSSymbol::withString(data);
+	   
+	    dict->setObject( gIOClassKey, (OSSymbol *) classSymbol);
+	    classSymbol->release();
+    }
+   
+    data = OSDynamicCast(OSString, dict->getObject(gIOMatchCategoryKey));
+    if (data) {
+	    const OSSymbol *classSymbol = OSSymbol::withString(data);
+	   
+	    dict->setObject(gIOMatchCategoryKey, (OSSymbol *) classSymbol);
+	    classSymbol->release();
+    }
+    return;
+}
+
#if PRAGMA_MARK
#pragma mark IOCatalogue class implementation
#endif
@@ -163,7 +186,7 @@
 {
 dict = OSDynamicCast(OSDictionary, obj);
 if (!dict) continue;
- OSKext::uniquePersonalityProperties(dict);
+ UniqueProperties(dict);
	 if( 0 == dict->getObject( gIOClassKey ))
	 {
		 IOLog("Missing or bad \"%s\" key\n",
@@ -243,7 +266,7 @@
 const OSSymbol	   * key;
 unsigned int		   idx;

-    OSKext::uniquePersonalityProperties(matching);
+    UniqueProperties(matching);

 set = OSOrderedSet::withCapacity( 1, IOServiceOrdering,
								   (void *)gIOProbeScoreKey );
@@ -303,71 +326,91 @@
 }

 set = OSOrderedSet::withCapacity( 10, IOServiceOrdering,
-	    (void *)gIOProbeScoreKey );
+									 (void *)gIOProbeScoreKey );
 if (!set) {
	 goto finish;
 }
-
+   
 iter = OSCollectionIterator::withCollection(persons);
 if (!iter) {
	 goto finish;
 }
-
-   /* Start with success; clear it on an error.
-    */
+   
+    /* Start with success; clear it on an error.
+	 */
 result = true;
-
+   
 IORWLockWrite(lock);
 while ( (object = iter->getNextObject()) ) {
-   
+	   
	 // xxx Deleted OSBundleModuleDemand check; will handle in other ways for SL
-
+	   
	 OSDictionary * personality = OSDynamicCast(OSDictionary, object);
-
+	   
	 SInt count;
-
+	   
	 if (!personality) {
		 IOLog("IOCatalogue::addDrivers() encountered non-dictionary; bailing.\n");
		 result = false;
		 break;
	 }
-
-	    OSKext::uniquePersonalityProperties(personality);
-
-	    // Add driver personality to catalogue.
-
- OSArray * array = arrayForPersonality(personality);
- if (!array) addPersonality(personality);
- else
- {	  
-	 count = array->getCount();
-	 while (count--) {
-  OSDictionary * driver;
- 
-  // Be sure not to double up on personalities.
-  driver = (OSDictionary *)array->getObject(count);
- 
-	    /* Unlike in other functions, this comparison must be exact!
-  * The catalogue must be able to contain personalities that
-  * are proper supersets of others.
-  * Do not compare just the properties present in one driver
-  * pesonality or the other.
-  */
-  if (personality->isEqualTo(driver)) {
-	  break;
+	   
+	    if (blacklistEnabled) {
+   OSString *modName = OSDynamicCast(OSString, personality->getObject(gIOModuleIdentifierKey));
+   const char *modNameStr = NULL;
+   if (modName)
+    modNameStr = modName->getCStringNoCopy();
+   if (modNameStr) {
+    boolean_t shouldMatch = TRUE;
+    for (uint32_t n = 0; blacklistMods[n].name; n++) {
+	 if (strcmp(blacklistMods[n].name, modNameStr))
+	  continue;
+	 if (!blacklistMods[n].hits++)
+	  printf("warning: skipping personalities in blacklisted kext %s\n",
+		  modNameStr);
+	 shouldMatch = FALSE;
+    }
+    if (!shouldMatch)
+	 continue;
+   }
  }
-	 }
-	 if (count >= 0) {
-  // its a dup
-  continue;
-	 }
-	 result = array->setObject(personality);
-	 if (!result) {
-  break;
-	 }
+	   
+	    UniqueProperties(personality);
+	   
+	    // Add driver personality to catalogue.
+	   
+	    OSArray * array = arrayForPersonality(personality);
+	    if (!array) addPersonality(personality);
+	    else
+	    {
+		    count = array->getCount();
+		    while (count--) {
+			    OSDictionary * driver;
+			   
+			    // Be sure not to double up on personalities.
+			    driver = (OSDictionary *)array->getObject(count);
+			   
+			    /* Unlike in other functions, this comparison must be exact!
+				 * The catalogue must be able to contain personalities that
+				 * are proper supersets of others.
+				 * Do not compare just the properties present in one driver
+				 * pesonality or the other.
+				 */
+			    if (personality->isEqualTo(driver)) {
+				    break;
+			    }
+		    }
+		    if (count >= 0) {
+			    // its a dup
+			    continue;
+		    }
+		    result = array->setObject(personality);
+		    if (!result) {
+			    break;
+		    }
	 }
-
- set->setObject(personality);	   
+	   
+	    set->setObject(personality);	   
 }
 // Start device matching.
 if (result && doNubMatching && (set->getCount() > 0)) {
@@ -375,11 +418,11 @@
	 generation++;
 }
 IORWLockUnlock(lock);
-
+   
finish:
 if (set)  set->release();
 if (iter) iter->release();
-
+   
 return result;
}

@@ -545,7 +588,7 @@
 if ( !iter )
	 return kIOReturnNoMemory;

-    OSKext::uniquePersonalityProperties( matching );
+    UniqueProperties( matching );

 // terminate instances.
 do {
@@ -754,111 +797,7 @@

void IOCatalogue::reset(void)
{
-    IOCatalogue::resetAndAddDrivers(/* no drivers; true reset */ NULL,
-	    /* doMatching */ false);
-    return;
-}
-
-bool IOCatalogue::resetAndAddDrivers(OSArray * drivers, bool doNubMatching)
-{
-    bool				   result			  = false;
-    OSArray			  * newPersonalities    = NULL;  // do not release
-    OSCollectionIterator * iter			    = NULL;  // must release
-    OSOrderedSet		 * matchSet		    = NULL;  // must release
-    const OSSymbol	   * key;
-    OSArray			  * array;
-    OSDictionary		 * thisNewPersonality  = NULL;  // do not release
-    OSDictionary		 * thisOldPersonality  = NULL;  // do not release
-    signed int			 idx, newIdx;
-
-    if (drivers) {
-	    newPersonalities = OSDynamicCast(OSArray, drivers);
-	    if (!newPersonalities) {
-		    goto finish;
-	    }
-	   
-	    matchSet = OSOrderedSet::withCapacity(10, IOServiceOrdering,
-		    (void *)gIOProbeScoreKey);
-	    if (!matchSet) {
-		    goto finish;
-	    }
-	    iter = OSCollectionIterator::withCollection(personalities);
-	    if (!iter) {
-		    goto finish;
-	    }
-    }
-
-    result = true;
-
 IOLog("Resetting IOCatalogue.\n");
-
-   /* No goto finish from here to unlock.
-    */
-    IORWLockWrite(lock);
-   
-    while ((key = (const OSSymbol *) iter->getNextObject()))
-    {
-	    array = (OSArray *) personalities->getObject(key);
-	    if (!array) continue;
-	    for (idx = 0; (thisOldPersonality = (OSDictionary *) array->getObject(idx)); idx++)
-	    {
-		    if (thisOldPersonality->getObject("KernelConfigTable")) continue;
-		    if (newPersonalities) for (newIdx = 0;
-			    (thisNewPersonality = (OSDictionary *) newPersonalities->getObject(newIdx));
-			    newIdx++)
-		    {
-	    /* Unlike in other functions, this comparison must be exact!
-		    * The catalogue must be able to contain personalities that
-		    * are proper supersets of others.
-		    * Do not compare just the properties present in one driver
-		    * pesonality or the other.
-		    */
-			    if (thisNewPersonality->isEqualTo(thisOldPersonality)) 
-				    break;
-		    }
-		    if (thisNewPersonality)
-		    {
-			    // dup, ignore
-			    newPersonalities->removeObject(newIdx);
-		    }
-		    else
-		    {
-			    // not in new set - remove
-			    // only remove dictionary if this module in not loaded - 9953845
-			    if ( isModuleLoaded(thisOldPersonality) == false )
-			    {
-				    if (matchSet)  matchSet->setObject(thisOldPersonality);
-				    array->removeObject(idx);
-				    idx--;
-			    }
-		    }
-	    }
-    }
-
-	 // add new
-	 for (newIdx = 0;
-		  (thisNewPersonality = (OSDictionary *) newPersonalities->getObject(newIdx));
-		  newIdx++)
-	 {
-		 OSKext::uniquePersonalityProperties(thisNewPersonality);
-		 addPersonality(thisNewPersonality);
-		 matchSet->setObject(thisNewPersonality);
-	 }
-
-   /* Finally, start device matching on all new & removed personalities.
-    */
-    if (result && doNubMatching && (matchSet->getCount() > 0)) {
-	    IOService::catalogNewDrivers(matchSet);
-	    generation++;
-    }
-
-    IORWLockUnlock(lock);
-
-finish:
-    if (matchSet) matchSet->release();
-    if (iter)	 iter->release();
-
-    return result;
}

bool IOCatalogue::serialize(OSSerialize * s) const
@@ -910,7 +849,7 @@
* These functions are no longer used are necessary for C++ binary
* compatibility on i386.
**********************************************************************/
-#if __i386__
+#if __ppc__ || __i386__

bool IOCatalogue::recordStartupExtensions(void)
{  return false;  }
@@ -921,4 +860,4 @@
kern_return_t IOCatalogue::removeKernelLinker(void)
{  return KERN_NOT_SUPPORTED;  }

-#endif /* __i386__ */
+#endif /* __ppc__ || __i386__ */
\ No newline at end of file

diff -Nur xnu-2050.18.24-orig/libkern/c++/OSKext.cpp xnu-2050.18.24/libkern/c++/OSKext.cpp
--- xnu-2050.18.24-orig/libkern/c++/OSKext.cpp 2012-09-17 20:17:17.000000000 +0200
+++ xnu-2050.18.24/libkern/c++/OSKext.cpp 2012-12-10 19:20:38.000000000 +0100
@@ -1925,7 +1925,7 @@
 const char   * versionCString		   = NULL;  // do not free
 const char   * compatibleVersionCString = NULL;  // do not free
 OSBoolean    * scratchBool			  = NULL;  // do not release
-    OSDictionary * scratchDict			  = NULL;  // do not release
+  //  OSDictionary * scratchDict			  = NULL;  // do not release

 if (infoDict) {
	 panic("Attempt to set info dictionary on a kext "
@@ -2066,11 +2066,11 @@

   /* Make sure common string values in personalities are uniqued to OSSymbols.
 */
-    scratchDict = OSDynamicCast(OSDictionary,
-	    getPropertyForHostArch(kIOKitPersonalitiesKey));
-    if (scratchDict) {
-	    uniquePersonalityProperties(scratchDict);
-    }
+    //scratchDict = OSDynamicCast(OSDictionary,
+	  //  getPropertyForHostArch(kIOKitPersonalitiesKey));
+    //if (scratchDict) {
+    //uniquePersonalityProperties(scratchDict);
+    //}

 result = true;

@@ -2130,7 +2130,7 @@

/*********************************************************************
*********************************************************************/
-static void
+/*static void
uniqueStringPlistProperty(OSDictionary * dict, const char * key)
{
 OSString	   * stringValue = NULL;  // do not release
@@ -2153,10 +2153,10 @@

 return;
}
-
+*/
/*********************************************************************
*********************************************************************/
-static void
+/*static void
uniqueStringPlistProperty(OSDictionary * dict, const OSString * key)
{
 OSString	   * stringValue = NULL;  // do not release
@@ -2178,44 +2178,44 @@
 if (symbolValue) symbolValue->release();

 return;
-}
+}*/

/*********************************************************************
* Replace common personality property values with uniqued instances
* to save on wired memory.
*********************************************************************/
/* static */
-void
-OSKext::uniquePersonalityProperties(OSDictionary * personalityDict)
-{
+//void
+//OSKext::uniquePersonalityProperties(OSDictionary * personalityDict)
+//{
   /* Properties every personality has.
 */
-    uniqueStringPlistProperty(personalityDict, kCFBundleIdentifierKey);
-    uniqueStringPlistProperty(personalityDict, kIOProviderClassKey);
-    uniqueStringPlistProperty(personalityDict, gIOClassKey);
+  //  uniqueStringPlistProperty(personalityDict, kCFBundleIdentifierKey);
+    //uniqueStringPlistProperty(personalityDict, kIOProviderClassKey);
+    //uniqueStringPlistProperty(personalityDict, gIOClassKey);

   /* Other commonly used properties.
 */
-    uniqueStringPlistProperty(personalityDict, gIOMatchCategoryKey);
-    uniqueStringPlistProperty(personalityDict, gIOResourceMatchKey);
-    uniqueStringPlistProperty(personalityDict, gIOUserClientClassKey);
-
-    uniqueStringPlistProperty(personalityDict, "HIDDefaultBehavior");
-    uniqueStringPlistProperty(personalityDict, "HIDPointerAccelerationType");
-    uniqueStringPlistProperty(personalityDict, "HIDRemoteControlType");
-    uniqueStringPlistProperty(personalityDict, "HIDScrollAccelerationType");
-    uniqueStringPlistProperty(personalityDict, "IOPersonalityPublisher");
-    uniqueStringPlistProperty(personalityDict, "Physical Interconnect");
-    uniqueStringPlistProperty(personalityDict, "Physical Interconnect Location");
-    uniqueStringPlistProperty(personalityDict, "Vendor");
-    uniqueStringPlistProperty(personalityDict, "Vendor Identification");
-    uniqueStringPlistProperty(personalityDict, "Vendor Name");
-    uniqueStringPlistProperty(personalityDict, "bConfigurationValue");
-    uniqueStringPlistProperty(personalityDict, "bInterfaceNumber");
-    uniqueStringPlistProperty(personalityDict, "idProduct");
+//    uniqueStringPlistProperty(personalityDict, gIOMatchCategoryKey);
+  //  uniqueStringPlistProperty(personalityDict, gIOResourceMatchKey);
+   // uniqueStringPlistProperty(personalityDict, gIOUserClientClassKey);
+//
+//    uniqueStringPlistProperty(personalityDict, "HIDDefaultBehavior");
+//    uniqueStringPlistProperty(personalityDict, "HIDPointerAccelerationType");
+ //   uniqueStringPlistProperty(personalityDict, "HIDRemoteControlType");
+  //  uniqueStringPlistProperty(personalityDict, "HIDScrollAccelerationType");
+  //  uniqueStringPlistProperty(personalityDict, "IOPersonalityPublisher");
+ //   uniqueStringPlistProperty(personalityDict, "Physical Interconnect");
+  //  uniqueStringPlistProperty(personalityDict, "Physical Interconnect Location");
+//    uniqueStringPlistProperty(personalityDict, "Vendor");
+//    uniqueStringPlistProperty(personalityDict, "Vendor Identification");
+//    uniqueStringPlistProperty(personalityDict, "Vendor Name");
+//    uniqueStringPlistProperty(personalityDict, "bConfigurationValue");
+//    uniqueStringPlistProperty(personalityDict, "bInterfaceNumber");
+//    uniqueStringPlistProperty(personalityDict, "idProduct");

-    return;
-}
+//    return;
+//}

/*********************************************************************
*********************************************************************/
@@ -8874,9 +8874,9 @@

/*********************************************************************
 *********************************************************************/
-bool _OSKextInUnloadedPrelinkedKexts( const OSSymbol * theBundleID )
+bool _OSKextInUnloadedPrelinkedKexts( const OSSymbol * __unused theBundleID )
{
-    int unLoadedCount, i;
+    int unLoadedCount, __unused i;
 bool result = false;

 IORecursiveLockLock(sKextLock);
@@ -8889,16 +8889,6 @@
	 goto finish;
 }

-    for (i = 0; i < unLoadedCount; i++) {
-	    const OSSymbol *    myBundleID;	 // do not release
-	   
-	    myBundleID = OSDynamicCast(OSSymbol, sUnloadedPrelinkedKexts->getObject(i));
-	    if (!myBundleID) continue;
-	    if (theBundleID->isEqualTo(myBundleID->getCStringNoCopy())) {
-		    result = true;
-		    break;
-	    }
-    }
finish:
 IORecursiveLockUnlock(sKextLock);
 return(result);

diff -Nur xnu-2050.18.24-orig/libkern/libkern/c++/OSKext.h xnu-2050.18.24/libkern/libkern/c++/OSKext.h
--- xnu-2050.18.24-orig/libkern/libkern/c++/OSKext.h 2012-02-14 01:36:58.000000000 +0100
+++ xnu-2050.18.24/libkern/libkern/c++/OSKext.h 2012-12-10 17:21:56.000000000 +0100
@@ -596,7 +596,7 @@

   /* Converts common string-valued properties to OSSymbols for lower memory consumption.
 */
-    static void uniquePersonalityProperties(OSDictionary * personalityDict);
+    //static void uniquePersonalityProperties(OSDictionary * personalityDict);

 virtual bool			   declaresExecutable(void);	 // might be missing
 virtual bool			   isInterface(void);

diff -Nur xnu-2050.18.24-orig/iokit/Kernel/IOStartIOKit.cpp xnu-2050.18.24/iokit/Kernel/IOStartIOKit.cpp
--- xnu-2050.18.24-orig/iokit/Kernel/IOStartIOKit.cpp 2011-06-02 03:33:41.000000000 +0200
+++ xnu-2050.18.24/iokit/Kernel/IOStartIOKit.cpp 2012-12-10 16:50:02.000000000 +0100
@@ -91,6 +91,16 @@
 IORegistryEntry *  root;
 OSObject *   obj;

+    uint32_t   bootArg;
+ /* kaitek: todo: implement some kind of mechanism whereby the user can specify a
+	 * custom list of kexts to be blacklisted. perhaps categories with the current
+	 * list designated "default" and additional categories like "gfx", etc. */
+
+ if (PE_parse_boot_argn("blacklist", &bootArg, sizeof(&bootArg)) && !bootArg) {
+	    blacklistEnabled = FALSE;
+	    printf("warning: disabling kext blacklist\n");
+    }
+   
 root = IORegistryEntry::initialize();
 assert( root );
 IOService::initialize();
@@ -120,6 +130,24 @@
// From <osfmk/kern/debug.c>
extern int debug_mode;

+   
+    /* kaitek / qoopz: blacklist of common kexts that are known to be problematic or undesirable
+	 * for virtually all non-apple hardware. see notes in StartIOKit(). */
+
+ boolean_t blacklistEnabled = TRUE;
+ blacklist_mod_t blacklistMods[] = {
+	 { "com.apple.driver.AppleIntelMeromProfile", 0 },
+	 { "com.apple.driver.AppleIntelNehalemProfile", 0 },
+	 { "com.apple.driver.AppleIntelPenrynProfile", 0 },
+	 { "com.apple.driver.AppleIntelYonahProfile", 0 },
+	 { "com.apple.driver.AppleIntelCPUPowerManagement", 0 }, // must be added to use in 10.6.1+
+	 { "com.apple.iokit.CHUDKernLib",    0 },
+	 { "com.apple.iokit.CHUDProf",   0 },
+	 { "com.apple.iokit.CHUDUtils",   0 },
+	 { NULL,	  0 }
+ };
+
+   
/*****
 * Pointer into bootstrap KLD segment for functions never used past startup.
 */

So we need a new blacklister in time... but at least it boots up now...

Also if AMD requires some mods to the loading algo's we'll need to make them...

For now, please test it and if it doesn't work with latest Xcode (instant reset) somebody can recompile it with Xcode 3.2.6

I hope it works though... it does for Intel now... :thumbsup_anim:

Also the ssse3emu needs some more work for 64bit... but I slightly modified the code allready so it does compile (untested though...)

 

@Andy,

 

Besides the emu, what is the difference in the patches for AMD CPUs and legacy Intel CPUs? Or are they one and the same (I'm speaking strictly about the kernel, not any binpatching)

 

I have a legacy Intel rig (breadboarded lol) that I can test kernel development with. Assuming we're working on legacy Intel as well.

 

There is also something I'm wondering: what about Lion? I'll try applying the diff to the Lion kernels and see what happens. :)

Unfortunately legacy (32-bit) CPU's don't stand a change on ML...

Lion no problem as that supports 32-bit kernel and CPU's (some legacy work has been done so that shouldn't be a problem...).

ML removed some of the i386 versions of some of the kexts so you can't boot a 32-bit kernel at all on ML.

Too bad though... :hammer:

xnu-2050.18.24-test2.diff.zip

AnV_kernel.zip

Link to comment
Share on other sites

Congratulations, Andy! Going to test the kernel later tonight.

 

About Pooky's rig, i think it's a Pentium-D, so it's not exactly a legacy (32-bit) intel CPU, but an unsupported (by Apple) 64-bit which cannot run ssse3 instructions (so it's at the same boat as all us AMD users).

 

As always, please you guys post pics and vids of your tests. Thank you!

 

Hey guys

 

Currently at work and i have a number of FX4100 (about 30) at my disposal at the moment. ive not done the hackintosh scene for a while however ive been reading this thread for the last week and would like to offer my services/ hardware for tests....

 

all i need is to be told what i need to do or what to download

 

Regards

Slowie

 

Thank you very much! Your help will surely be very welcome!

Link to comment
Share on other sites

Exactly. Sorry I didn't specify, it is a Pentium D. :)

 

I was thinking legacy Intel = pre-Core CPUs.

 

Haha :D I have like thousands of those CPUs, Pentium D, Celeron D, Pentium 3, Pentium 4, Celeron Mobile :D

They can run SL just fine, never tried Lion (ML is impossible atm I think :|)

Link to comment
Share on other sites

@akimoa: did you update to 10.8.2? It is necessary...

Also: still need to update blacklister. Will build a new kernel later today...

Link to comment
Share on other sites

Also in your case it panics on AppleEFI kexts. Untill I get the blacklister fixed you need to remove AppleEFIRuntime.kext and AppleIntelCPUPowerManagement kexts. After that it should get further... Also I have some ideas about fixing the ssse3emu in 64bit mode. Will keep you posted... the trick will be pushing the rax register. Putting the pointer there. Placing the pointer into 16(%%ebp). Popping back into rax and last popa (.byte 0x61)

Link to comment
Share on other sites

Also in your case it panics on AppleEFI kexts. Untill I get the blacklister fixed you need to remove AppleEFIRuntime.kext and AppleIntelCPUPowerManagement kexts. After that it should get further... Also I have some ideas about fixing the ssse3emu in 64bit mode. Will keep you posted... the trick will be pushing the rax register. Putting the pointer there. Placing the pointer into 16(%%rbp). Popping back into rax and last popa (.byte 0x61)

Link to comment
Share on other sites

Sometime soon (hopefully tomorrow) I'll do some testing on my Athlon II x4 640. I'll install ML with MyHack on my Intel hack, update it to 10.8.2, remove AppleEFI.kext and AppleIntelCPUPowerManagement.kext, then try it on my AMD machine with AnV's kernel. Anything else I should know before I begin?

 

Also, I have an SSSE3 and SSE3-less 32-bit only Intel Pentium M 1.8 GHz that might be useful for testing the Lion kernel.

 

-instant idiot

Link to comment
Share on other sites

 Share

×
×
  • Create New...