CosmOS pre-alpha and launchable application versions of old programs.
This commit is contained in:
+40
-2
@@ -13,12 +13,14 @@ EMU ?= ../SplitBit
|
||||
BUILD ?= build
|
||||
|
||||
# Libraries are included by bare name, so the assembler is told where to find them.
|
||||
INCLUDES = -I Libraries
|
||||
# CosmOS owns the filesystem library and the service names, so it is a place to look too.
|
||||
INCLUDES = -I Libraries -I CosmOS/Source
|
||||
|
||||
# The programs worth building. Files in Libraries/ are left out because they have no
|
||||
# entry point of their own, and the ones in testPrograms/ are covered by 'make test'
|
||||
# in the parent directory.
|
||||
PROGRAMS = \
|
||||
CosmOS/Source/cosmos.asm \
|
||||
hello.asm \
|
||||
printHello.asm \
|
||||
inputTest.asm \
|
||||
@@ -46,6 +48,42 @@ $(BUILD)/%.bin: %.asm
|
||||
run-%: $(BUILD)/%.bin
|
||||
$(EMU) $<
|
||||
|
||||
# ---- CosmOS ----
|
||||
#
|
||||
# make cosmos Assemble the system and everything it can load.
|
||||
# make cosmos-disk ... and put the loadable programs on a disk image.
|
||||
# make run-cosmos ... and boot the machine with that disk in the drive.
|
||||
#
|
||||
# Programs in Apps/ say where they live with #Base, so the assembler writes them out as
|
||||
# loadable programs rather than as boot images. They are named .sbx to keep that
|
||||
# difference visible: a .bin is something the machine boots, a .sbx is something a
|
||||
# running system loads.
|
||||
|
||||
DISKTOOL ?= ../SplitDisk
|
||||
COSMOS = $(BUILD)/CosmOS/Source/cosmos.bin
|
||||
APPS = $(patsubst CosmOS/Apps/%.asm,$(BUILD)/CosmOS/Apps/%.sbx,$(wildcard CosmOS/Apps/*.asm))
|
||||
COSMOS_DISK = $(BUILD)/cosmos.img
|
||||
DEPENDENCIES += $(APPS:.sbx=.d)
|
||||
|
||||
$(BUILD)/CosmOS/Apps/%.sbx: CosmOS/Apps/%.asm
|
||||
@mkdir -p $(@D)
|
||||
$(ASM) $(INCLUDES) -M $(@:.sbx=.d) -o $@ $<
|
||||
|
||||
cosmos: $(COSMOS) $(APPS)
|
||||
|
||||
# Made from scratch every time, so that what is on it is what is in Apps/ now and not
|
||||
# also whatever used to be.
|
||||
$(COSMOS_DISK): $(APPS)
|
||||
@mkdir -p $(@D)
|
||||
rm -f $@
|
||||
$(DISKTOOL) format $@ 64 2
|
||||
@for app in $(APPS); do $(DISKTOOL) put $@ $$app; done
|
||||
|
||||
cosmos-disk: $(COSMOS_DISK)
|
||||
|
||||
run-cosmos: $(COSMOS) $(COSMOS_DISK)
|
||||
$(EMU) --disk $(COSMOS_DISK) $(COSMOS)
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD)
|
||||
|
||||
@@ -53,4 +91,4 @@ clean:
|
||||
# reassembles every program that includes it.
|
||||
-include $(DEPENDENCIES)
|
||||
|
||||
.PHONY: all clean
|
||||
.PHONY: all clean cosmos cosmos-disk run-cosmos
|
||||
|
||||
Reference in New Issue
Block a user