You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to generate my own binary, which I would then like to run using the FW_PAYLOAD_PATH option. When I use the payload generated by default, the program runs correctly. On the other hand, if I use a binary that I compiled myself, it doesn't work.
How can we compile our binary so that it works as a payload?
The text was updated successfully, but these errors were encountered:
build openSBI for qemu-system-riscv32 (note for qemu-system-riscv64 the addresses are slightly different)
make PLATFORM=generic CROSS_COMPILE=riscv32-unknown-elf- PLATFORM_RISCV_XLEN=32 FW_TEXT_START=0x80000000 FW_JUMP_ADDR=0x80400000 FW_JUMP_FDT_ADDR=0x80800000
very simple hello.S custom binary
.section .text
.globl _start
_start:
la t0, hello_string # Load address of the string into t0
call print_loop
loop:
j loop
print_loop:
lb a0, 0(t0) # Load the byte at the address in t0 (current character)
beqz a0, print_loop_end # If the byte is zero (end of string), jump to end
li a7, 1 # Set a7 = 1 ... use putchar
li a6, 1 # Set a6 = 1
ecall # Trigger the ecall
addi t0, t0, 1 # Increment t0 to point to the next character
j print_loop # Repeat the loop
print_loop_end:
ret
hello_string:
.asciz "\n---hello from supervisor mode---\n" # Define the string "hello world" in the .text section
I would like to generate my own binary, which I would then like to run using the FW_PAYLOAD_PATH option. When I use the payload generated by default, the program runs correctly. On the other hand, if I use a binary that I compiled myself, it doesn't work.
How can we compile our binary so that it works as a payload?
The text was updated successfully, but these errors were encountered: