mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Break console io example out into own app
This commit is contained in:
parent
40e8795f3f
commit
274f347d90
5 changed files with 44 additions and 10 deletions
|
|
@ -4,6 +4,7 @@ all:
|
||||||
docker build -t ${DOCKER_IMAGE} .
|
docker build -t ${DOCKER_IMAGE} .
|
||||||
(cd sketch && make)
|
(cd sketch && make)
|
||||||
(cd helloworld && make)
|
(cd helloworld && make)
|
||||||
|
(cd conio && make)
|
||||||
(cd zig-mandel && make)
|
(cd zig-mandel && make)
|
||||||
(cd zigtris && make)
|
(cd zigtris && make)
|
||||||
(cd rust-hello && make)
|
(cd rust-hello && make)
|
||||||
|
|
@ -12,6 +13,7 @@ all:
|
||||||
clean:
|
clean:
|
||||||
(cd sketch && make clean)
|
(cd sketch && make clean)
|
||||||
(cd helloworld && make clean)
|
(cd helloworld && make clean)
|
||||||
|
(cd conio && make clean)
|
||||||
(cd zig-mandel && make clean)
|
(cd zig-mandel && make clean)
|
||||||
(cd zigtris && make clean)
|
(cd zigtris && make clean)
|
||||||
(cd rust-hello && make clean)
|
(cd rust-hello && make clean)
|
||||||
|
|
|
||||||
27
apps/conio/Makefile
Normal file
27
apps/conio/Makefile
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
PROJECT:=conio
|
||||||
|
|
||||||
|
DOCKER_IMAGE=riscv-dev
|
||||||
|
DOCKER_CMD:=docker run --rm -v ${PWD}../../../:/data -w /data/apps/${PROJECT} ${DOCKER_IMAGE}
|
||||||
|
PREFIX:=${DOCKER_CMD} riscv64-unknown-elf-
|
||||||
|
CFLAGS+=-I../../common
|
||||||
|
CFLAGS+=-fno-stack-protector
|
||||||
|
CFLAGS+=-static-libgcc -fdata-sections -ffunction-sections
|
||||||
|
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
|
||||||
|
|
||||||
|
all:
|
||||||
|
${PREFIX}gcc -o ${PROJECT}.elf ${CFLAGS} ${LDFLAGS} ${SRCS} ${LIBS}
|
||||||
|
$(PREFIX)objcopy ${PROJECT}.elf -O binary ${PROJECT}.bin
|
||||||
|
|
||||||
|
disasm: all
|
||||||
|
$(PREFIX)objdump -S -d -f ${PROJECT}.elf
|
||||||
|
|
||||||
|
test: all
|
||||||
|
../../host/host ${PWD}/${PROJECT}.bin
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin
|
||||||
|
|
||||||
15
apps/conio/conio.c
Normal file
15
apps/conio/conio.c
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#define USE_MAIN
|
||||||
|
#include "uvm32_target.h"
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
uint32_t c;
|
||||||
|
println("Press a key!");
|
||||||
|
while(c = getc()) {
|
||||||
|
if (c != 0xFFFFFFFF) {
|
||||||
|
print("Got: ");
|
||||||
|
printx(c);
|
||||||
|
println("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -5,15 +5,5 @@ void main(void) {
|
||||||
for (int i=0;i<10;i++) {
|
for (int i=0;i<10;i++) {
|
||||||
printd(i);
|
printd(i);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
uint32_t c;
|
|
||||||
while(c = getc()) {
|
|
||||||
if (c != 0xFFFFFFFF) {
|
|
||||||
print("Got: ");
|
|
||||||
printx(c);
|
|
||||||
println("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
BIN
precompiled/conio.bin
Executable file
BIN
precompiled/conio.bin
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue