kernel sections

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
Fukuda

kernel sections

Post 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...)
Fukuda

Re:kernel sections

Post by Fukuda »

No answer or am I not clear??
Curufir

Re:kernel sections

Post by Curufir »

Symbol table?
Therx

Re:kernel sections

Post 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
fukuda

Re:kernel sections

Post by fukuda »

Not satisfied :-\Any other answers ?
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:kernel sections

Post 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.
-- Stu --
Post Reply