Linker Scripts - Grub Error 13

Discussion about the Anix Operating System

Linker Scripts - Grub Error 13

Postby Xarnze » Fri Jan 22, 2010 11:04 am

For those of you that are having problems with your kernel suddenly increasing in size and then not being loaded by grub and getting this:

Grub output

Code: Select all
Error 13: Invalid or unsupported executable format


You should first change your nasm arguments to

Code: Select all
nasm -f elf -o


and then replace your linker script with this one as it includes a rodata section that will help to prevent problems like this in the future

Code: Select all
ENTRY(start)
SECTIONS
{
  .text 0x100000 :
  {
    code = .; _code = .; __code = .;
    *(.text)
    . = ALIGN(4096);
  }

  .data :
  {
     data = .; _data = .; __data = .;
     *(.data)
     *(.rodata*)
     . = ALIGN(4096);
  }

  .bss :
  {
    bss = .; _bss = .; __bss = .;
    *(.bss)
    . = ALIGN(4096);
  }

  end = .; _end = .; __end = .;
  . = ALIGN(4096);
}
Xarnze
 
Posts: 2
Joined: Fri Jan 22, 2010 10:58 am

Linker Scripts - Grub Error 13

Sponsor

Sponsor
 

Re: Linker Scripts - Grub Error 13

Postby crystal » Fri Jan 22, 2010 11:09 am

I got stuck doing "Bran's Kernel Development tutorial" at that point it was just as i had started to add more functionality but i've heard that some people are getting stuck much earlier, anyway the linker script and those arguments work very well I had already changed you kernel to output to elf format using the nasm -f elf -o arguments but I hadn't changed my linker script, so the one above works very well for me.

Thank you
crystal
 
Posts: 7
Joined: Mon Jan 04, 2010 2:00 pm


Return to Anix - Operating System

Who is online

Users browsing this forum: No registered users and 0 guests

cron