1

I'm developing simple bare metal program for Raspberry

I read many articles witch state that the entry on linker script should be at address 0x8000, but it boot with any other address. so is this address useless??

/* link-arm-eabi.ld - linker script for arm eabi */
ENTRY(Start)

SECTIONS
{
    /* Starts at LOADER_ADDR. */
    . = 0x10000;
    _start = .;
    _text_start = .;
    .text :
    {
        KEEP(*(.text.boot))
        *(.text)
    }
    . = ALIGN(4096); /* align to page size */
    _text_end = .;

    _rodata_start = .;
    .rodata :
    {
        *(.rodata)
    }
    . = ALIGN(4096); /* align to page size */
    _rodata_end = .;

    _data_start = .;
    .data :
    {
        *(.data)
    }
    . = ALIGN(4096); /* align to page size */
    _data_end = .;

    _bss_start = .;
    .bss :
    {
        bss = .;
        *(.bss)
    }
    . = ALIGN(4096); /* align to page size */
    _bss_end = .;
    _end = .;
}
1

This is more of a convention than a REAL necessity for every case.

0x8000 was far enough from the start to be "clean" of interrupt addresses and null pointer addresses, so, convention started to use it as the beginning of the kernel address.

According to the ARM booting procedures:

Despite the ability to place zImage anywhere within memory, convention has it that it is loaded at the base of physical RAM plus an offset of 0x8000 (32K). This leaves space for the parameter block usually placed at offset 0x100, zero page exception vectors and page tables. This convention is very common.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.