[SOLVED] GRUB error 28

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
wolfram
Posts: 19
Joined: Wed Aug 19, 2009 11:37 am
Location: Saint-Petersburg, Russia

[SOLVED] GRUB error 28

Post 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?
Last edited by wolfram on Wed Nov 16, 2011 6:08 pm, edited 1 time in total.
wolfram
Posts: 19
Joined: Wed Aug 19, 2009 11:37 am
Location: Saint-Petersburg, Russia

Re: GRUB error 28

Post 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*)
}
Post Reply