From 3f8911ba023181c3158395daa2b16c51de42c010 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 21 Apr 2018 13:02:38 +0200 Subject: [PATCH] Refactor the Amstrad NC directory so that the NC100 build stuff is in its own subdirectory --- this is to allow a hypothetical NC200 port to have different build scripts but share as much code as possible. This changes the platform name from nc100 to amstradnc/nc100. --- .../README | 11 ++++- .../README.NC200 | 0 .../bootblock.s | 0 .../commonmem.s | 0 .../crt0.s | 0 .../devaudio.c | 0 .../devgfx.c | 0 .../devgfx.h | 0 .../device.h | 0 .../devices.c | 0 .../devlpr.c | 0 .../devlpr.h | 0 .../devrd.c | 0 .../devrd.h | 0 .../devtty.c | 0 .../devtty.h | 0 .../main.c | 0 .../nc100.def | 0 .../nc100.s | 4 +- Kernel/platform-amstradnc/nc100/Makefile | 40 +++++++++++++++++++ .../nc100}/config.h | 0 .../nc100}/fuzix.lnk | 22 +++++----- .../nc100}/kernel.def | 0 .../nc100}/nc100emu.s | 3 +- Kernel/platform-amstradnc/nc100/rules.mk | 3 ++ .../nc100}/target.mk | 0 .../tricks.s | 4 +- Kernel/platform-nc100/Makefile | 33 --------------- 28 files changed, 68 insertions(+), 52 deletions(-) rename Kernel/{platform-nc100 => platform-amstradnc}/README (79%) rename Kernel/{platform-nc100 => platform-amstradnc}/README.NC200 (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/bootblock.s (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/commonmem.s (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/crt0.s (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devaudio.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devgfx.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devgfx.h (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/device.h (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devices.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devlpr.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devlpr.h (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devrd.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devrd.h (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devtty.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/devtty.h (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/main.c (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/nc100.def (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/nc100.s (99%) create mode 100644 Kernel/platform-amstradnc/nc100/Makefile rename Kernel/{platform-nc100 => platform-amstradnc/nc100}/config.h (100%) rename Kernel/{platform-nc100 => platform-amstradnc/nc100}/fuzix.lnk (54%) rename Kernel/{platform-nc100 => platform-amstradnc/nc100}/kernel.def (100%) rename Kernel/{platform-nc100 => platform-amstradnc/nc100}/nc100emu.s (96%) create mode 100644 Kernel/platform-amstradnc/nc100/rules.mk rename Kernel/{platform-nc100 => platform-amstradnc/nc100}/target.mk (100%) rename Kernel/{platform-nc100 => platform-amstradnc}/tricks.s (98%) delete mode 100644 Kernel/platform-nc100/Makefile diff --git a/Kernel/platform-nc100/README b/Kernel/platform-amstradnc/README similarity index 79% rename from Kernel/platform-nc100/README rename to Kernel/platform-amstradnc/README index 09fcfe09..08709a89 100644 --- a/Kernel/platform-nc100/README +++ b/Kernel/platform-amstradnc/README @@ -1,3 +1,10 @@ +Support for the Amstrad NC series of Z80 portable computers. + +Use: + + TARGET=amstradnc/nc100 for the NC100 + + Memory map. All off PCMCIA root, 16K arbitrary banks No CP/M emulation (due to NMI) @@ -39,8 +46,8 @@ then dd if=myfs of=mycard.img bs=16384 seek=20 conv=notrunc -To boot from NC100emu use nc100emu.s. Compile it with sdas80 and use the -resulting nc100.cim as the bootscript for the emulator. +To boot from NC100emu use nc100emu.s. Compile it with the makefile and use the +resulting nc100.cim as the boot image for the emulator. TODO diff --git a/Kernel/platform-nc100/README.NC200 b/Kernel/platform-amstradnc/README.NC200 similarity index 100% rename from Kernel/platform-nc100/README.NC200 rename to Kernel/platform-amstradnc/README.NC200 diff --git a/Kernel/platform-nc100/bootblock.s b/Kernel/platform-amstradnc/bootblock.s similarity index 100% rename from Kernel/platform-nc100/bootblock.s rename to Kernel/platform-amstradnc/bootblock.s diff --git a/Kernel/platform-nc100/commonmem.s b/Kernel/platform-amstradnc/commonmem.s similarity index 100% rename from Kernel/platform-nc100/commonmem.s rename to Kernel/platform-amstradnc/commonmem.s diff --git a/Kernel/platform-nc100/crt0.s b/Kernel/platform-amstradnc/crt0.s similarity index 100% rename from Kernel/platform-nc100/crt0.s rename to Kernel/platform-amstradnc/crt0.s diff --git a/Kernel/platform-nc100/devaudio.c b/Kernel/platform-amstradnc/devaudio.c similarity index 100% rename from Kernel/platform-nc100/devaudio.c rename to Kernel/platform-amstradnc/devaudio.c diff --git a/Kernel/platform-nc100/devgfx.c b/Kernel/platform-amstradnc/devgfx.c similarity index 100% rename from Kernel/platform-nc100/devgfx.c rename to Kernel/platform-amstradnc/devgfx.c diff --git a/Kernel/platform-nc100/devgfx.h b/Kernel/platform-amstradnc/devgfx.h similarity index 100% rename from Kernel/platform-nc100/devgfx.h rename to Kernel/platform-amstradnc/devgfx.h diff --git a/Kernel/platform-nc100/device.h b/Kernel/platform-amstradnc/device.h similarity index 100% rename from Kernel/platform-nc100/device.h rename to Kernel/platform-amstradnc/device.h diff --git a/Kernel/platform-nc100/devices.c b/Kernel/platform-amstradnc/devices.c similarity index 100% rename from Kernel/platform-nc100/devices.c rename to Kernel/platform-amstradnc/devices.c diff --git a/Kernel/platform-nc100/devlpr.c b/Kernel/platform-amstradnc/devlpr.c similarity index 100% rename from Kernel/platform-nc100/devlpr.c rename to Kernel/platform-amstradnc/devlpr.c diff --git a/Kernel/platform-nc100/devlpr.h b/Kernel/platform-amstradnc/devlpr.h similarity index 100% rename from Kernel/platform-nc100/devlpr.h rename to Kernel/platform-amstradnc/devlpr.h diff --git a/Kernel/platform-nc100/devrd.c b/Kernel/platform-amstradnc/devrd.c similarity index 100% rename from Kernel/platform-nc100/devrd.c rename to Kernel/platform-amstradnc/devrd.c diff --git a/Kernel/platform-nc100/devrd.h b/Kernel/platform-amstradnc/devrd.h similarity index 100% rename from Kernel/platform-nc100/devrd.h rename to Kernel/platform-amstradnc/devrd.h diff --git a/Kernel/platform-nc100/devtty.c b/Kernel/platform-amstradnc/devtty.c similarity index 100% rename from Kernel/platform-nc100/devtty.c rename to Kernel/platform-amstradnc/devtty.c diff --git a/Kernel/platform-nc100/devtty.h b/Kernel/platform-amstradnc/devtty.h similarity index 100% rename from Kernel/platform-nc100/devtty.h rename to Kernel/platform-amstradnc/devtty.h diff --git a/Kernel/platform-nc100/main.c b/Kernel/platform-amstradnc/main.c similarity index 100% rename from Kernel/platform-nc100/main.c rename to Kernel/platform-amstradnc/main.c diff --git a/Kernel/platform-nc100/nc100.def b/Kernel/platform-amstradnc/nc100.def similarity index 100% rename from Kernel/platform-nc100/nc100.def rename to Kernel/platform-amstradnc/nc100.def diff --git a/Kernel/platform-nc100/nc100.s b/Kernel/platform-amstradnc/nc100.s similarity index 99% rename from Kernel/platform-nc100/nc100.s rename to Kernel/platform-amstradnc/nc100.s index 98b4c1fd..15a89f98 100644 --- a/Kernel/platform-nc100/nc100.s +++ b/Kernel/platform-amstradnc/nc100.s @@ -55,8 +55,8 @@ .globl outstring .globl outstringhex - .include "kernel.def" - .include "../kernel.def" + .include "platform/kernel.def" + .include "../../kernel.def" ; Kernel .include "nc100.def" ; ----------------------------------------------------------------------------- diff --git a/Kernel/platform-amstradnc/nc100/Makefile b/Kernel/platform-amstradnc/nc100/Makefile new file mode 100644 index 00000000..67dc37e8 --- /dev/null +++ b/Kernel/platform-amstradnc/nc100/Makefile @@ -0,0 +1,40 @@ + +CSRCS = ../devlpr.c ../devtty.c ../devrd.c ../devaudio.c ../devgfx.c +CSRCS += ../devices.c ../main.c + +ASRCS = ../nc100.s ../crt0.s +ASRCS += ../tricks.s ../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 $(dir $@) -c $< + +$(AOBJS): %.rel: %.s + $(CROSS_AS) $(ASOPTS) $< + +clean: + rm -f $(OBJS) $(JUNK) core *~ + +bootblock.img: ../bootblock.s + sdasz80 -fflopzws bootblock.rel ../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: bootblock.img + dd if=bootblock.img of=../../fuzix.bin bs=1 conv=notrunc + +nc100emu.bin: nc100emu.s + sdasz80 -fflopzws nc100emu.rel $< + sdldz80 -nwmx -b _CODE=0x100 -i nc100emu.ihx nc100emu.rel + srec_cat -disable-sequence-warning \ + nc100emu.ihx -intel -offset -0x100 \ + -output nc100emu.bin -binary diff --git a/Kernel/platform-nc100/config.h b/Kernel/platform-amstradnc/nc100/config.h similarity index 100% rename from Kernel/platform-nc100/config.h rename to Kernel/platform-amstradnc/nc100/config.h diff --git a/Kernel/platform-nc100/fuzix.lnk b/Kernel/platform-amstradnc/nc100/fuzix.lnk similarity index 54% rename from Kernel/platform-nc100/fuzix.lnk rename to Kernel/platform-amstradnc/nc100/fuzix.lnk index 5a1d6ae9..c6f21f7c 100644 --- a/Kernel/platform-nc100/fuzix.lnk +++ b/Kernel/platform-amstradnc/nc100/fuzix.lnk @@ -4,18 +4,18 @@ -b _COMMONMEM=0xF000 -b _DISCARD=0xE000 -l z80 -platform-nc100/crt0.rel -platform-nc100/commonmem.rel -platform-nc100/nc100.rel +platform-amstradnc/crt0.rel +platform-amstradnc/commonmem.rel +platform-amstradnc/nc100.rel start.rel version.rel lowlevel-z80.rel -platform-nc100/tricks.rel -platform-nc100/main.rel +platform-amstradnc/tricks.rel +platform-amstradnc/main.rel timer.rel kdata.rel -platform-nc100/devrd.rel -platform-nc100/devices.rel +platform-amstradnc/devrd.rel +platform-amstradnc/devices.rel devio.rel filesys.rel process.rel @@ -35,9 +35,9 @@ devsys.rel audio.rel usermem.rel usermem_std-z80.rel -platform-nc100/devlpr.rel -platform-nc100/devtty.rel -platform-nc100/devaudio.rel -platform-nc100/devgfx.rel +platform-amstradnc/devlpr.rel +platform-amstradnc/devtty.rel +platform-amstradnc/devaudio.rel +platform-amstradnc/devgfx.rel font4x6.rel -e diff --git a/Kernel/platform-nc100/kernel.def b/Kernel/platform-amstradnc/nc100/kernel.def similarity index 100% rename from Kernel/platform-nc100/kernel.def rename to Kernel/platform-amstradnc/nc100/kernel.def diff --git a/Kernel/platform-nc100/nc100emu.s b/Kernel/platform-amstradnc/nc100/nc100emu.s similarity index 96% rename from Kernel/platform-nc100/nc100emu.s rename to Kernel/platform-amstradnc/nc100/nc100emu.s index 652ab3f6..0d204339 100644 --- a/Kernel/platform-nc100/nc100emu.s +++ b/Kernel/platform-amstradnc/nc100/nc100emu.s @@ -3,11 +3,10 @@ ; .area ASEG(ABS) - .org 0x0 + .org 0x100 ; ; Switch to the PCMCIA card as if run by FN-x ; - .ds #0x100 start: di ld a, #0x43 ; screen RAM out (0x13),a diff --git a/Kernel/platform-amstradnc/nc100/rules.mk b/Kernel/platform-amstradnc/nc100/rules.mk new file mode 100644 index 00000000..f2eefe57 --- /dev/null +++ b/Kernel/platform-amstradnc/nc100/rules.mk @@ -0,0 +1,3 @@ +CROSS_CCOPTS += -I$(ROOT_DIR)/platform-amstradnc +ASOPTS += -I$(ROOT_DIR) + diff --git a/Kernel/platform-nc100/target.mk b/Kernel/platform-amstradnc/nc100/target.mk similarity index 100% rename from Kernel/platform-nc100/target.mk rename to Kernel/platform-amstradnc/nc100/target.mk diff --git a/Kernel/platform-nc100/tricks.s b/Kernel/platform-amstradnc/tricks.s similarity index 98% rename from Kernel/platform-nc100/tricks.s rename to Kernel/platform-amstradnc/tricks.s index ff1ba23f..f1f8003c 100644 --- a/Kernel/platform-nc100/tricks.s +++ b/Kernel/platform-amstradnc/tricks.s @@ -22,8 +22,8 @@ ; imported debug symbols .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex - .include "kernel.def" - .include "../kernel.def" + .include "platform/kernel.def" + .include "../../kernel.def" ; Kernel .area _COMMONMEM diff --git a/Kernel/platform-nc100/Makefile b/Kernel/platform-nc100/Makefile deleted file mode 100644 index f897aa82..00000000 --- a/Kernel/platform-nc100/Makefile +++ /dev/null @@ -1,33 +0,0 @@ - -CSRCS = devlpr.c devtty.c devrd.c devaudio.c devgfx.c -CSRCS += devices.c main.c - -ASRCS = nc100.s crt0.s -ASRCS += tricks.s 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) -c $< - -$(AOBJS): %.rel: %.s - $(CROSS_AS) $(ASOPTS) $< - -clean: - rm -f $(OBJS) $(JUNK) core *~ - -bootblock.img: bootblock.s - sdasz80 -fflopzws bootblock.rel 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: - dd if=bootblock.img of=../fuzix.bin bs=1 conv=notrunc -- 2.34.1