From: Alan Cox Date: Sat, 5 Nov 2016 22:43:54 +0000 (+0000) Subject: coco2cart: updates and add missed file X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=af856af0445f4861ab81196c8a955e589555d588;p=FUZIX.git coco2cart: updates and add missed file --- diff --git a/Kernel/platform-coco2cart/Makefile b/Kernel/platform-coco2cart/Makefile index 361874be..45403835 100644 --- a/Kernel/platform-coco2cart/Makefile +++ b/Kernel/platform-coco2cart/Makefile @@ -51,7 +51,7 @@ $(AOBJS): %$(BINEXT): %.s clean: rm -f *.o *~ -image: bootfuz.bin +image: $(CROSS_LD) -o ../fuzix.bin --map=../fuzix.map --script=fuzix.link \ crt0.o bootstrap.o commonmem.o coco2.o discard.o ../simple.o \ ../start.o ../version.o ../lowlevel-6809.o \ @@ -64,6 +64,4 @@ image: bootfuz.bin ../font8x8.o ../tools/decb-image <../fuzix.bin fuzix.img -bootfuz.bin: bootloader.s - lwasm -r -b -obootfuz.bin bootloader.s diff --git a/Kernel/platform-coco2cart/README b/Kernel/platform-coco2cart/README index eb80b6f4..fb093f26 100644 --- a/Kernel/platform-coco2cart/README +++ b/Kernel/platform-coco2cart/README @@ -1,23 +1,37 @@ COCO2 ===== +(Work in progress) + COCO or Dragon 64 with an IDE port, cartridge and 64K of RAM Supported hardware: - IDE (Glenside or compatible) + IDE (Cloud9 or compatible set at FF40) with either built in + cartridge RAM or separate cartridge Memory Map ========== + +User View +========= 0000-00FF Interrupt stack 0100-01FF Vectors (then wasted - could hide libc.o in there ?) 0200-19FF Display 1A00-1BFF udata/stack -1C00-7FFF Code/Data for common plus some kernel +1C00-7FFF Common, data and some kernel code 8000-FEFF User space FF00-FFFF I/O etc -Cartridge +Kernel Mode View +================ +0000-00FF Interrupt stack +0100-01FF Vectors +0200-19FF Display +1A00-1BFF udata/stack +1C00-7FFF Common, data and some kernel code +8000-BFFF ROM C000-FEFF Kernel +FF00-FFFF I/O etc Emulating in XRoar @@ -28,39 +42,24 @@ Needs the IDE patches TODO ==== -Loader code -Set the display up correctly +Test it +Make the boot loader robust (timeout handling) +Add magic numbers to check we loaded the right thing! Support for a real time clock and clock locking Review irq disabling. We shouldn't need much of this at all as we don't have floppy hell to contend with, but the switchin/switchout logic needs to be reviewed for interrupt safety and the IRQs re-enabled during swap in and out. We should also be totally clean now on FIR blocking, so audio might -actually be doable! +actually be doable if not doing drivewire. MPI switching -Could we do a cartridge version -- Re-order so common is in low memory -- Support map_kernel/map_process flipping -- Add asm helpers for user mode copying (trivial - and since we never copy - into kernel ROM we can optimise them a lot - one map switch only) - Fix IDE to support the map flip on transfers (needs little asm code adding) -- How to do discard, can we just take the hit or do we need to copy the - entire cartridge into high RAM, run in high RAM with discard at say - 0xA000 and then in platform_discard switch on map_kernel cartridge - selection so we can let userspace blow away the upper 32K of the RAM - mapping. - -16K Cartridge version would give us space for -- Proper video (costs us about 8K) -- Nice loader (just 'EXEC $C000' and go) < 1K -- Probably all of sound/joysticks/printer/floppy and a few more buffers -- Full size user memory bank (so can run full v7 shell) 4K - - -Write a loader into the cartridge start so it bootstraps off disk and runs -nicely +- reclaim discard space by packing bss, then buffers then discard -6847T1 lower case ? +We have about 2K left to try and jam those bits in which might just about be +enough to add support for very minimal MBR parsing and offsets. That would +be a big improvement and make the current loading of the kernel image from +blocks 1-51 of the disk sensible. If not we need to move it. diff --git a/Kernel/platform-coco2cart/kernel.def b/Kernel/platform-coco2cart/kernel.def new file mode 100644 index 00000000..45787954 --- /dev/null +++ b/Kernel/platform-coco2cart/kernel.def @@ -0,0 +1,26 @@ +; UZI mnemonics for memory addresses etc + +U_DATA equ 0x1A00 ; (this is struct u_data from kernel.h) +U_DATA__TOTALSIZE equ 0x0200 ; 256+256 + +VIDEO_BASE equ 0x0200 ; 512 bytes for the display +VIDEO_END equ 0x1A00 + +IDEDATA equ 0xFF50 +IDEDATA_L equ 0xFF58 + +PROGBASE equ 0x8000 ; programs and data start here + +; Have these defined so that lowlevel-6809.s can be used as-is +SAM_USER macro + endm + +SAM_KERNEL macro + endm + +SAM_SAVE macro + endm + +SAM_RESTORE macro + endm +