[OpenBIOS] QEMU OpenBIOS booting?

Steven Noonan steven at uplinklabs.net
Sun Apr 19 21:53:50 CEST 2009


On Sun, Apr 19, 2009 at 12:47 PM, Laurent Vivier <Laurent at lvivier.info> wrote:
> Le dimanche 19 avril 2009 à 11:59 -0700, Steven Noonan a écrit :
>> On Sun, Apr 19, 2009 at 1:24 AM, Laurent Vivier <Laurent at lvivier.info> wrote:
>> > Le dimanche 19 avril 2009 à 00:50 -0700, Steven Noonan a écrit :
>> >> On Tue, Apr 14, 2009 at 10:46 PM, Steven Noonan <steven at uplinklabs.net> wrote:
>> >> > On Sun, Apr 12, 2009 at 1:39 AM, Laurent Vivier <Laurent at lvivier.info> wrote:
>> >> >> OpenBIOS is not able to boot MacOS X.
>> >> >
>> >> > Well, that's a silly limitation. Is there a reason this isn't
>> >> > implemented? I see that the Mac-on-Linux OpenBIOS version has such
>> >> > support, so it seems strange that the QEMU version does not.
>> >>
>> >> I don't know if anyone here is actually interested (this list seems
>> >> -very- quiet), but...
>> >
>> > Hi,
>> >
>> >> I've been hacking at OpenBIOS for a bit, and I got it to properly read
>> >> Mac OS X discs (it kept failing because it would hit an Apple
>> >> Partition Map header instead of an HFS+ filesystem header). I'm
>> >> working on adding an XCOFF loader, too, so it should be able to boot
>> >> Mac OS X soon.
>> >
>> > You can copy it from OpenHackWare.
>> > I made some tests and it seems to have some memory conflicts between
>> > MacOS kernel and OpenBIOS.
>
> In fact what I have is a Mach-O loader which load mach_kernel from "/".
>
>> > Good Luck.
>> >
>>
>> Two more pre-XCOFF loader commits up:
>> http://github.com/tycho/openbios/commit/e43daa3447b5ce4a2b05b2f32882e49891156200
>> http://github.com/tycho/openbios/commit/7023b78a10f5632fd08d4749615efd3e73ab1036
>
> Seems good but do you really need to check for embedded XCOFF in this
> patch and are you really able to execute the boot-script ?

Yes, it does properly execute the boot-script.

And no, it doesn't actually _check_ for an XCOFF, despite the comment
I added. I suppose these lines could be removed from that patch:

+
+    /* check for an embedded XCOFF binary */
+
+    /* eat newline */
+    if (read_io(fd, tagbuf, 1) < 0)
+        goto badf;
+
+    /* eat '\x04', ASCII 'end-of-transmission' */
+    if (read_io(fd, tagbuf, 1) < 0)
+        goto badf;
+
+    /* next bytes should be XCOFF magic */
+
+    /* TODO: Add XCOFF loader here. */
+

But they don't have any side effects. They are essentially just prep
work for loading an embedded XCOFF which would begin after consuming
the two bytes after the CHRP-BOOT block.

>
> In Panther Install CD, BootX is:
>
> <CHRP-BOOT>
> <COMPATIBLE>
> MacRISC MacRISC3 MacRISC4
> </COMPATIBLE>
> <DESCRIPTION>
> Boot Loader for Mac OS X.
> </DESCRIPTION>
> <OS-BADGE-ICONS>
> </OS-BADGE-ICONS>
> <BOOT-SCRIPT>
> ...
> <BOOT-SCRIPT>
> load-base
> begin
>  dup 6 " &lt;/CHRP" $= if
>  6 + dup 6 " -BOOT&gt;" $= if
>   8 + true
>  else
>   false
>  then
>  else
>  1+ false
>  then
> until
> ( xcoff-base )
> load-size over load-base - -
> ( xcoff-base xcoff-size )
> load-base swap move
> init-program go
> </BOOT-SCRIPT>
> </CHRP-BOOT>
> [...XCOFF HERE]
>
>



More information about the OpenBIOS mailing list