Jump to content

Some infos


skater
 Share

2 posts in this topic

Recommended Posts

I found this text file on an install DVD .

See if it can help you .

Talking about the "unable to find root device" problem towards the end .

 

 

 

 

 

BIG NOTE: I'm writing this AFTER the fact. Meaning, I took some notes while doing it but not enough to recant my exact steps and describe them accurately.

 

First real thing I did on my image was patch for SSE2 booting (Patch the DVD boot sector so it can boot on SSE2 machines), and copy a new oah750d so I can install.

 

After that, I tried the same method everyone else tries, update the Extensions folder on the DVD with the ones I think I need and burn. This didn't work.

 

What I noticed is every time time I would change anything in the /System/Library/Extensions directory, during the booting process the /System/Library/Extensions.mkext file wouldn't load and instead it would attempt to load all of the extensions in that directory.

The extensions directory on the DVD is very small. Not much in here. So that's why it will always fail if it doesn't load the Extensions.mkext file.

 

So after digging (when I started this I didn't have any knowledge of extensions, kexts or mkexts, or anything related to how Darwin really worked) I found out a few facts:

1. The Extensions.mkext is usually (I'll explain) a file containing all of the necessary kexts necessary to 'boot' the system. This file is generated based on specific flags in each kext's Info.plist file stating if its a necessary kext for booting. This file is generated, and regenerated on demand or whenever the system detects the Extensions.mkext timestamp is older than the timestamp on the Extensions directory.

2. When you add a new directory to the Extensions directory, the Extensions directory's timestamp itself gets modified and this tells the system to ignore the Extensions.mkext file because it's outdated and there are new Extensions so the system should rebuild the cache.

 

Now, #1. This works differently from the DVD and what gets installed on the HD. Everything works as described once installed on the HD, but the install DVD seems to already contain a pre-packaged Extensions.mkext that contains all of the necessary extensions to boot the system (At least on a real native Development system). They probably did this because they know the system can't create a new Extensions.mkext file on the DVD because, well, it's read only.

 

And #2. This kicked my ass all around and I don't know why. I could NEVER get it to read my Extensions.mkext once I modified the Extensions directory in any way. When I removed the entire Extensions directory, the system would then read the mkext file again but it wouldn't boot. I had to actually export all of the Extensions from the mkext and merge what is in the /System/Library/Extensions directory on the DVD. This is where and why I'm getting the Extension already loaded conflicts when booting from the DVD and what I think is the issue with the USB drivers on some machines.

 

So, up to this point, I learned that since I can't ever get the Extensions.mkext file to load AND keep the Extensions directory, I decided to just package everything I need into the Extensions.mkext file. I tried to just put all my extensions in the Extensions directory and removing the Extensions.mkext file but that was REAL slow too boot (And I don't entirely remember if it worked or not). But it turned out not to be important to keep the Extensions directory on the DVD because it doesn't seem to use this directory anyway. I'll explain this later also. And remember, the Extensions.mkext file is just a cache file and what I learned later is the system does NOT copy this file from the DVD to the HD. I'll explain later.

 

I found there are three utilities I needed:

 

mkextunpack - this will extract mkext files. I used this to extract the Extensions.mkext from the Darwin DVD and the OSX86 DVD.

kextcache - This is what you use to repack your own kextcache file.

lsmod - This will allow you to list what is inside "bill of materials" file and will tell you what is in the PAX file.

pax - This allows you to extract/create PAX files.

 

The biggest issue for me was when booting from the OSX86 DVD I would get the "still waiting for root device".

 

This seemed to be because it couldn't find my hard drives, which is partially true. It actually can't find your controllers. When it's 'waiting for root device' its actually waiting to find the DVD you're booting from. That's what it considers the "root device" at that point, since obviously we haven't setup any hard drives yet so there are no other root devices.

 

I installed Darwin on my machine and watched the install. I compared this to booting the OSX86 Dev DVD. The OSX Dev DVD would freeze up with the "looking for root device" prior to getting to this:

 

AppleIntelPIIXPATA: ICH5 ATA/100 (CMD 0x1F0, CTR 0x3F4, IRQ 14, BM 0xf000

AppleIntelPIIXPATA: ICH5 ATA/100 (CMD 0x170, CTR 0x374, IRQ 15, BM 0xf008)

 

Ok, so the issue is probably with AppleIntelPIIXPATA. Let's check them.

 

In order to do this, I extracted all of the extensions for Darwin and OSX86 using mkextunpack. You have to unpack both the PPC and the i386 versions from the OSX86 Dev DVD but only i386 from Darwin. I'm using Darwin for X86 of course.

 

to do, I created 3 directories:

 

drwxr-xr-x 232 root wheel 7888 Aug 28 17:40 extensions.darwin801.mkext.i386

drwxr-xr-x 190 root wheel 6460 Aug 28 17:46 extensions.osx86.mkext.i386

drwxr-xr-x 255 root wheel 8670 Aug 28 17:47 extensions.osx86.mkext.ppc

 

*Note - You will have to work as root. Or you'll be sudo'ing every command. These files need to all have the ownership of root:wheel in order to be repacked.

 

So now let's compare the AppleIntelPIIXPATA (I really don't need the PPC directory and I won't even compare anything in here for now, but I want to keep this so I can repack these into the Extensions.mkext)

 

-rwxr-xr-x 1 root wheel 76408 Aug 28 17:40 extensions.darwin801.mkext.i386/AppleIntelPIIXATA.kext/Contents/MacOS/AppleIntelPIIXATA

-rwxr-xr-x 1 root wheel 76712 Aug 28 17:46 extensions.osx86.mkext.i386/AppleIntelPIIXATA.kext/Contents/MacOS/AppleIntelPIIXATA

 

Slightly different sizes... I'm going to assume these are very similar, probably contain the same code basically.

 

Let's check the Info.plist files.

 

-rwxr-xr-x 1 root wheel 10282 Aug 28 17:40 extensions.darwin801.mkext.i386/AppleIntelPIIXATA.kext/Contents/Info.plist

-rwxr-xr-x 1 root wheel 3275 Aug 28 17:46 extensions.osx86.mkext.i386/AppleIntelPIIXATA.kext/Contents/Info.plist

 

Woah, very different. Seems the Info.plist contains information about the devices it should identify in the system to load this driver. It looks like Apple removed all but the required devices that are in the Development machine from being recognized, so this extension never loads and sees hardware other than hardware in the Devlelopment machine.

 

This theory was confirmed by opeing the plist file with the "Property List Editor". The OSX86 version contains 4 entries under "IOKitPersonalities", ICH6 ATA/100, ICH6 Serial ATA, Parallel ATA, Serial ATA. The Darwin version contains 17 entries, ICH ATA, ICH0 ATA, ICH2, ICH3, ICH4, ICH5, and so on. There's my ICH5.

 

I was afraid to replace the actual binary, thinking the binary file may have more/different code in that is needed for OSX86, so instead I just copied Darwin's Info.plist file.

 

I also thought I should add some other extensions that Darwin showed in kextstat when running, such as AppleI386PCI.kext, AppleI386GenericPlatform.kext, ApplePS2Controller.kext.

 

*Note: When extracting the kext's from the mkext files, you will lose the structure that the are actually stored with in the /System/Library/Extensions directory. They are stored 'flat' inside the mkext. For instance, on the Darwin CD, there is a "ApplePS2Controller.kext" which inside contains ApplePS2Keyboard.kext, ApplePS2Mouse.kext, ApplePS2Trackpad.kext. I had added just "ApplePS2Controller" from the Darwin CD which contained these 3 directories, to the mkext. If you extract the mkext, you will see the other 3 PS2 directories right under the root of your extracted directory instead of under ApplePS2Controller.kext. If you didn't gather this yet, .kext is basically just a directory... same as .pkg and .mpkg and a ton of other things in OSX. You can get into this by right clicking and picking "Show Package Contents" or get to it in a shell by just changing directories.

 

I also added the extensions I originally found on the OSX86 DVD under /System/Library/Extensions, which is where I think some of my conflicts are coming from when booting from the DVD... working on fixing this.

 

So, the darwin Extensions I added were:

JUST the Info.plist from AppleIntelPIIXATA.kext

AppleGenericPCATA.kext (Found in /System/Library/Extensions/IOATAFamily.kext/Contents/PlugIns/ on the Darwin CD)

AppleOnboardPCATA.kext (/System/Library/Extensions/IOATAFamily.kext/Contents/PlugIns/)

AppleVIAATA.kext (/System/Library/Extensions/IOATAFamily.kext/Contents/PlugIns/)

ApplePS2Controller.kext (Contains ApplePS2Keyboard.kext, ApplePS2Trackpad.kext, ApplePS2Mouse.kext)

 

So I ended up with these directories on my HD.

 

drwxr-xr-x 8 root wheel 272 Aug 28 21:11 extensions.osx86.cd

drwxr-xr-x 7 root wheel 238 Aug 28 21:08 extensions.osx86.mkext.additional

drwxr-xr-x 189 root wheel 6426 Aug 28 21:07 extensions.osx86.mkext.i386

drwxr-xr-x 3 root wheel 102 Aug 28 21:07 extensions.osx86.mkext.i386.old

drwxr-xr-x 255 root wheel 8670 Aug 28 17:47 extensions.osx86.mkext.ppc

 

Directories should be obvious, the extensions.osx86.cd contains all of the extensions on the osx86 cd, mkext.additional contains the additional extensions i'm adding to the mkext, mkext.i386 and mkext.ppc are the original extracted extensions and mkext.i386.old contains the old extensions I pulled out of mkext.i386 (Currently only contains the Info.plist from AppleIntelPIIXATA)

 

So to build your mkext, you do this:

 

kextcache -a i386 -a ppc -m Extensions.mkext extensions.osx86.cd extensions.osx86.mkext.i386 extensions.osx86.mkext.ppc extensions.osx86.mkext.additional

 

You should end up with a file that looks like this:

-rw-r--r-- 1 root wheel 17508393 Aug 28 21:11 Extensions.mkext

 

*Note: the size is different now than what's on the test dvd because I'm continuously changing/adding things.

 

Great! Take that Extensions.mkext and put it on your DVD, remove the Extensions directory and burn.

 

Reboot.

 

"Your hardware configuration is not supported by Darwin x86".

 

{censored}.

 

I patched the boot sector on the DVD, but when the new drives/partitions were initialized, they weren't patched.

 

I edited the three boot files I found that contained the same string that I modified on the DVD, boot, boot1u and cdboot.

 

Reburn... reboot...reinstall... reboot (probably could have fixed it other ways, but I didn't care)

 

*Note: I got passed this initially by just leaving the DVD in. Since that was patched, that boot loader would start first and if I didn't hit a key, it wouldn't try installing, but instead just boot OSX86 on the HD.

 

Success! Sorta.

 

Now, OSX86 see's my DVDROM drive and Hard drives just fine.

The installer installs and everything installs! Reboot!

 

Uh oh. Gray screen with the circle with a line through it.

 

That basically means the same thing, "unable to find root device" (this time it is looking for your hd)

 

Boot to Darwin and look at the volume. None of my extensions got copied to the HD.

 

Guess what. Extensions are not copied from the mkext... or the /System/Library/Extensions directory from the DVD obviously because there are so few of them in there to begin with. Extensions are actually in the "Essentials.pkg" You can see them by going on the DVD and going into /System/Installation/Packages/Essentials.pkg/Contents and typing "lsbom Archive.bom"

 

Ok, time to modify the Archive to contain the right extensions..

 

.... and after about an hour or two of trying that, I gave up. Basically I ungziped the Archive, extracted with pax, tried to repackage and create a new .bom (bill of materials) file. Didn't work. During install OSX would puke on it and give me errors such as "BomFatalError - cpio read error: bad file format" and "Package Authoring Error: Package "Essentials.pkg" is using a depreciated archive. Ok so whatever.

 

I decided to create my own packages that contained the extensions I needed. I also created a package to copy the SSE2 hacks over that Maxxuss has made.

 

(its getting late and I'm tired of typing this, want to get back to hacking, so the rest will be short)

 

I created these packages, found the information on how to modify the installer and added them in.

 

From the darwin install CD I decided I wanted to use the IOATAFamily.kext but I was afraid of putting the entire thing out there, knowing the Darwin version will only contain i386 versions (won't be fat) and the binaries may not contain the same functions.

 

Other info:

 

On my i865 based machine, rebooting doesn't work. I get stuck at "MACH Reboot" (if I booted with -v) otherwise it sits there with the little spinny thing. Shutting down however works fine, and the machine powers off properly.

Setting my HD to never sleep doesn't work. The HD still goes to sleep.

Link to comment
Share on other sites

  • 10 months later...

Through searching I have ended up here...

 

I want to modify the Extensions.mkext so that I can have native Sil-3132 sata card recognized at boot so that I can have SATA support on my Nforce 4 mobo. Up until now I haven't been able to get a working copy using SuperDuper! or CCC so I thought maybe an install DVD with the proper goodies loaded up by the Extensions.mkext would be the way to go.

 

Anybody with thoughts should feel free to let me know.

 

joneSi

 

EDIT: For those that want more info on how this can be done, read the link posted here http://forum.insanelymac.com/index.php?act...ite=mkextunpack

Link to comment
Share on other sites

 Share

×
×
  • Create New...