PowerPC, gpart and multiboot (Was: Trying to install FreeBSD 8.2-RC1 on a PowerMac G5)

Nathan Whitehorn nwhitehorn at freebsd.org
Sun Mar 20 22:06:03 UTC 2011


On 03/20/11 17:00, Torfinn Ingolfsen wrote:
> Anyway, here is my plan for multiboot:
> root at kg-g5# gpart show ad0
> =>        18  625142430  ad0  APM  (298G)
>           18       1600    1  apple-boot  (800K)
>         1618  155189248    2  freebsd-ufs  (74G)
>    155190866    8388608    3  freebsd-swap  (4.0G)
>    163579474       1600    4  apple-boot  (800K)
>    163581074  155189248    5  freebsd-ufs  (74G)
>    318770322  306372126       - free -  (146G)
>
> The boot code in partition 4 (ad0s5) will be modified so that it boots from
> the next partition (the partition after the one the bootcode itself is loaded from)
> instead of the first partition. Do you think it's doable?
>
> I have examined boot1.c (in /usr/src/sys/boot/powerpc/boot1.chrp) but I don't
> really understand how it is finding the partition to boot / load the kernel from.
>
> Can anyone explain it?

I wrote it, so hopefully I can provide some insight. At line 423 of 
boot1.c, it loops through the first 16 (arbitrary) partitions on the 
device from which it was booted, then tries to find loader on the first 
UFS partition it can mount. This isn't actually a good algorithm, but it 
works pretty well.

Making it choose the first following UFS partition might be a good idea, 
or do something useful with its arguments.
-Nathan


More information about the freebsd-ppc mailing list