Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
userspace
Makefile
README
build.mk
carts.h
commonmem.s
config.h
crt0.s
devfd.c
devfd.h
device.h
devices.c
devlpr.c
devlpr.h
devtty.c
devtty.h
discard.c
dragon-nx32.ld
dragon.s
drivewire.s
dwload.asm
floppy.s
fuzix-platform-dragon-nx32.pkg
fuzix.link
ide.s
kernel.def
libc.c
main.c
mem-nx32-mooh.s
mem-nx32.s
multihead.s
platform_ide.h
scsi_tc3.s
spi.s
target.mk
tricks.s
ttydw.c
ttydw.h
usermem_sam.s
vc.c
video.h
video.s

README

dragon-nx32
===========

Dragon (32 or 64) or CoCo (1 or 2) + external memory cartridge

This port is for running FUZIX on real Dragons using an external
memory cartridge (like Spinx-512 or MOOH).

A "nx32" cartridge can have from 2 to 256 banks of 32KB each (n x 32). It
will map the active bank at 0x8000-0xFEFF, using the EXMEM (SLENB) signal to
hide the internal ROM/RAM. Writing the bank number to FFBF selects the
bank and activates the cartridge. Writing to FFBE deactivates the
cartridge. It is only active if the SAM is in map type 0.

The MOOH cartridge is different, but is here set up to mimic the same
32KB banking.

The port reserves the internal RAM at 0-0x7FFF plus bank 0 for the kernel.

The port can use the cartridge's SD card or DriveWire to mount the root
filesystem, and most userland tools are working.

The SDBOOT boot loader (https://gitlab.com/tormod/sdboot) can be used
to boot from an SD card.

Swapping to disk is supported over DriveWire (device 2049 = drive 1).

Emulating in XRoar
==================

XRoar supports Spinx-512 and MOOH boards, including SD card emulation,
since version 0.35.

Using DriveWire
===============

For bootstrapping, the fuzix.bin DECB binary must be loaded into
internal RAM and cartridge bank 0. For DriveWire this is done using
the "DWLOAD" program, with these changes from stock DWLOAD:
- do not enable interrupts upon execution of the payload
- jmp instead of jsr so that stack location is not written to
- default name of payload is "fuzix.bin"
- activate cartridge memory when writing payload to RAM
Additionally it is built to run from 0x600 so that FUZIX can
be loaded anywhere from 0x800 and up.

 lwasm --pragma=condundefzero -r -b -odwfuz.bin dwload.asm -DFUZIX -DRAMORG=0x600
Or for an emulator with Becker port:
 lwasm --pragma=condundefzero -r -b -odwfuzb.bin dwload.asm -DFUZIX -DRAMORG=0x600 -DBECKER
For XRoar, just add "-load dwfuzb.bin" to its invocation, and on the Dragon:
 EXEC&H600

For an emulator with Becker port while using the DragonDOS cartridge
 lwasm --pragma=condundefzero -r -b -odwfuzb.bin dwload.asm -DFUZIX -DRAMORG=0x600 -DBECKER -DBCKSTAT=0xFF49 -DBCKPORT=0xFF4A

To make an audio file for loading DWLOAD via the cassette port:
 makewav -r -c -odwfuz.wav dwfuz.bin
The makewav utility can be found at toolshed.sf.net
On the Dragon type: CLOADM:EXEC&H600

If you already have DWLOAD (in patched BASIC ROM), you can build
the FUZIZ loader as a "dweeb":
 lwasm -r -b -oDWFUZ dwload.asm -DFUZIX -DRAMORG=0x600 -DDWEEB 
On the Dragon type: DLOAD"DWFUZ" 

Note that if using the DW4 DriveWire server, all files must be padded to
a multiple of 256 bytes! Use for instance Kernel/tools/pad256

Quick build instructions
========================

(save the below in a script file, run it with "clean" as needed)

# 1. Build the kernel:
make -C Kernel TARGET=dragon-nx32 $@

 # If building for the MOOH boards, append MOOH=1 to above make command.

 # If using DriveWire in an emulator (i.e. XRoar), append BECKER=1

# 2. Build the libraries
make -C Library tools/syscall_6809 $@
make -C Library/libs -f Makefile.6809 $@

# 3. Build the utils and applications
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/util $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/games $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/V7/games $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/V7/cmd $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/V7/cmd/sh $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/levee $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/cave $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/dw $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/MWC/cmd $@
make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/ue $@
#make TARGET=dragon-nx32 -C Applications/cpp  $@
#make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/as09 $@
#make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/ld09 $@

# 4. Build disk tools
make -C Standalone $@

# 5. Build boot disk image 
[ -f "Applications/util/init" ] &&
cd Standalone/filesystem-src && { ./build-filesystem-ng -y -v -X -f fuzix.dsk -g 256 16383 -p platform-dragon-nx32 ; cd - ; }

# 6. Write disk image to a partition on the SD card

# 7. Write kernel to sector 64 on the SD card (for SDBOOT)