Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I set the base address for uploading my own bootloader?

I wrote the following code "load_bootloader.c" but the section(".ARM.__at__0x etc. functionality seems to restrict memory access to what you might label "user accessible memory."

-- BEGINNING OF CODE --

#include <stdio.h>

unsigned char uca_CMOS[BOOTLOADER_SIZE] __attribute__((section(".ARM.__at_0x0000000000000000")));
unsigned long int uli_counter = 0;
FILE * Fp_load;

int main(int i_argc, char** cpa_argv) {
  if (Fp_load = fopen("bootloader", "r")) {
    while (!feof(Fp_load)) {
      uca_CMOS[uli_counter] = getc(Fp_load);
      uli_counter++;
    }
    fclose(Fp_load);
  }
}

-- END OF CODE --

The size of the bootloader replaces "BOOTLOADER_SIZE" and the name of the bootloader file "bootloader." How do I write a bootloader to the absolute zero? The  __attribute__((section(".ARM.__at_ as it turns out only takes eight digits, even though I need the absolute zero RISC-address, which is always 64 bits spread over four 16-bit registers, accessible through a SET MEMORY ADDRESS opcode + 2 bit selector. Now what?

The intent is to use my favorite development system, implement my own RISC-assembler and programming language and finally operating system. I don't want to make use of processor runtime compilers integrated in a SoC. It needs to be generic for every standard RISC processor.