Rework host/target interface to use ecall and proper syscalls instead of CSRs

This commit is contained in:
Toby Jaffey 2025-12-08 02:44:38 +00:00
parent a305fce466
commit 751f068486
26 changed files with 360 additions and 364 deletions

View file

@ -10,7 +10,7 @@ CFLAGS+=-g -Os -march=rv32ima_zicsr -mabi=ilp32 -static
LDFLAGS:= -T ../linker.ld -nostdlib -Wl,--gc-sections
LIBS:= #-lgcc # needed for softfp
SRCS=${PROJECT}.c ../crt0.s
SRCS=${PROJECT}.c ../crt0.S
all:
${PREFIX}gcc -o ${PROJECT}.elf ${CFLAGS} ${LDFLAGS} ${SRCS} ${LIBS}

View file

@ -2,6 +2,18 @@
#include "uvm32_target.h"
void main(void) {
println("Hello world");
for (int i=0;i<10;i++) {
printd(i);
}
#if 0
uint32_t c;
while(c = getc()) {
if (c != 0xFFFFFFFF) {
print("Got: ");
printx(c);
println("");
}
}
#endif
}