grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] rough Mac OS X loader


From: Hollis Blanchard
Subject: [patch] rough Mac OS X loader
Date: Sun, 1 Jan 2006 18:38:00 -0600

I've been working on a Mac OS X loader for GRUB. During the usual OS X boot process, the firmware loads the BootX bootloader (which is a hybrid CHRP script and XCOFF binary), which has a Mach-O loader and loads the OS X Mach kernel.

Rather than trying to load and run the Mach kernel directly, I chose to focus on the BootX bootloader, since it seems to do a fair amount of setup work that I would rather not duplicate in GRUB. Also important: if OS X is ever updated (for example, the parameter-passing mechanism between BootX and the kernel), we would need to track those changes, which is a lot more long-term maintenance.

Unfortunately, BootX attempts to claim all memory from 0 to 96MiB, which conflicts with GRUB running in this area. To get around that problem, I install a trampoline just above 96MiB which releases all of GRUB's memory and jumps into BootX. It's a bit of a hack, and for example if the code being copied exceeds some fixed size (currently 0x200 bytes) things will fail mysteriously. I'm open to suggestions on that problem.

I'm afraid I don't know if this code works yet. Because the current HFS+ driver doesn't support the HFS wrapper found on all Apple filesystems, I can't boot from an HFS+ installation. I've copied BootX to a plain HFS partition, and that works somewhat (I expect it fails when it cannot find /mach_kernel). I'm relatively optimistic, and I'm working on the HFS wrapper support now.

There are a few rough edges still, but if there are no comments I will be checking this patch in largely unchanged some day.

-Hollis

Attachment: macosx.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]