Page 2 of 2

Re: Strange problem

Posted: Sun Jul 25, 2010 1:10 am
by finarfin
Surfing into the wiki, i noticed that page: http://wiki.osdev.org/Bran%27s_Known_Bugs

And the bug reported is:
As soon as I add strings, things go wrong.
So it seems to be something related to my problem, i'm not sure if my problem are the strings or not. But the fact is that every printf into a specific function, or every function call that involves a string (with variable, o simply defined with "...") i tried to use it's solution, that is to change the linker script:

Code: Select all

OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
  .text phys : AT(phys) {
    code = .;
    *(.text)
    *(.rodata)
    . = ALIGN(4096);
  }
  .data : AT(phys + (data - code))
  {
    data = .;
    *(.data)
    . = ALIGN(4096);
  }
  .bss : AT(phys + (bss - code))
  {
    bss = .;
    *(.bss)
    . = ALIGN(4096);
  }
  end = .;
}
Now everything works fine, but i don't know if it is a solution because now my kernel is only 79906 bytes. And the problem usually happens at 84157 bytes.

Re: Strange problem

Posted: Sun Jul 25, 2010 1:42 am
by gerryg400
Now everything works fine, but i don't know if it is a solution because now my kernel is only 79906 bytes. And the problem usually happens at 84157 bytes
You must inspect the generated code to find out. You will see what was wrong before and why your change fixed it.

We have a very strict rule where I work that a bug report cannot be closed until the fix is entirely explained. Even if the fix is a bi-product of another change.