Bodge together a floppy-bootable nc200 platform.
authorDavid Given <dg@cowlark.com>
Sun, 10 Dec 2017 11:10:14 +0000 (12:10 +0100)
committerDavid Given <dg@cowlark.com>
Sun, 10 Dec 2017 11:10:14 +0000 (12:10 +0100)
Kernel/platform-nc200/Makefile
Kernel/platform-nc200/fuzix.lnk [new symlink]
Kernel/platform-nc200/kernel.def [new symlink]
Kernel/platform-nc200/rules.mk [new file with mode: 0644]
Kernel/platform-nc200/target.mk [new file with mode: 0644]

index 9995b2d..c89015e 100644 (file)
@@ -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 (symlink)
index 0000000..cfabc46
--- /dev/null
@@ -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 (symlink)
index 0000000..321460c
--- /dev/null
@@ -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 (file)
index 0000000..eaa4fc5
--- /dev/null
@@ -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 (file)
index 0000000..3bffcde
--- /dev/null
@@ -0,0 +1 @@
+export CPU = z80