grub-devel
[Top][All Lists]
Advanced

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

patch for PPC Old World Macintosh


From: Hollis Blanchard
Subject: patch for PPC Old World Macintosh
Date: Sun, 29 Aug 2004 18:52:42 -0500

Seeing that Marco did the hard work of porting grub2 to New World Power Mac, I though I'd try to support Old World (i.e. Macs with sucky Open Firmware).

'quik' is the OF-based Old World bootloader for Linux. Unfortunately a stage1 is needed due to firmware limitations, so I am using a slightly modified quik stage1 (it now "claims" the memory it uses). I have also slightly modified quik installer (which installs the stage1 to disk) so that it sets the stage2 base to be 2M, grubof's link address. Long-term it may be worthwhile to copy quik's stage1 into grub2's source tree, but the quik *installer* is appalling code and probably warrants a from-scratch rewrite (maybe NetBSD's installboot(8) meets our needs).

This patch adds basic support for Old World, enough to get to the rescue or normal prompt. Most of the problems were related to the memory layout. I have not yet fixed loading from disk; it shouldn't be hard but I thought I should submit what I have working now.

This patch uses the "/memory/available" property to find memory. Works for me, but it is not very conservative. I have it on good authority that Old World firmware defaults to 4M-5M, so I think this is ok until/unless we find a machine that doesn't work...

ALIGN_UP doesn't need to be in mm.h, but it seemed as good as any place to put it.

-Hollis

2004-08-29      Hollis Blanchard        <address@hidden>
* boot/powerpc/ieee1275/cmain.c: check for quik stage1. If present, use r3 rather than r5 as the Open Firmware entry point; claim grub's BSS range since quik
        stage1 doesn't; claim OF's memory range for it (since it doesn't);
* boot/powerpc/ieee1275/crt0.S: zero BSS here since it is required on Old World pmac.
        If it isn't required, it can't hurt anyways.
        Pass r3-r5 through unchanged to let cmain() detect quik.
        * include/grub/mm.h: add ALIGN_UP macro.
* kern/powerpc/ieee1275/init.c: add a "trap" to abort() so we drop back to Open
        Firmware.
Claim and use all memory that's listed as available in the /memory/available property.

Attachment: grub-oldworld-mem.diff
Description: Binary data


reply via email to

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