Hello Okuji,

Yesterday I discovered that my latest patch was wrong.. 'boot.c' checks
'load_end_addr' in two places, and if it's zero, it reports "Invalid
or unsupported format".

New patch fixes this problem; I've tested it before sending :) . Excuse
me for the inconvenience.

On Wed, May 15, 2002 at 06:02:50AM +0900, Yoshinori K. Okuji wrote:

> BTW, I don't think your English is bad. At least yours isn't worse
> than mine. I'm not an English native speaker, either, so I don't know
> if my judgement is good or not, though. ;)

%) This final patch includes update of 'multiboot.texi' as well.

P.S. You may take a look how this technique works in practice; I've just
uploaded a floppy image with updated GRUB and snapshot of RadiOS kernel :)

http://prdownloads.sourceforge.net/radios/radios-snap-20020515.flp.gz

Thanks again,
73!

-- 
Yuri Zaporogets, Software Engineer
Teraflops Ltd., Member of Elektrobit Group
Mobile: +358 (0)400 308323, Fax: +358 (0)3 2258484
http://www.teraflops.com, http://www.elektrobit.com
diff -r -u grub-0.92/stage2/boot.c grub-0.92-1/stage2/boot.c
--- grub-0.92/stage2/boot.c     Mon Apr 29 21:47:14 2002
+++ grub-0.92-1/stage2/boot.c   Tue May 14 22:34:31 2002
@@ -141,8 +141,12 @@
       cur_addr = pu.mb->load_addr;
       /* first offset into file */
       grub_seek (i - (pu.mb->header_addr - cur_addr));
+      if (!pu.mb->load_end_addr)
+       pu.mb->load_end_addr = cur_addr + filemax;
       text_len = pu.mb->load_end_addr - cur_addr;
       data_len = 0;
+      if (!pu.mb->bss_end_addr)
+       pu.mb->bss_end_addr = pu.mb->load_end_addr;
       bss_len = pu.mb->bss_end_addr - pu.mb->load_end_addr;
 
       if (pu.mb->header_addr < pu.mb->load_addr
diff -r -u grub-0.92/util/mbchk.c grub-0.92-1/util/mbchk.c
--- grub-0.92/util/mbchk.c      Tue Dec 11 09:49:17 2001
+++ grub-0.92-1/util/mbchk.c    Tue May 14 21:55:43 2002
@@ -126,7 +126,7 @@
          return 0;
        }
 
-      if (mbh->load_addr >= mbh->load_end_addr)
+      if (mbh->load_end_addr && mbh->load_addr >= mbh->load_end_addr)
        {
          fprintf (stderr,
                   "%s: load_addr is not less than load_end_addr"
@@ -153,7 +153,7 @@
          return 0;
        }
 
-      if (mbh->load_end_addr <= mbh->entry_addr)
+      if (mbh->load_end_addr && mbh->load_end_addr <= mbh->entry_addr)
        {
          fprintf (stderr,
                   "%s: load_end_addr is not less than entry_addr"
diff -r -u grub-0.92/docs/multiboot.texi grub-0.92-1/docs/multiboot.texi
--- grub-0.92/docs/multiboot.texi       Fri Mar  2 22:42:36 2001
+++ grub-0.92-1/docs/multiboot.texi     Wed May 15 11:52:53 2002
@@ -467,12 +467,15 @@
 segment. (load_end_addr - load_addr) specifies how much data to load.
 This implies that the text and data segments must be consecutive in the
 OS image; this is true for existing a.out executable formats.
+If this field is zero, the boot loader assumes that text and data
+segments occupy the whole OS image file.
 
 @item bss_end_addr
 Contains the physical address of the end of the bss segment. The boot
 loader initializes this area to zero, and reserves the memory it
 occupies to avoid placing boot modules and other data relevant to the
-operating system in that area.
+operating system in that area. This value may be set to zero, it means
+that there is no BSS segment present.
 
 @item entry_addr
 The physical address to which the boot loader should jump in order to

Reply via email to