diff options
| author | user <user@clank> | 2026-07-15 23:44:28 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-07-15 23:44:28 +0200 |
| commit | de725da74db5cba0f9bfd0755269e1683423d87b (patch) | |
| tree | dc39eca9fbd290393ed51de31eee5e4bd6af8375 /Makefile | |
| download | gbos-de725da74db5cba0f9bfd0755269e1683423d87b.tar.gz gbos-de725da74db5cba0f9bfd0755269e1683423d87b.tar.xz gbos-de725da74db5cba0f9bfd0755269e1683423d87b.zip | |
gbos scaffold: working cooperative microkernel (verified ABAB in emulator)
- fix ClearKernelRAM clobbering the kernel stack (only clear $C000-$CBFF)
- fix SyscallTrap clobbering DE (buffer arg) during table dispatch
- README: run via ~/dev/gbc --headless; note bring-up bugs
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..23551ad --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +# gbos - Game Boy Color Unix-flavored microkernel (scaffold) +# Toolchain: RGBDS (rgbasm/rgblink/rgbfix) + +ROM := gbos.gb +BUILD := build +SRCS := $(wildcard src/*.asm) +OBJS := $(patsubst src/%.asm,$(BUILD)/%.o,$(SRCS)) + +ASFLAGS := -I include -Wall +# MBC5 + RAM + battery; -r 3 = 32 KiB cart RAM (bump for more task banks) +FIXFLAGS := -v -m MBC5+RAM+BATTERY -r 3 -p 0xFF -t GBOS + +.PHONY: all clean run + +all: $(ROM) + +$(BUILD)/%.o: src/%.asm | $(BUILD) + rgbasm $(ASFLAGS) -o $@ $< + +$(ROM): $(OBJS) + rgblink -m $(BUILD)/gbos.map -n $(BUILD)/gbos.sym -o $@ $(OBJS) + rgbfix $(FIXFLAGS) $@ + +$(BUILD): + mkdir -p $(BUILD) + +clean: + rm -rf $(BUILD) $(ROM) + +# convenience: run in an emulator if one is on PATH +run: $(ROM) + @which sameboy >/dev/null 2>&1 && sameboy $(ROM) || \ + which bgb >/dev/null 2>&1 && bgb $(ROM) || \ + echo "no emulator found (sameboy/bgb)" |
