PPC kernels: More Pegasos II-friendly kernel config

David Woodhouse dwmw2 at infradead.org
Fri Jul 29 16:17:31 UTC 2005


On Mon, 2005-07-18 at 10:26 +0800, RChan wrote:
> While Pegasos II is not officially support as a PPC platform, some
> minor kernel tweaks would make it more friendly out-of-the-box for
> Pegasos II hackers. Would the maintainers kindly consider the
> following changes:

These are done. The rawhide kernel is running on my Pegasos. The rawhide
userspace even works as long as I don't let ld.so get prelinked, and
with today's update to binutils I think we might have firefox and
openoffice.org back again for PPC.

> 2. (This part is hard, I'm not sure I understand the issues myself -
> it's necessary to avoid Pegasos II people from having to rebuild from
> kernel source.) Pegasos II needs a zImage.initrd.chrp kernel to boot
> (i.e. a combined zImage.chrp & initrd) instead of a separate vmlinux +
> initrd, therefore some additional object files need to be distributed
> with the kernel package. I do not understand exactly why yaboot
> (patched with Amiga partition support) does not work with separate
> vmlinux and initrd on Pegasos II so at the moment zImage.initrd.chrp
> is needed.

The problem seems to be that the OF on Pegasos returns zero from its
'claim' method instead of -1 to indicate failure.

By using a combined image you just happen to make sure the first attempt
at allocating memory for it succeeds. Thus yaboot doesn't load the image
to location 00000000 and crash the machine in the process.

A simple workaround (below) in yaboot's prom_claim() function makes it
work properly on the Pegasos, although I'm not sure it's really
something we should do in the general case -- it would be better to fix
the Pegasos SmartFirmware to conform to the OF spec.

We also need to make ybin deal with an ext2-formatted boot partition
(which is simple enough), make a suitable FORTH boot script, and make
nvsetenv work on Pegasos. And probably some more when we get to that
point, as ever... :)

--- prom.c~     2003-11-04 09:13:17.000000000 +0000
+++ prom.c      2005-07-29 12:28:23.000000000 +0100
@@ -547,7 +547,10 @@ prom_sleep (int seconds)
 void *
 prom_claim (void *virt, unsigned int size, unsigned int align)
 {
-     return call_prom ("claim", 3, 1, virt, size, align);
+     void *ret = call_prom ("claim", 3, 1, virt, size, align);
+     if (virt && !ret)
+         ret = (void *)-1;
+     return ret;
 }

 void



-- 
dwmw2




More information about the fedora-devel-list mailing list