Compare commits
3 commits
7c0e113593
...
86754df83b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
86754df83b | ||
![]() |
e3082a19cb | ||
![]() |
975ad1896a |
4 changed files with 11 additions and 4 deletions
|
@ -9,4 +9,9 @@
|
||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
|
|
||||||
|
- [RISC-V From Scratch](https://github.com/twilco/riscv-from-scratch)
|
||||||
|
- [RISC-V from scratch 1: Introduction, toolchain setup, and hello world!](https://twilco.github.io/riscv-from-scratch/2019/03/10/riscv-from-scratch-1.html)
|
||||||
|
- [RISC-V from scratch 2: Hardware layouts, linker scripts, and C runtimes](https://twilco.github.io/riscv-from-scratch/2019/04/27/riscv-from-scratch-2.html)
|
||||||
|
- [RISC-V from scratch 3: Writing a UART driver in assembly](https://twilco.github.io/riscv-from-scratch/2019/07/08/riscv-from-scratch-3.html)
|
||||||
|
- [RISC-V from scratch 4: Creating a function prologue for our UART driver](https://twilco.github.io/riscv-from-scratch/2019/07/28/riscv-from-scratch-4.html)
|
||||||
- [RISC-V Assembly Language Programming](https://github.com/rswinkle/riscv_book/)
|
- [RISC-V Assembly Language Programming](https://github.com/rswinkle/riscv_book/)
|
||||||
|
|
3
end.s
3
end.s
|
@ -16,4 +16,5 @@ end:
|
||||||
|
|
||||||
addi a0, x0, 0x0A
|
addi a0, x0, 0x0A
|
||||||
sb a0, (a1) # '\n'
|
sb a0, (a1) # '\n'
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
3
main.s
3
main.s
|
@ -66,4 +66,5 @@ hello2:
|
||||||
ecall
|
ecall
|
||||||
|
|
||||||
# To avoid the program from exiting
|
# To avoid the program from exiting
|
||||||
loop: j loop
|
loop: j loop
|
||||||
|
|
||||||
|
|
4
makefile
4
makefile
|
@ -21,8 +21,8 @@ CFLAGS += -nostartfiles# # Do not use standard startup files
|
||||||
CFLAGS += -nostdlib# # Do not use standard libraries
|
CFLAGS += -nostdlib# # Do not use standard libraries
|
||||||
CFLAGS += -fno-builtin# # Do not use built-in functions
|
CFLAGS += -fno-builtin# # Do not use built-in functions
|
||||||
CFLAGS += -fno-common# # Do not use common sections
|
CFLAGS += -fno-common# # Do not use common sections
|
||||||
CFLAGS += -march=rv64i # Use RV64I ISA, i.e., integer only
|
CFLAGS += -march=rv64i# # Use RV64I ISA, i.e., integer only
|
||||||
CFLAGS += -mabi=lp64 # Use LP64 ABI, i.e., 64-bit longs and pointers, 32-bit ints
|
CFLAGS += -mabi=lp64# # Use LP64 ABI, i.e., 64-bit longs and pointers, 32-bit ints
|
||||||
CFLAGS += -Os# # Optimize for size
|
CFLAGS += -Os# # Optimize for size
|
||||||
|
|
||||||
LDFLAGS += -T link.ld # Use the linker script
|
LDFLAGS += -T link.ld # Use the linker script
|
||||||
|
|
Loading…
Reference in a new issue