Re: sparc64 port : diffs to powerpc branches

2005-07-13 Thread Marco Gerards
Vincent Pelletier <[EMAIL PROTECTED]> writes:

>> You did not load ext2 as a module, but linked it into the binary.
>> I assume you did not use grub-mkimage yet...
>
> Oh, I thought you meant it was used to add them statically in grubof.

No, this is how things work:

At the moment you have grubof with ext2 compiled in.

In the future we should have a very small grubof (with a better name
;)).  It can load modules at run time.  It is possible to add modules
to grubof using grub-mkimage.  In that case a new grubof binary is
made.  That new binary is the same as the old one, with the modules
embedded.  When it is loaded the modules (still ELF files) are loaded
to a known location.

The first thing GRUB does is checking that known location to see if
there are modules loaded there.  It parses and loads the modules
(using the ELF loader+relocator).  So it works the same as loading a
module from disk, now it is just loaded from memory.  I hope this
makes things a bit more clear, otherwise just ask me on IRC or so.

>> Ok, cool.  I am looking forwards to that patch.
>
> I think patches should be applied in this order :
> - Apply file moving patch for ieee1275 common files.
> - Apply the general patchs I sent (so we have a clean status to add the
> sparc64 port, like grub_get_rtc prototype change, the already-applied
> mm.c patch to correct behaviour on 64 bits archs, ...)
> - Finally apply the sparc64 specific adds (should be only file additions
> at this step, excepts for changes in configure[.ac] and ChangeLog :) ).

Right, although I still do not agree on the grub_get_rtc prototype. :)

Thanks,
Marco



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: sparc64 port : diffs to powerpc branches

2005-07-13 Thread Vincent Pelletier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marco Gerards wrote:
> In that case the usparc port needs a GRUB_IEEE1275_FLAG_... to
> indicate it is not possible to change colors or that it works
> differently.

Good idea.

> Perhaps...  Can you put the bug report on the wiki so we will not
> forget about it?

Done. Btw, I hope my wiki clean up (pages full of links) is ok. I
wondered if it was worth the noise it made in the change log...

> You did not load ext2 as a module, but linked it into the binary.
> I assume you did not use grub-mkimage yet...

Oh, I thought you meant it was used to add them statically in grubof.

> Ok, cool.  I am looking forwards to that patch.

I think patches should be applied in this order :
- - Apply file moving patch for ieee1275 common files.
- - Apply the general patchs I sent (so we have a clean status to add the
sparc64 port, like grub_get_rtc prototype change, the already-applied
mm.c patch to correct behaviour on 64 bits archs, ...)
- - Finally apply the sparc64 specific adds (should be only file additions
at this step, excepts for changes in configure[.ac] and ChangeLog :) ).

Vincent Pelletier
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC1XxRFEQoKRQyjtURAgciAKCYAeqt7PGpx85WOj0iciC4P49FLwCffFMe
wwtEclilaG6A8+SUUO4KIGQ=
=NR2U
-END PGP SIGNATURE-





___ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: sparc64 port : diffs to powerpc branches

2005-07-13 Thread Marco Gerards
Vincent Pelletier <[EMAIL PROTECTED]> writes:

> Marco Gerards wrote:
>> This is an important test.  Please do not remove it so this code can
>> be shared.  Just make sure GRUB_IEEE1275_FLAG_NO_PARTITION_0 is set or
>> not set, depending on how OB works.
>
> No problem, I removed it to show that it isn't needed for usparc.

Ok, but it should be restored for the final patch.

>> Can this be done in a way that we can share most (all?) headers
>> related to ieee 1275?
>
> I think so, except for some special function, like the term colour one
> (I don't think usparc can change colour... Or at least not the same way
> ppc does.)

In that case the usparc port needs a GRUB_IEEE1275_FLAG_... to
indicate it is not possible to change colors or that it works
differently.

