grub-devel
[Top][All Lists]
Advanced

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

Re: Grub2 on Mac OS X


From: Antoine Terrienne
Subject: Re: Grub2 on Mac OS X
Date: Sat, 26 Mar 2005 13:09:51 +0100
User-agent: Internet Messaging Program (IMP) 3.2.5

Selon "Yoshinori K. Okuji" <address@hidden>:

> But you must still check if a pointer returned by malloc is aligned
> correctly.
>

Ok i'll make some checks to make it cleaner

>
> Necessary. It is not a big burden anyway.
>

Ok so I guess we should change the getopt method used by grub-mkimage to argp
too.

> > I found another glibc specific function : alloca. Used in cmain in
> > boot/powerpc/ieee1275/cmain.c. I repace it by declaring argv as an array of
> > 64 elements : char *arg[64] (should be enouth ?). As the variables are
> > allocated in the stack just like alloca do it should work just the same.
>
> This kind of functions should be complemented by a library. Look at Gnulib:
>
> http://www.gnu.org/software/gnulib/
>
> I think Gnulib contains argp as well.
>

Ok I'll look at this too

>
> I don't understand. Why is stdlib.h related to types?
>

Oop sory I mean stdint.h
Types like int32_t, uint32_t and intprt_t are defined from stdint.h


I try to send a new patch several times but it is too big for the mailing list
size limit (100Kb) so I put it here :
http://antoine.terrienne.free.fr/grub2/grub2_on_macosx_20050326.patch

And the mail I sent with it :

Here is a new patch much cleaner (with -u).
Everything compiles now but I didn't test It yet. In fact I don't know how to
use and install grub2 on a drive. If you have and docs or info about installing
a binary to be open firmware bootable that could help me, thanks ;-)

The compilation is OK but this patch is still ugly : I left the getopt. I add a
flag -DGRUB_HOST to make a distinction between the host and build parts. The
GRUB_HOST flag is only used in some specific powerpc include directories so it
shouldn't affect the i386 part. I also add a grub_machine_fini in
kern/powerpc/ieee1275/init.c needed by kern/loader.c. Right now
grub_machine_fini is empty but it should call for someting like
grub_console_fini (not present in powerpc part) and grub_ofdisk_fini (not
implemented). I left malloc as an alternative to memalign. As far as I look in
the code memalign is used to align memory segment from elf files and every
usual cases in elf segments fits in the 16 byte alignment. So it should work
well for now waiting for a better implementation to support exotic segment
alignments.

Compilation and installation are OK. I get grub-emu grub-mkimage and every
modules in the share/grub/ directory and grub-mkimage can produce images. Still
need test and improvements but it seems to work.


--
--
  ____
 /    \  / address@hidden
|  o o | - http://antoine.terrienne.free.fr
|   o  | \ #153026466
\  V V /
 \_/\_/




reply via email to

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