All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Cc: devel@lists.laptop.org
Subject: Re: GRUB on OLPC / XO
Date: Tue, 15 Jan 2008 13:06:43 +0100	[thread overview]
Message-ID: <20080115120643.GD31275@thorin> (raw)
In-Reply-To: <87hchf2ulp.fsf@xs4all.nl>

On Tue, Jan 15, 2008 at 12:31:30PM +0100, Marco Gerards wrote:
> Robert Millan <rmh@aybabtu.com> writes:
> 
> Hi,
> 
> > I've been working for a few hours in a GRUB port to i386/OFW.  There's
> > quite a bit of things that need cleanup/fix before it can be considered
> > complete, but it's in a stage that boots and lets you do basic things (like
> > listing storage devices).
> 
> OLPC is OF!?  I didn't expect this :-).  Who made the firmware?

Mitch Bradley (author of Open Firmware).

> > I'll be gradually integrating this into official GRUB tree.  In the meantime,
> > if you want to try it:
> >
> >   - checkout GRUB cvs (grub2 module)
> >   - apply attached patch
> >   - ./autogen.sh && ./configure --with-platform=ieee1275 && make kernel.elf
> >
> 
> Great!  I'll just review the patch! :-)

Please don't.  It's not meant for review, was just a proof of concept.  The
patches I actually intend to get merged are being sent separately (see my later
mails on this).

Oh well, too late.. :-)

> > +COMMON_ASFLAGS	= -m32 -nostdinc -fno-builtin
> > +COMMON_CFLAGS	= -ffreestanding -mrtd -mregparm=3
> > +COMMON_LDFLAGS	= -nostdlib -static -lgcc
> 
> Why mregparm?  I don't think we need this for OF?  Do you call
> assembler functions?

OFW expects %eax to be the first parameter in callbacks.  Other than this,
I assumed -mregparm is a useful size optimization.  Is that not it?  Why
do we have it on i386-pc then?

> >    /* Load pre-loaded modules and free the space.  */
> >    grub_register_exported_symbols ();
> > -  grub_load_modules ();
> > +//  grub_load_modules ();
> 
> Why?

I still don't know.  Memory corruption I think.  I'm investigating.

> > diff -x '*.mk' -x '*~' -x CVS -x .svn -x configure -x config.h.in -Nurp ../../grub2/kern/powerpc/ieee1275/cmain.c ./kern/powerpc/ieee1275/cmain.c
> > --- ../../grub2/kern/powerpc/ieee1275/cmain.c	2007-12-30 09:52:05.000000000 +0100
> > +++ ./kern/powerpc/ieee1275/cmain.c	2008-01-12 03:12:01.000000000 +0100
> > @@ -58,7 +58,7 @@ grub_ieee1275_find_options (void)
> >    grub_ieee1275_finddevice ("/options", &options);
> >    rc = grub_ieee1275_get_property (options, "real-mode?", &realmode,
> >  				   sizeof realmode, 0);
> > -  if ((rc >= 0) && realmode)
> > +//  if ((rc >= 0) && realmode)
> >      grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_REAL_MODE);
> 
> Ehm?

Nothing to see here.  Move along.... :-)

> > -  while (i < sizeof (available))
> > +  while (i < sizeof (available) && available[i])
> >      {
> >        grub_uint64_t address;
> >        grub_uint64_t size;
> >  
> > -      address = available[i++];
> > +      address = grub_be_to_cpu32 (available[i++]);
> 
> Why do you do this?  Isn't this information available in native byte order?

See my other mail about IEEE-1275 and endianess.

> > diff -x '*.mk' -x '*~' -x CVS -x .svn -x configure -x config.h.in -Nurp ../../grub2/term/ieee1275/ofconsole.c ./term/ieee1275/ofconsole.c
> > --- ../../grub2/term/ieee1275/ofconsole.c	2007-12-25 12:10:47.000000000 +0100
> > +++ ./term/ieee1275/ofconsole.c	2008-01-12 03:09:02.000000000 +0100
> > @@ -369,9 +369,6 @@ static struct grub_term grub_ofconsole_t
> >      .getwh = grub_ofconsole_getwh,
> >      .gotoxy = grub_ofconsole_gotoxy,
> >      .cls = grub_ofconsole_cls,
> > -    .setcolorstate = grub_ofconsole_setcolorstate,
> > -    .setcolor = grub_ofconsole_setcolor,
> > -    .getcolor = grub_ofconsole_getcolor,
> 
> Why do you do this?

GRUB still wants to set light-gray/black color when run over serial port
(or OFW terminal which could pipe to serial port).  This is very ugly
when your serial port is mapped to a black/white gnome-terminal.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



  reply	other threads:[~2008-01-15 12:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  3:14 GRUB on OLPC / XO Robert Millan
2008-01-15 11:31 ` Marco Gerards
2008-01-15 12:06   ` Robert Millan [this message]
2008-01-15 12:23     ` Marco Gerards
2008-01-15 12:32       ` Robert Millan
2008-01-15 12:48         ` Marco Gerards
2008-01-15 16:36     ` Robert Millan
2008-01-21 10:24       ` Marco Gerards
2008-01-21 11:33         ` Robert Millan
  -- strict thread matches above, loose matches on Subject: below --
2008-01-12 13:42 Robert Millan
2008-01-12 14:00 ` Robert Millan
     [not found]   ` <4789009B.8030403@laptop.org>
2008-01-12 18:58     ` Robert Millan
     [not found]       ` <47891639.7070500@laptop.org>
     [not found]         ` <47891889.5020402@laptop.org>
2008-01-12 20:30           ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080115120643.GD31275@thorin \
    --to=rmh@aybabtu.com \
    --cc=devel@lists.laptop.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.