diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00f2dd4b..89c74960 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,6 +68,10 @@ jobs: run: | make -C tests/system/alignment/ make distclean && make ENABLE_EXT_C=0 ENABLE_SYSTEM=1 misalign-in-blk-emu -j$(nproc) + - name: MMU test + run: | + make -C tests/system/mmu/ + make distclean && make ENABLE_SYSTEM=1 mmu-test -j$(nproc) - name: gdbstub test run: | make distclean && make ENABLE_GDBSTUB=1 gdbstub-test -j$(nproc) diff --git a/Makefile b/Makefile index a32e4651..71f4b9e2 100644 --- a/Makefile +++ b/Makefile @@ -303,6 +303,16 @@ misalign-in-blk-emu: $(BIN) exit 1; \ fi; +EXPECTED_mmu = STORE PAGE FAULT TEST PASSED! +mmu-test: $(BIN) + $(Q)$(PRINTF) "Running vm.elf ... "; \ + if [ "$(shell $(BIN) tests/system/mmu/vm.elf | tail -n 2)" = "$(strip $(EXPECTED_mmu)) inferior exit code 0" ]; then \ + $(call notice, [OK]); \ + else \ + $(PRINTF) "Failed.\n"; \ + exit 1; \ + fi; + # Non-trivial demonstration programs ifeq ($(call has, SDL), 1) doom_action := (cd $(OUT); ../$(BIN) riscv32/doom)