feat: SMP stage 1 (4 harts, per-hart guarded stacks, home-core affinity, IPIs, TLB shootdown, one temporary kernel lock), 4-core storm

This commit is contained in:
2026-10-27 00:56:15 +01:00
parent b87a62475f
commit 2e665fd66e
22 changed files with 995 additions and 230 deletions

View File

@@ -2,6 +2,8 @@
RISCV_TARGET = riscv64gc-unknown-none-elf
KERNEL_BIN = target/$(RISCV_TARGET)/release/adapter-riscv
# Harts QEMU boots; `make run-gui SMP=1` for a single core.
SMP ?= 4
KERNEL_CRATES = -p types -p domain -p kernel -p platform
@@ -56,17 +58,17 @@ image: build
scripts/make-disk-image.sh
run: build
qemu-system-riscv64 -machine virt -nographic -bios default \
qemu-system-riscv64 -machine virt -smp $(SMP) -nographic -bios default \
-kernel $(KERNEL_BIN)
run-disk: image
qemu-system-riscv64 -machine virt -nographic -bios default \
qemu-system-riscv64 -machine virt -smp $(SMP) -nographic -bios default \
-kernel $(KERNEL_BIN) \
-drive file=boot.img,if=none,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0
run-gui: image
qemu-system-riscv64 -machine virt -bios default \
qemu-system-riscv64 -machine virt -smp $(SMP) -bios default \
-kernel $(KERNEL_BIN) \
-drive file=boot.img,if=none,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \