os1000lines/run.sh
2025-12-29 10:47:29 +11:00

18 lines
395 B
Bash
Executable File

#!/bin/bash
set -xue
# QEMU binary
QEMU=qemu-system-riscv32
# Path to clang and compiler flags
CC=/usr/bin/clang
CFLAGS="-std=c11 -o@ -g3 -Wall -Wextra --target=riscv32 -ffreestanding -nostdlib"
$CC $CFLAGS -Wl,-Tkernel.ld -Wl,-Map=kernel.map -o kernel.elf \
kernel.c common.c
# Start QEMU
$QEMU -machine virt -bios default -nographic -serial mon:stdio --no-reboot \
-kernel kernel.elf