Subject: Re: Install guides (was Re: HI JASON, WELCOME TO OPEN FIRMWARE!)
To: Bill Studenmund <wrstuden@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: port-macppc
Date: 03/17/2005 16:01:06
On Wed, Mar 16, 2005 at 12:12:04PM -0800, Bill Studenmund wrote:
> On Wed, Mar 16, 2005 at 05:20:13PM +0000, Patrick Welche wrote:
> > On Wed, Mar 16, 2005 at 08:01:29AM -0800, Michael Wolfson wrote:
> > > Well, the key thing would be for NetBSD (and in particular sysinst) to 
> > > be able to read and write to OF.
> > 
> > I thought it could - at least, there is a OF_read and OF_write in bootxx.c..
> 
> Those are for reading and writing a file. OF_read is how we actually read 
> the blocks and OF_write is how output messages get displayed.

Ah - how about this in Locore.c:

#ifdef  __notyet__      /* Has a bug on FirePower */
int
OF_setprop(int handle, char *prop, void *buf, int len)
{
        static struct {
                char *name;
                int nargs;
                int nreturns;
                int phandle;
                char *prop;
                void *buf;
                int len;
                int size;
        } args = {
                "setprop",
                4,
                1,
        };

        args.phandle = handle;
        args.prop = prop;
        args.buf = buf;
        args.len = len;
        if (openfirmware(&args) == -1)
                return -1;
        return args.size;
}
#endif


Cheers,

Patrick