[haiku-development] Re: PowerPC and the APM

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 12 Aug 2008 21:19:20 +0200 CEST

> I've been hacking away at (finally) getting the powerpc version
> booted
> (again?). First of all, the openpic module, crucial to the powerpc
> boot sequence, doesn't compile. I have a patch, but it mostly just
> does whatever needed to <i>get</i> it compiled; it will definitely
> have problems. I'll need to hack around the kernel for more time
> before I figure out what I need to do.

Yes, maybe we should have a generic PIC loading code anyway...
Just send the diff, I'll commit it.

> But, once openpic compiles, jam struggles through the rest and
> finally
> finishes. Technically, it succeeded, but the disk isn't bootable. I'm
> not even really quite sure what it produced; but it's nothing that I
> can recognize.

Well it can't be anything else than a BFS *partition* image.
That is only the content of the filesystem itself, without any
partition table.
That's the reason it breaks on some emulators I think btw, they expect
part tables sometimes.

> Apple, at the very least, uses the Apple Partition Map (APM) layout
> to
> boot. OpenFirmware, the Apple's New World computer's BIOS, looks at
> the first (technically, second: the APM itself counts as a partition)
> partition for a file that it can boot. (more info here:
> http://www.kernelthread.com/mac/osx/arch_boot.html and here [PDF]:
> http://www.cs.rpi.edu/~gerbal/BootX.pdf . So, this is going to be my
> main priority over the next few days: creating an image with the
> three
> partitions on it (the APM, the bootstrap, 800k HFS partition, and the
> final BFS partition, along with a primitive bootloader.

We already do support APM, at least there is code for it and the
bootloader use it, see src/system/boot/loader/Jamfile.

If you want to play with HFS, I found some old naive mkhfs code I wrote
that used the libhfs, I did that when I ported PearPC to test stuff...

See
http://revolf.free.fr/beos/mkhfs-beos-src.zip
I don't recall the licence for libhfs, but mkhfs.c itself can be reused
under MIT without problem.

If I recall well, libhfs actually creates a full disk image, that is
with the partition table. But maybe it's optional. I wrote that long
ago.

> The cool thing about this map is that, theoretically, both ppc and
> apple's i386 macs can boot it, using a universal binary. So if I get
> this image working, intel macs will be able to boot this sucker.
> Cool,
> 'ey?

Our build system doesn't support that yet, so doing so would have to be
manual.
Still funny.

François.

Other related posts: