0

I want to write some code that will boot a simulated (on OVPsim) Microblaze processor.

I have built a platform that is truly bare metal - ie no semihosting library. But I am unfamiliar with writing .S files, as opposed to some small bits of inline assembly.

So, I want to specify that my assembler .text section is located at physical address 0x00000000

In the Linux kernel head.S file, the boot code is preceded by two macros:

__HEAD

and

ENTRY(_start)

From what I can see by grepping the sources neither is Microblaze specific:

__HEAD

appears to expand to:

 .section        ".head.text","ax"

and I cannot really see what

ENTRY(_start)

expands to, but it looks like nothing much (??)

Anybody able to explain to me what I need to preface my bootup .text with?

adrianmcmenamin
  • 1,081
  • 1
  • 15
  • 44

1 Answers1

1

You should start with learning crt0.s (as well as other crt*.s files) from Xilinx. These files initialize C run-time environment for standalone, non-Linux program, running on MicroBlaze.

Basically those startup files do bare minimum:

  • provide addresses for MicroBlaze reset, interrupt, exception vectors, initializes;

  • initialize stack and other Xilinx ABI registers (.bss, .sbss, .rodata);

  • initialize .bss section with zeros;

  • call your main() function.

For Xilinx 14.3 their location is Xilinx/14.3/ISE_DS/EDK/sw/lib/microblaze/src/. Or just search for crt0.s over your Xilinx folder or google it.

dkz
  • 921
  • 6
  • 10