Page 1 of 1

[SOLVED] GRUB error 28

Posted: Wed Nov 16, 2011 5:43 pm
by wolfram
I'm writing Higher Half kernel. And I have loading problems with it. As I thought, problem was with VMA=3GiB, but...
When I changed my linker script for linking with VMA=LMA=1MiB, GRUB didn't change it's position about my kernel.

Here is result of objdump:

Code: Select all

file format elf32-i386

Program Header:
    LOAD off    0x000000b4 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00000000 memsz 0x00000000 flags r--
    LOAD off    0x00001000 vaddr 0x00100000 paddr 0x00100000 align 2**12
         filesz 0x00000014 memsz 0x00000014 flags r-x
    LOAD off    0x00002000 vaddr 0x00101000 paddr 0x00101000 align 2**12
         filesz 0x00000000 memsz 0x00001000 flags rw-
    NOTE off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags r--

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000014  00100000  00100000  00001000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .bss          00001000  00101000  00101000  00002000  2**4
                  ALLOC
I can't understand, what is wrong?

Re: GRUB error 28

Posted: Wed Nov 16, 2011 6:06 pm
by wolfram
Arrrrgggghhh!

Damned --build-id option, which adds .note.(etc) section! Yes, I've deleted it by objdomp, but NOTE program header was still in file. Then I've decided to try to discard fucking --build-id section during link time. After linking I've got only 2 LOAD-type program headers, no any NOTE.
And now GRUB loading my kernel in both, lower- and higher-half configurations!

If smb. in future will have the same problem, just add the following to your linker script to SECTIONs:

Code: Select all

/DISCARD/ :
{
	*(.note*)
}