Series Summary
Key points
- Toolchain: always use
riscv64-unknown-elf-gccfor RV32 bare-metal builds. - Runtime:
_startsets up the stack and clears.bss; no libc is assumed. - QEMU: run everything on
qemu-system-riscv32with-bios noneand-kernel. - Debugging: GDB + QEMU provides breakpoints, watchpoints, and instruction stepping.
- MMIO: UART output at
0x10000000is the simplest reliable output path.
Índice
- ABI: ABI RV32 + tipos em C
- Assembly básico: Instruções básicas de assembly RISC-V
- Depuração: Debug de RV32 com QEMU + GDB
- ELF: Internals de ELF e Binutils
- Linker script: Scripts de linker e mapas de memória
- MMIO/UART: Interfaces no QEMU: UART e conceitos de MMIO
- Otimização: C → ASM: otimizações e volatile
- Rodar QEMU: Configurando a toolchain e o QEMU
- Tracing: Análise dinâmica com tracing no QEMU
Exercises
- Choose one program and add a new function, then verify the call frame in GDB.
- Modify
src/uart.cto add auart_puthex8helper and use it in a chapter example. - Replace one C example with a pure assembly version.
Summary
You now have a complete bare-metal RV32 workflow that runs entirely under QEMU. You can build, run, trace, and debug without any physical hardware.