Page 1 of 1

kernel sections

Posted: Sat Nov 29, 2003 10:35 am
by Fukuda
Here is my linker script:

Code: Select all

SECTIONS
{
  .text 0x9000 : {
    StartOfTEXTSection = .; _StartOfTEXTSection = .; __StartOfTEXTSection = .;
    code = .; _code = .; __code = .;
    *(.text)
    . = ALIGN(512);
    EndOfTEXTSection = .; _EndOfTEXTSection = .; __EndOfTEXTSection = .;
  }
  .data  : {
    StartOfDATASection = .; _StartOfDATASection = .; __StartOfDATASection = .;
    data = .; _data = .; __data = .;
    *(.data)
    . = ALIGN(512);
    EndOfDATASection = .; _EndOfDATASection = .; __EndOfDATASection = .;
  }
  .bss  :  {
    StartOfBSSSection = .; _StartOfBSSSection = .; __StartOfBSSSection = .;
    bss = .; _bss = .; __bss = .;
    *(.bss)
    . = ALIGN(512);
    EndOfBSSSection = .; _EndOfBSSSection = .; __EndOfBSSSection = .;
  }
  end = .; _end = .; __end = .;
  EndOfKernel = .; _EndOfKernel = .; __EndOfKernel = .;
}
and in my kernel, I print out the section start and end point location. Here is the results:

Code: Select all

Text Section    : 9000 - CA00
Data Section    : CA00 - CC00
Bss Section     : CC00 - 10E00

Kernel End      : 10FF0
What locates between 'Kernel End' point (10FF0) and 'End of Bss section'(10E00)?
And I get the end of kernel with EndOfKernel symbol, how can I get the start point of kernel?
And as a last question, are these sections lies in binary file as the order I put?(text, data, bss..)Or is there any order of sections?(First section must be text, than data...)

Re:kernel sections

Posted: Sun Nov 30, 2003 9:45 am
by Fukuda
No answer or am I not clear??

Re:kernel sections

Posted: Sun Nov 30, 2003 9:54 am
by Curufir
Symbol table?

Re:kernel sections

Posted: Sun Nov 30, 2003 9:59 am
by Therx
Not sure about this but it may be that you have some stuff at the beginning of assembly files which is not in a section so is just stuck at the end. I don't think think the order matters but if you are just loading a flat binary and jumping to it. (not using GRUB or a relocatable file format like ELF or COFF) then the entry point has to be at the beginning. Also remember things like the multiboot header have to be in the first 8kb

Pete

Re:kernel sections

Posted: Sun Nov 30, 2003 12:20 pm
by fukuda
Not satisfied :-\Any other answers ?

Re:kernel sections

Posted: Sun Nov 30, 2003 12:26 pm
by df
it could be anything from line numbering, debugging, string table, anything.

just do strip --strip-all {filename} if you get upset over it.