From 880cb219b006c0a6e5cca650b370a9cbb8706fba Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 10 Dec 2017 12:10:14 +0100 Subject: [PATCH] Bodge together a floppy-bootable nc200 platform. --- Kernel/platform-nc200/Makefile | 68 ++++++++++++++++++++++++++------ Kernel/platform-nc200/fuzix.lnk | 1 + Kernel/platform-nc200/kernel.def | 1 + Kernel/platform-nc200/rules.mk | 1 + Kernel/platform-nc200/target.mk | 1 + 5 files changed, 60 insertions(+), 12 deletions(-) create mode 120000 Kernel/platform-nc200/fuzix.lnk create mode 120000 Kernel/platform-nc200/kernel.def create mode 100644 Kernel/platform-nc200/rules.mk create mode 100644 Kernel/platform-nc200/target.mk diff --git a/Kernel/platform-nc200/Makefile b/Kernel/platform-nc200/Makefile index 9995b2d2..c89015ea 100644 --- a/Kernel/platform-nc200/Makefile +++ b/Kernel/platform-nc200/Makefile @@ -1,12 +1,59 @@ -bootfloppy.img: floppyskeleton.img autoprg.bin ../fuzix.bin - rm -f bootfloppy.img - cp floppyskeleton.img bootfloppy.img - truncate bootfloppy.img --size 7680 - mcopy -i bootfloppy.img autoprg.bin ::auto.prg - dd if=../fuzix.bin bs=16k skip=0 count=1 | mcopy -i bootfloppy.img - ::load4000.80 - dd if=../fuzix.bin bs=16k skip=1 count=1 | mcopy -i bootfloppy.img - ::load4000.81 - dd if=../fuzix.bin bs=16k skip=2 count=1 | mcopy -i bootfloppy.img - ::load4000.82 - echo -n | mcopy -i bootfloppy.img - ::call4000.80 +CSRCS = \ + ../platform-nc100/devlpr.c \ + ../platform-nc100/devtty.c \ + ../platform-nc100/devrd.c \ + ../platform-nc100/devaudio.c \ + ../platform-nc100/devgfx.c \ + ../platform-nc100/devices.c \ + ../platform-nc100/main.c \ + +ASRCS = \ + ../platform-nc100/nc100.s \ + ../platform-nc100/crt0.s \ + ../platform-nc100/tricks.s \ + ../platform-nc100/commonmem.s \ + +COBJS = $(CSRCS:.c=.rel) +AOBJS = $(ASRCS:.s=.rel) +OBJS = $(COBJS) $(AOBJS) + +JUNK = \ + $(CSRCS:.c=.lst) \ + $(CSRCS:.c=.asm) \ + $(CSRCS:.c=.sym) \ + $(ASRCS:.s=.lst) \ + $(ASRCS:.s=.sym) \ + $(CSRCS:.c=.rst) \ + $(ASRCS:.s=.rst) + +all: $(OBJS) + +$(COBJS): %.rel: %.c + $(CROSS_CC) $(CROSS_CCOPTS) -o $@ -c $< + +$(AOBJS): %.rel: %.s + $(CROSS_AS) $(ASOPTS) -o $@ $< + +clean: + rm -f $(OBJS) $(JUNK) core *~ + rm -f floppyskeleton.img autoprg.bin bootfloppy.img + +bootblock.img: ../platform-nc100/bootblock.s + sdasz80 -fflopzws bootblock.rel ../platform-nc100/bootblock.s + sdldz80 -nwmx -b BOOTBLOCK=0 -i bootblock.ihx bootblock.rel + srec_cat -disable-sequence-warning \ + bootblock.ihx -intel \ + -output bootblock.img -binary + +image: floppyskeleton.img autoprg.bin bootblock.img ../fuzix.bin + dd if=bootblock.img of=../fuzix.bin bs=1 conv=notrunc + cp floppyskeleton.img ../fuzixfloppy.img + truncate ../fuzixfloppy.img --size 7680 + mcopy -i ../fuzixfloppy.img autoprg.bin ::auto.prg + dd if=../fuzix.bin bs=16k skip=0 count=1 | mcopy -i ../fuzixfloppy.img - ::load4000.80 + dd if=../fuzix.bin bs=16k skip=1 count=1 | mcopy -i ../fuzixfloppy.img - ::load4000.81 + dd if=../fuzix.bin bs=16k skip=2 count=1 | mcopy -i ../fuzixfloppy.img - ::load4000.82 + echo -n | mcopy -i ../fuzixfloppy.img - ::call4000.80 floppyskeleton.img: floppyskeleton.s sdasz80 -fflopzws floppyskeleton.rel floppyskeleton.s @@ -21,6 +68,3 @@ autoprg.bin: autoprg.s srec_cat -disable-sequence-warning \ autoprg.ihx -intel -offset -0xa000 \ -output autoprg.bin -binary - -clean: - rm -f floppyskeleton.img autoprg.bin bootfloppy.img diff --git a/Kernel/platform-nc200/fuzix.lnk b/Kernel/platform-nc200/fuzix.lnk new file mode 120000 index 00000000..cfabc469 --- /dev/null +++ b/Kernel/platform-nc200/fuzix.lnk @@ -0,0 +1 @@ +../platform-nc100/fuzix.lnk \ No newline at end of file diff --git a/Kernel/platform-nc200/kernel.def b/Kernel/platform-nc200/kernel.def new file mode 120000 index 00000000..321460cd --- /dev/null +++ b/Kernel/platform-nc200/kernel.def @@ -0,0 +1 @@ +../platform-nc100/kernel.def \ No newline at end of file diff --git a/Kernel/platform-nc200/rules.mk b/Kernel/platform-nc200/rules.mk new file mode 100644 index 00000000..eaa4fc50 --- /dev/null +++ b/Kernel/platform-nc200/rules.mk @@ -0,0 +1 @@ +export CROSS_CCOPTS += -I$(ROOT_DIR)/platform-nc100 -DCONFIG_NC200 diff --git a/Kernel/platform-nc200/target.mk b/Kernel/platform-nc200/target.mk new file mode 100644 index 00000000..3bffcde0 --- /dev/null +++ b/Kernel/platform-nc200/target.mk @@ -0,0 +1 @@ +export CPU = z80 -- 2.34.1