ELF Kernel Size

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
Kernel

ELF Kernel Size

Post by Kernel »

This isn't really a problem... as the kernel _works_
But there is a ~4k block between the elf header and the actual entry point.

It bothers me...
I've looked everywhere - the ld script, multiboot.h, my kernel startup code  - nothing.
Visitor

RE:ELF Kernel Size

Post by Visitor »

Weird...

Bump!
Kernel

RE:ELF Kernel Size

Post by Kernel »

Well... it IS the ld-script. I now know thats the culprit... I just have no clue HOW to fix it...
Fixa

RE:ELF Kernel Size

Post by Fixa »

Check this ld-script

/*
*  new_chaos/kernel/kernel.lds
*
*  Copyright (C) 2001 - 2003  Fixa
*
*  ChaOS kernel linker script
*/

OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SECTIONS
{
  . = 0x100000 + SIZEOF_HEADERS;
  .text : {
*(.text)
}
  . = ALIGN(16);
  .rodata : {
*(.rodata)
}
  . = ALIGN(16);
  .data : {
*(.data)
CONSTRUCTORS
}
  . = ALIGN(16);
  _edata = .;
  .bss : {
*(.bss)
}
  . = ALIGN(16);
  _end = .;
  /DISCARD/ : { *(.comment .note) }
}
Post Reply