Is this a valid way of finding the end point of kernel
Posted: Wed Nov 23, 2011 12:07 pm
Hello. I actually didn't believe any of this would work but since I'm getting a some sort of reasonable output of 1075460 i think this may actually work... What do you think? The kernel_end address is probably correct but can I trust my printing methods?
Code: Select all
extern long kernel_end;
char c_kernel_end[64];
einos_itoa ( c_kernel_end, &kernel_end );
print_string ( "Kernel ends at: \0" );
print_string ( c_kernel_end );
print_string ( "\n\0" );
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);
}
kernel_end = .;
}