Higher half kernel - string problem and page allocation
Posted: Sat Apr 26, 2014 3:59 am
Hi there,
this is my first post here so I'm sorry if I do something wrong. And another thing: I'm not an native English and my english isn't the best.
ok, now my problems:
Problem 1, strings: I can only use strings if they are declared in the function with char string[] = "...". Global ones and just "..." (forgot the name) can't be displayed. I read that I have to include the .rodata section what I've tried but this hasn't solved the problem. I found out that the strings can only be found if they are in the .text section. And this drives me crazy.
Here is my current linker script if that helps:
Problem 2, page allocation: It's a simpler question. Must I pass the page entry to the pointer if I want to store some structs there or the physical address? My memory management is based on this tutorial: http://www.brokenthorn.com/Resources/OSDev18.html
this is my first post here so I'm sorry if I do something wrong. And another thing: I'm not an native English and my english isn't the best.
ok, now my problems:
Problem 1, strings: I can only use strings if they are declared in the function with char string[] = "...". Global ones and just "..." (forgot the name) can't be displayed. I read that I have to include the .rodata section what I've tried but this hasn't solved the problem. I found out that the strings can only be found if they are in the .text section. And this drives me crazy.
Here is my current linker script if that helps:
Code: Select all
ENTRY(entry)
SECTIONS
{
. = 0xF0100000;
kernel_start = .;
.text : AT(ADDR(.text) - 0xF0000000)
{
*(.text)
}
.data ALIGN(0x1000) : AT(ADDR(.data) - 0xF0000000)
{
__init_array = .;
KEEP(*( .init_array ));
KEEP(SORT_BY_NAME(*)( .init_array));
__init_array_end = .;
__fini_array = .;
KEEP(*( .fini_array ));
KEEP(SORT_BY_NAME(*)( .fini_array ));
__fini_array_end = .;
*(.data)
*(.rodata*)
}
.bss ALIGN(0x1000) : AT(ADDR(.bss) - 0xF0000000)
{
*(COMMON*)
*(.bss*)
}
kernel_end = .;
}