>>>Changed some suspicious "&string" to just "string".
>
> Some function with  void * arguments were actualy receiving char *[].
> There was no warning about it, but I think there was a leak.
> I changed them to char * (dynamically allocated, see next remark :) ).

It sounds ok to me.

>>>Added malloc calls when size can be known.
>> Nice!
>
> More can be done, I haven't done it everywhere.

They should all be changed, but it is not that important for this
port.  It is something that should be done in general.

>> Can you write the code so it works on both the PPC and sparc so this
>> code can be shared?  Some code you disabled like this has a function
>> on the PPC, IIRC.
>
> I think that function works on usparc (not sure though) but as it is not
> used at all, I commented it (to get some remarks about it so I can guess
> what it's used for :) ).

Ehm, ok, please ask specific questions if you have them. :)

>>>Remove ppc specific partition numbering thing.
>> Can you explain this?
>
> It seems that ppc numbers his partitions a special way (ruled by a flag,
> so we can make it common to both if the flag is correctly set).

Right.

>> When you implement this, you can support switching from normal to
>> rescue mode and back properly.
>
> There should be a bug in the x86 implementation, that would explain the
> unaligned pointer I get when switching to rescue mode from normal mode.

Perhaps...  Can you put the bug report on the wiki so we will not
forget about it?

>> grub-mkimage is used to add modules to grubof.
>
> So this works, sun partition label & ext2 is read.

You did not load ext2 as a module, but linked it into the binary.
I assume you did not use grub-mkimage yet...

>> Do you want me to fully review the complete patch or was it just a
>> reference for your description?
>
> I think you shouldn't. Once the common parts will have been extracted a
> real patch with changelog will be edited.

Ok, cool.  I am looking forwards to that patch.

Thanks,
Marco



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: sparc64 port : diffs to powerpc branches

2005-07-12 Thread Hollis Blanchard

On Jul 12, 2005, at 1:46 PM, Vincent Pelletier wrote:

Hi.
Here are the diffs powerpc -> usparc, with some comments below.
To be used to know which files can be made common.


I will see about moving the easily shared files.


boot:
cmain renamed in _start (no asm).


Sparc will need to provide its own cmain.c and init.c; these files 
cannot be shared.



Special ppc options removed.
All the ieee1275 functions use the grub_intn_t type (see includes).
Add explicit casts where needed.


