bugGNU GRUB - Bugs: bug #15590, Address fields in Multiboot header...


You are not allowed to post comments on this tracker with your current authentication level.

bug #15590: Address fields in Multiboot header not used

Submitter:  Julio Merino <jmmv>
Submitted:  Tue 31 Jan 2006 10:46:44 AM UTC
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Wont Fix Privacy:  Public
Assigned to:  None Originator Name:  Julio M. Merino Vidal
Open/Closed:  Closed Release:  None
Release:  0.97 Reproducibility:  Every Time
Planned Release:  None

Sat 15 Dec 2007 11:17:02 AM UTC, comment #5: 


Please can you check if this problem still applies to the multiboot loader in GRUB 2 (and if it does, update your patch)?

Robert Millan <robertmh>
Project Administrator
Sun 17 Dec 2006 03:53:03 PM UTC, comment #4: 

I don't think that the fact that this is fixed in NetBSD means that the problem in GRUB Legacy has gone away.  The bug is still there and should be fixed, if at all possible.

It is a different issue if you don't want to fix it because the code is "dead"... but, in that case, please state so :-)

Julio Merino <jmmv>
Fri 17 Nov 2006 09:14:50 PM UTC, comment #3: 
Hollis Blanchard <hollisb>
Project Member
Tue 31 Jan 2006 01:43:08 PM UTC, comment #2: 

Sorry but the first patch had a problem.  It didn't properly reserve space for the BSS section, so the symbol table was copied into BSS space and destroyed during the kernel's boot.

I've fixed this in the new patch by making GRUB put the symbol table after the BSS space, if any.  (And now NetBSD properly loads the symbols :-)

Julio Merino <jmmv>
Tue 31 Jan 2006 10:50:07 AM UTC, comment #1: 

I've attached a patch that "fixes" the issue.  I'm quite sure that its first chunk is correct but unfortunately the second one is possibly a hack.

Not that it matters much, I think, because:
1) GRUB-Legacy and the Multiboot specification (v 1) will be deprecated.  Better to have a fix that mostly-works than none.
2) At the moment, no other kernel aside NetBSD could use this feature, so this hack won't break anything.

Oh, BTW... I'm sending this against GRUB Legacy because this is what almost everybody is using now.  This means many Linux distributions.  It'd be nice if those boot loaders installed by them could boot NetBSD without problems, even before they do the switch to GRUB 2.

Julio Merino <jmmv>
Tue 31 Jan 2006 10:46:44 AM UTC, original submission:  

The Multiboot header defines a set of fields that can be used to tell the boot loader where to load a kernel image.  These fields must be specified when loading an a.out image, in which case they are properly used by GRUB.  However, when the image is an ELF file, these fields are optional and unfortunately GRUB does not honour them.

This makes it impossible to load a Multiboot kernel which is mapped to a very high virtual memory address, because GRUB will always spit out a "ERR_WONT_FIT" error.

In my specific case, I've adapted the NetBSD kernel to be Multiboot-compliant.  NetBSD is built to be executed at the 0xc0100000 virtual address.  However, the kernel must be loaded at a lower address (0x00100000) because it relocates itself later on.  If you look at the code in GRUB to boot NetBSD kernels natively, you'll see how it "truncates" the addresses in the ELF file by doing an (& 0xFFFFFF).

If GRUB honoured the address fields in the Multiboot header, I'd use them to explicitly tell it where to place the kernel.

Julio Merino <jmmv>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #2057:  grub-elf-addr.diff added by jmmv (2KiB - application/octet-stream - New patch.)
file #2056:  grub-elf-addr.diff added by jmmv (1KiB - application/octet-stream - Sample patch.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by robertmh (Posted a comment)
  • -email is unavailable- added by jmmv (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-11-17 hollisb StatusNone Wont Fix
        Open/ClosedOpen Closed
    2006-01-31 jmmv Attached File- Added grub-elf-addr.diff, #3348
    2006-01-31 jmmv Attached File- Added grub-elf-addr.diff, #3347
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.9