From: Dave Cinege <[EMAIL PROTECTED]>
Subject: Re: [PATCH] Multiple initrd files.
Date: Sun, 28 Jan 2001 04:42:50 -0500

> I'm loading files right inline (effectively cat'ing them together in memory),
> so its not possible to calculate the total image size until
> they are all loaded. From what I could tell this creates an offset problem, as
> the first file could be 10K and the next file could be 2MB. (And a 10K file is
> placed differently then a 2.01MB one, no?) This is why I said I thought it had
> to be rewritten since I didn't think any of the lower part of initrd_load()
> could take place until grub_read() read it all.(???)

Maybe you are not very familiar with event-driven programming
model. Your implementation is based on batch processing model, which
knows what _will_ be loaded and how to schedule them. Unlike yours, my
patch is based on a state machine, which knows what was loaded and
what is being loaded, but doesn't know what will be loaded.

In load_initrd, an image is first loaded into a temporary memory area
(i.e. CUR_ADDR), and moved to another area afterwards. So my strategy
was:

1. Read an image to a temporary area.
2. Move a previous image(s), to allocate the size of the image
   currently loaded after the previous image(s).
3. Move current image to the allocated area.

1. (C = current image, P = previously loaded image(s))
+--------~------+
|CCC          PP|
+--------~------+

2.
+--------~------+
|CCC       PP PP|
+--------~------+

3.
+--------~------+
|CCC       PPCCC|
+--------~------+

> This works fine with my patch. Would your's be ok?

I don't know. It is impossible to test new code just in three
minutes. ;)

Okuji

_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-grub

Reply via email to