bash, tar, clang, lld, llvm-objcopy, llvm-objdump, llvm-readelf, qemu-system-riscv32
clang -print-targets | grep riscv32
riscv32 - 32-bit RISC-V
sudo apt update && sudo apt install -y clang llvm lld qemu-system-riscv32 curl
OpenSBI:
curl -LO https://github.com/qemu/qemu/raw/v8.0.4/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
- extra/qemu-system-riscv
sudo pacman -Syu --noconfirm clang llvm lld qemu-system-riscv curl
git clone https://github.com/nuta/operating-system-in-1000-lines
cd operating-system-in-1000-lines
├── disk/ - File system contents
│ ├── hello.txt
│ └── meow.txt
├── common.c - Kernel/user common library: printf, memset, ...
├── common.h - Kernel/user common library: definitions of structs and constants
├── kernel.c - Kernel: process management, system calls, device drivers, file system
├── kernel.h - Kernel: definitions of structs and constants
├── kernel.ld - Kernel: linker script (memory layout definition)
├── shell.c - Command-line shell
├── user.c - User library: functions for system calls
├── user.h - User library: definitions of structs and constants
├── user.ld - User: linker script (memory layout definition)
└── run.sh - Build script
CC=clang OBJCOPY=llvm-objcopy ./run.sh