--- powerpc/ieee1275/ieee1275.c 2005-06-21 04:33:51.0 +0200
+++ sparc64/ieee1275/ieee1275.c 2005-07-12 20:05:49.0 +0200
@@ -42,43 +41,43 @@ grub_ieee1275_finddevice (char *name, gr
  {
struct find_device_args {
  struct grub_ieee1275_common_hdr common;
-char *device;
-grub_ieee1275_phandle_t phandle;
+grub_intn_t device;
+grub_intn_t phandle;
} args;

As we discussed on IRC, "grub_intn_t" should instead be called 
"grub_ieee1275_cell_t", defined as 32 bits on PPC and 64 bits on Sparc.



Make "exit" call a "no return".

disk:
Special ppc test removed.
Types changed.


Sparc should provide its own grub_ieee1275_test_flag(), as this is a 
good and trivially portable abstraction. We will then need a 
consolidated list of flags (common to all IEEE1275 architectures).



term:
Type changes.
Added an environment variable to disable cls (useful to see early 
messages).


This is useful, but I believe we should use the already-defined "debug" 
environment variable for this. After all, if we have set "debug," we 
probably would like to see the output without the screen being cleared.



util:
Brute changes... Like dl, I don't know when it is used, so...


You may very well need a grub-mkimage.c, but you do not need to hack up 
PowerPC's. :)


I will look into these applying some of these changes now...

-Hollis



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: sparc64 port : diffs to powerpc branches

2005-07-12 Thread Vincent Pelletier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marco Gerards wrote:
> This is an important test.  Please do not remove it so this code can
> be shared.  Just make sure GRUB_IEEE1275_FLAG_NO_PARTITION_0 is set or
> not set, depending on how OB works.

No problem, I removed it to show that it isn't needed for usparc.

> Can this be done in a way that we can share most (all?) headers
> related to ieee 1275?

I think so, except for some special function, like the term colour one
(I don't think usparc can change colour... Or at least not the same way
ppc does.)

>>Changed some suspicious "&string" to just "string".

Some function with  void * arguments were actualy receiving char *[].
There was no warning about it, but I think there was a leak.
I changed them to char * (dynamically allocated, see next remark :) ).

>>Added malloc calls when size can be known.
> Nice!

More can be done, I haven't done it everywhere.

> Can you write the code so it works on both the PPC and sparc so this
> code can be shared?  Some code you disabled like this has a function
> on the PPC, IIRC.

I think that function works on usparc (not sure though) but as it is not
used at all, I commented it (to get some remarks about it so I can guess
what it's used for :) ).

>>Remove ppc specific partition numbering thing.
> Can you explain this?

It seems that ppc numbers his partitions a special way (ruled by a flag,
so we can make it common to both if the flag is correctly set).

> When you implement this, you can support switching from normal to
> rescue mode and back properly.

There should be a bug in the x86 implementation, that would explain the
unaligned pointer I get when switching to rescue mode from normal mode.

> grub-mkimage is used to add modules to grubof.

So this works, sun partition label & ext2 is read.

> Do you want me to fully review the complete patch or was it just a
> reference for your description?

I think you shouldn't. Once the common parts will have been extracted a
real patch with changelog will be edited.

Vincent Pelletier
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC1CzBFEQoKRQyjtURAicmAJ9ElgCCIk8uxl5K3CVzxejvt/Tz7QCfTyXC
qfT6xq2HLEtGILe/ved1JYA=
=fWNO
-END PGP SIGNATURE-





___ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: sparc64 port : diffs to powerpc branches

2005-07-12 Thread Marco Gerards
Vincent Pelletier <[EMAIL PROTECTED]> writes:

Hi Vincent,

> Here are the diffs powerpc -> usparc, with some comments below.
> To be used to know which files can be made common.

Nice!

> All the ieee1275 functions use the grub_intn_t type (see includes).

So this can be shared.

> Add explicit casts where needed.

> disk:
> Special ppc test removed.

This is an important test.  Please do not remove it so this code can
be shared.  Just make sure GRUB_IEEE1275_FLAG_NO_PARTITION_0 is set or
not set, depending on how OB works.

> Types changed.
>
> include:
> ieee1275 functions prototypes updated.
> Add explicit casts where needed.
> Special ppc structs removed.
> multiboot.h, libgcc removed (weren't modified).
> Types length modified.

Can this be done in a way that we can share most (all?) headers
related to ieee 1275?

> kern:
> New dummy function (no asm).
> dl updated to 64 bits ELF, but I'm not sure where it is used...

You have to write the relocator first.  It is used for module loading.

> Changed "abort" to use "enter" OF standard function : now it *does*
> return when the user types "go" at the OF prompt.

Perhaps we can do this on the PPC port as well?

> Changed some suspicious "&string" to just "string".

hm?

> Added malloc calls when size can be known.

Nice!

> Removed "XXX" when documentation answers.

Nice!

> Disabled (#if 0) unused function.

Can you write the code so it works on both the PPC and sparc so this
code can be shared?  Some code you disabled like this has a function
on the PPC, IIRC.

> Remove ppc specific partition numbering thing.

Can you explain this?

> normal:
> New dummy function (no asm).

When you implement this, you can support switching from normal to
rescue mode and back properly.

> term:
> Type changes.
> Added an environment variable to disable cls (useful to see early messages).

Ok.

> util:
> Brute changes... Like dl, I don't know when it is used, so...

grub-mkimage is used to add modules to grubof.

Do you want me to fully review the complete patch or was it just a
reference for your description?

Thanks,
Marco



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel