[Top][All Lists]

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

Re: Booting a CD using grub-0.93

From: Thierry Laronde
Subject: Re: Booting a CD using grub-0.93
Date: Tue, 14 Oct 2003 22:51:02 +0200
User-agent: Mutt/1.0.1i

On Tue, Oct 14, 2003 at 05:48:23PM +0200, Yoshinori K. Okuji wrote:
> Well, now the patch is adapted to a later version. It's a good thing. But I 
> don't think the patch has been cleaned up. As his patch changes core parts of 
> GRUB and too unreadable, I can't accept, regardless of how many people use 
> it.

I don't think this should be a problem since GRUB in its present state
is hardly maintainable. The problem has been and is that when I started
to work on stage1 I tried to keep in mind future since I didn't want to
make the work twice. Working with the core of GRUB showed me that it 
will be better, for future versions, to simply restart almost from
scratch but with the experience gained. But stage1 is... the beginning,
so I introduced some features that are not, now, used, but could be
later. That's perhaps the things you found mysterious.

I have put a lot of comments (and I'm a bit ashamed to be so lazzy that
I did not take some time to make `aweb', a "cweb" version for assembly
so that one could use literate programming for this kind of stuff) and
the only thing that might be a bit queer is in shared.h. Since I've got
the numbers wrong, here is a new version with comments :

==========update for shared.h

/* A trick to translate the bios_id in grub_id i.e. in an index in the
 * disks array. 
 * We have a sparse set of integers and fortunately the three subsets:
 * [0x0-0x07], [0x80,0x87], {0xFF} have a distribution that will make 
 * easy to "collapse" the holes and made them contiguous, i.e. allow
 * us to compute their index number (their "order" counting them in 
 * increasing  order and not taking into account numbers outside 
 * these subsets) since the two subsets to move nearer to the first 
 * one have an extension that is less than the deplacement we want 
 * to make and since the extension of the gaps
 * between the subsets is greater than the total number of... numbers. 
 * If these requirements were not met the formula will not be as 
 * easy and light!
 * Keep in mind that numbers already in place MUST not be moved. 
 * First we want to move to its place 0xFF. 0xFF will be the 0x10th 
 * entry so x % (0xFF - 0x10) that is x % 0xEF will put 0xFF at 
 * its place without moving the others since all the others 
 * are < 0xEF.
 * Second, we move [0x80,0x87] to their places 0x08-0x0F this can be 
 * done easily like this x % (0x80 - (0x07 + 1)) that is x % 0x78. 
 * We verify that this doesn't move the others since 0x00-0x07 and 
 * 0x10 are < 0x78.
 * So the resulting formula :
#define bios2grub_id(x) (((x) % 0xEF) % 0x78)

=========end update
Thierry Laronde (Alceste) <address@hidden>
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

reply via email to

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