A DOSPlus Extender for Drivewire & CoCo-SDC

A place to discuss everything Dragon related that doesn't fall into the other categories.
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by pser1 »

Hi Tony
In fact if you have the 'modified' Dragon ROM that contains the DLOAD for drivewire, there are the input/output routines too
else nothing would work!
In fact when the ROM starts, it runs a small code that checks if the Shift Key is pressed to start normally.
If that key is NOT pressed, then it asks drivewire to load the AUTOEXEC.DWL file
This behavior works only if drives are not attached!
So we are not talking about just DLOAD but more code. DWLOAD can load any individual file from the PC through DriveWire,
this is what it is intended for.

Anyway, I have found that entering these commands:
POKE&HEB,1:POKE&H60A,1:EXEC&HC13D
produces a BOOT from disk one ... so this code 'could' be added in the initialization routine
of the DOS5.0Plus extended and, in case the drive one contained a bootable disk, it will be started.
If that's not the case you will simply get the OK message, no error at all.
I will have a peek at the code of DOS4.1 (Eurohard) to see what they do to boot automatically.
Right now you know I am too busy with the DOS part of the Orchestra project, so this mod would have to wait ...
hopefully not sooooo long ;-)

cheers
pere
tjewell
Posts: 346
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by tjewell »

Thanks Pere, I didn't mean to distract you! I'll take a look myself, see how DLOAD works and your code works, and maybe I'll come up with up something!
Cheers, Tony
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by pser1 »

Hello,
I couldn't resist the 'challenge', it seemed really easy as I said in my last message.
I have added a bit of code (some 12+1 bytes) and now the extended DP50 tries to boot
the disk at drive 1.
If it isn't bootable, it skips this task and shows the intro message as usual, but if it is bootable
then BOOT is called and the program in the sector 3 of track 0 is loaded and run.

The new version is v25.03
Have tested it with XRoar and Becker port and then with my Dragon 64 and drivewire.
In fact I have used DW4 to 'mount' the updater disk and then I have burned the new version
into bank num1, saving the old version in bank 7 ... one never knows ;-)

In the zip you will find:
DP50BINS - this is the dweeb to be loaded via Becker port in XRoar
DP50XINS - this is the dweeb for Drivewire4 and a real Dragon
DP50PSR-BCK.rom - a ROM to be used in XRoar with Becjker support
DP50PSR-DW4.rom - a ROM to be burned in any disk controller (16k)
DW42 v0.25.03 BCK.VDK - A disk file to install on the fly it on XRoar-Becker
DW42 v0.25.03 DW4.VDK - A disk file to install on the fly it on a real Dragon-DW4
DW42 v0.25.03 Updater.VDK - a disk to be used to update a bank in the CoCo-SDC to the new version

cheers
pere

Ps. Give it a try, any comment about this version will be welcome!
Attachments
Pack DP50v2503.zip
(123.64 KiB) Downloaded 337 times
tjewell
Posts: 346
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by tjewell »

Awesome, thanks Pere - I'll have a go when I'm back in the office (where the Dragon with the SDC attached lives).

I must admit, I was looking at some possible (tiny) tweaks to your code too - I'll tell more once (if) I've got it working. But I've stalled because I can't work out how to build your code - I have the source to 25.00, and it complies just fine with asm6809, but how do I run it under Xroar? Do I need to find a DOSPlus5.0 rom and let it patch it? Or do I load your existing ROM, then load my newly compiled binary over the top at $e000? That kinda works, but feels wrong!

Many thanks in advance, Tony
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by pser1 »

Hi,
it is a bit tangled ...
So, I will explain step by step what I do everytime I post an update ...

First I am going to show you the utility files I use to get all the
needed files with asm6809.
This toolchain began very thin and has ended up with more files that expected :-(

I compile from the command line (only one command):
2r DW42-2503

The file "2r.bat" calls the procedures for Becker Port and Drivewire

Code: Select all

call 2romBCK %1 $6000
call 2romDW4 %1 $6000
The BeckerPort file 2romBCK does:
Line 1 creates an intermediate Extender without header, multiple of 256 bytes to build the ROM
Line 2 creates an intermediate Extender without header not multiple of 256 bytes to build the DWEEB
Line 3 creates the last one but with header, to be the "Becker-Patcher"
Line 4 adds together the DPlus50 and the ROM from line 1 to create the "Becker ROM"
Line 5 compiles a special source to produce the "Becker Dweeb"
Line 6 and 7 delete the working files

Code: Select all

asm6809 -9 -B -v --define becker=1 --define drgrom=1 --exec=%2 --o=%1RBCK.rom %1.asm 
asm6809 -9 -B -v --define becker=1 --exec=%2 --o=PATCHER.rom %1.asm 
asm6809 -9 -B -v --define becker=1 --define drgbin=1 --l=%1DBCK-PATCHER.lst.asm --o=%1DBCK-PATCHER.bin %1.asm
copy DP50NEW.rom /B + %1RBCK.rom /B  DP50PSR-BCK.rom /B
asm6809 -9 -B -v 2dweeb.asm --o=DP50BINS
del PATCHER.rom
del %1RBCK.rom
pause
The DP50NEW is in fact the patched DosPlus50 with the needed hooks to call the extender
The special 2dweeb.asm contains

Code: Select all

	org	$3fb0-9					; $3fa7
	put	$3fb0-9
	
	fcb	$55
	fcb	$02
	fdb	$3fb0
	fdb	final-inicio
	fdb	$3fb0
	fcb	$aa
inicio		
	includebin "BMUPv14C.rom"			; loader
	includebin "DP50NEW.rom"			; hooked DOS
	includebin "PATCHER.rom"			; Becker extender
	if ((*-$3fa7)%256 > 0)
		rzb	 256-((*-$3fa7)%256)		; make it DW4 compatible (length multiple of 256 bytes)
	endif
final	END
The file BMUPv14C.rom is a program that switches to MAP1, copies the Basic ROM and then the modified DOS and extender
to upper memory ($C000 on) and restarts the computer (acts as an installer)

On the other side the DriveWire file 2romDW4 does:
Line 1 creates an intermediate Extender without header, multiple of 256 bytes to build the ROM
Line 2 creates an intermediate Extender without header not multiple of 256 bytes to build the DWEEB
Line 3 creates the last one but with header, to be the "DW4-Extender"
Line 4 adds together the DPlus50 and the ROM from line 1 to create the "DW4 ROM"
Line 5 compiles a special source to produce the "DW4 Dweeb"
Line 6 and 7 delete the working files

Code: Select all

asm6809 -9 -B -v --define becker=0 --define drgrom=1 --exec=%2 --o=%1RDW4.rom %1.asm 
asm6809 -9 -B -v --define becker=0 --exec=%2 --o=EXTENDER.rom %1.asm 
asm6809 -9 -B -v --define becker=0 --define drgbin=1 --l=%1DDW4-EXTENDER.lst.asm --o=%1DDW4-EXTENDER.bin %1.asm 
copy DP50NEW.rom /B + %1RDW4.rom /B  DP50PSR-DW4.rom /B
asm6809 -9 -B -v 1dweeb.asm --o=DP50XINS
del EXTENDER.rom
del %1RDW4.rom
pause
The special 1dweeb.asm contains

Code: Select all

	org	$3fb0-9					; $3fa7
	put	$3fb0-9
	
	fcb	$55
	fcb	$02
	fdb	$3fb0
	fdb	final-inicio
	fdb	$3fb0
	fcb	$aa
inicio		
	includebin "BMUPv14C.rom"			; loader
	includebin "DP50NEW.rom"			; hooked DOS
	includebin "EXTENDER.rom"			; DW4 extender
	if ((*-$3fa7)%256 > 0)
		rzb	 256-((*-$3fa7)%256)		; make it DW4 compatible (length multiple of 256 bytes)
	endif
final	END
For the ones that would like to peek at the MBUPv14C.rom, here is the source code:

Code: Select all

;-----------------------------------------------------------------------------------------------------------
; MBASUP v1.4C	(2015-06-28 by Pere Serrat)
; used to switch to MAP1 and copy 
; the BASIC from ROM into RAM,
; the patched DOS must be loaded into low RAM at $4000
; the Extender should be loaded at $6000
; and finally reset the machine
;-----------------------------------------------------------------------------------------------------------
			ORG	$3FB0
			PUT	$3FB0
;-----------------------------------------------------------------------------------------------------------
			ORCC	#$50			; disable interrupts
			LDX	#$8000			; point to std BASIC ROM
LOOP1		STA	$FFDE				; switch to MAP0 (RAM-ROM)
			LDD	,X			; get a word
			STA	$FFDF			; switch to MAP1 (all 64k RAM)
			STD	,X++			; put at destination
			CMPX	#$BFFF			; copied full BASIC?
			BLO	LOOP1			; no, loopback
			LDU	#$4000			; point to beginning of DOS loaded in low RAM
loop2		ldd	,u++				; get a word
			std	,x++			; put at destination
			cmpu	#$7D00			; copied all 8k of DOS + 6k of extender? ($7D00-$4000 = $3D00 = 15.616 bytes)
			blo	loop2			; no, loopback
			LDA	#$0E			; byte to put instead of $10. Sets bits X=$FFC0 step 2, 14 times instead of 16 times
			STA	$BB72			; at I/O initialisation, so staying in map1
			LDX	#$B3CA			; initial code to detect RAM-ROM limit
			LDD	#$120C			; NOP opcode 12 times to prevent overwritting (now it will be all RAM)
LOOP3		STA   ,X+				; fill that part of initialisation
			DECB				; already finished?
			BNE	LOOP3			; no, loopback
			LDA	#$8E			; opcode for LDX immed
			STA	,X+			; put after the NOPs
			LDD	#$7FFF			; get RAM limit
			STD	,X			; put after LDX to force end of Basic, of RAM, etc to be that value
			CLR	<$71			; mark COLD start
			JMP	$B3B4			; perform reset
;-----------------------------------------------------------------------------------------------------------
			if (* < $4000)
		   		rzb	 $4000-*	; fill until $3FFF included
		 	endif
;********************************************************************************************************************************
In next post I will begin the procedure to transfer these files to the VDKs I upload everytime

cheers
pere

Ps I attach here all of these files for if anyone wants to use them
In the zip I have included the original DosPlus50 needed if it must be re-pacthed
Attachments
Pack Procedure DW42.zip
Pack of programs I use to compile all versions
(16.87 KiB) Downloaded 332 times
DW42-2503 - added auto-boot function.zip
Last version source file
(43.44 KiB) Downloaded 316 times
tjewell
Posts: 346
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by tjewell »

Wonderful stuff, thanks again Pere. Took me a moment to get my head around it, but actually that toolchain isn't too complex. I've built and compiled my first ROM already.

For those of you that use MacOS (like me) or other unix based systems, here's one of the batch scripts rewritten as a shell script for reference:

Code: Select all

#!/bin/sh -x
asm6809 -9 -B -v --define becker=1 --define drgrom=1 --exec=$2 --o=${1}RBCK.rom ${1}.asm 
asm6809 -9 -B -v --define becker=1 --exec=$2 --o=PATCHER.rom ${1}.asm 
asm6809 -9 -B -v --define becker=1 --define drgbin=1 --l=${1}DBCK-PATCHER.lst.asm --o=${1}DBCK-PATCHER.bin ${1}.asm
cat DP50NEW.rom ${1}RBCK.rom > DP50PSR-BCK.rom
asm6809 -9 -B -v 2dweeb.asm --o=DP50BINS
rm PATCHER.rom
rm ${1}RBCK.rom
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by pser1 »

Step 1 - The Becker Port
========================
We need the virtual file "DW42 v0.25.03 - BCK" (included here)
The disc contains:
UDATE .BAS 224 - Used to Update PATCHER.BIN to the new compiled version
MBUPV14 .BIN 89 - The installer-mover to $C000
PATCHER .BIN 6393 - The DOS-Extender to be used
DP50ORI .BIN 8201 - The original DosPlus5.0 (for re-patching purposes)
REPAT50 .BAS 330 - To repatch the DosPlus50 (modify the hooks)
DP50NEW .BIN 8201 - The patched DOSPlus50 to be used
INSB50 .BAS 314 - To install the extender in XRoar with Becker Port in a Dragon64 emulation

First of all, we should make a copy of that VDK and rename it according to the source file we have compiled
for instance "DW42 v0.25.04 - BCK" assuming we have created v0.25.04

update 1)
If we want to use this disc as installer in XRoar to test with drivewire
via becker Port, then we sould do:
a) Copy the file "DW42-2503DBCK-PATCHER.bin" from the compilation folder
to an accesible place (for instance D:\)
b) start XRoar with DOS and load the VDK included here
c) RUN UDATE
when prompted, load the copied file into XRoar (Ctrl + L) and select the compiled file
press 'C' to continue
The program will ask you to enter the new file length in Hexadecimal ...
In the emulator you can make: PRINT HEX$(FileLength - 9) and use the result
FileLength is the length of the file you can see in the compiling folder in Windows
This will update the file "PATCHER.BIN"

update 2)
In case the mods we have done to the extender have moved the entry points of the
hooks we use in the DosPlus50, then we will need to repatch the DOS ...
a) Be sure you have done previously "update 1" (RUN UDATE)
b) RUN REPAT50
c) Using any windows tool extract "DP50NEW.BIN" from the VDK to the Windows file system
and copy it to the compiler folder (replacing the old one)
You can use the util "DragonDOS" by Rolf Michelsen for instance.
d) Recompile again with the new DOS so that the ROMs and Dweebs are updated

That's all, now we have the ROM, the Dweeb and the VDK ready to be used (updated to the new version)

In next post we will see the Drivewire procedure


cheers
pere
Attachments
DW42 v0.25.03 - BCK.zip
(28.16 KiB) Downloaded 317 times
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by pser1 »

Step 2 - Drivewire port with serial adapter
===================================
We need the virtual file "DW42 v0.25.03 - DW4" (included here)
The disc contains:
EXTENDER.BIN 6516 - The DOS-Extender
MBUPV14 .BIN 89 - The installer
CPY2TO1 .BAS 452 - To copy the DP50NEW from the Becker disk
INSDW50 .BAS 315 - To install the extender in XRoar with DW4
UDATE .BAS 227 - Used to Update EXTENDER.BIN to the new version
DP50NEW .BIN 8201 - The patched DOSPlus50

First of all, we should make a copy of that VDK and rename it according to the source file we have compiled
for instance "DW42 v0.25.04 - DW4" assuming we have created v0.25.04

update 3)
If we want to use this disc as installer in a real Dragon64 to test with
a drivewire adapter, then we should do:
a) Copy the file "DW42-2503DDW4-EXTENDER.bin" from the compilation folder
to an accesible place (for instance D:\)
b) start XRoar with DOS and load the VDK included here
c) RUN UDATE
when prompted, load the copied file into XRoar (Ctrl + L) and select the compiled file
press 'C' to continue
The program will ask you to enter the new file length in Hexadecimal ...
In the emulator you can make: PRINT HEX$(FileLength - 9) and use the result
FileLength is the length of the file you can see in the compiling folder in Windows
This will update the file "EXTENDER.BIN"

update 4)
If we have modified the DP50NEW.BIN (hooks changed place), it is mandatory
to update first the Becker VDK and then come back here to do
a) RUN CPY2TO1
when asked, load the Becker VDK in drive 2
and press 'C' to continue

That's all, now we have the ROM, the Dweeb and the VDK ready to be used (updated to the new version)

In next post we will see the procedure to update a bank in the CoCo-SDC


cheers
pere
Attachments
DW42 v0.25.03 - DW4.zip
(20.4 KiB) Downloaded 317 times
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by pser1 »

Step 3 - Flash a SDC bank with new version
==========================================
We need the virtual file "DW42 v0.25.03 SDC Updater.VDK" (included here)
The disc contains:
UPDBANK .BAS 532 - The program to flash the desired bank
CPY2TO1 .BAS 433 - To get the needed files from the DW4 VDK
CHGSLOT .BAS 179 - An utility to change the MPI slot if extender is not present
CHGBANK .BAS 164 - An utility to change of SDC bank if extender is not present
DP50NEW .BIN 8201 - The patched DosPlus5.0
EXTENDER.BIN 6516 - The extender just compiled
CRTFLASH.BAS 238 - Creates the file UPD2503 to be burned in an SDC bank
UPD2503 .BIN 16137 - The file to be burned/flashed

First of all, we should make a copy of that VDK and rename it according to the source file we have compiled
for instance "DW42 v0.25.04 SDC Updater" assuming we have created v0.25.04

update 5)
a) RUN CPY2TO1
First we need to get the patched DOS and the extender just created
When asked, load the "DW42 v0.25.04 - DW4.VDK" in drive 2 (created in step 2)
Press 'C' to continue
b) LOAD"CRTFLASH"
EDIT170
Change the filename "UPD2503" to "UPD2504" if we have created v25.04
RUN
DIR
KILL"UPD2503.BIN" or the file with the oldname
c) To update/flash an SDC bank, we need to access this VDK from the Dragon
If you don't have a drivewire adapter to access files through Drivewire4
but have the SDC with the old version installed, simply copy this VDK
at the root of the card, use a short name: UPDATER.VDK
d) start the Dragon and mount this VDK:
SDRIVE1"UPDATER"
DIR1 just to be sure you have access to that disk
e) LOAD"UPDBANK"
EDIT110
Change the name of the version to V0.25.04 (the one you are working on)
EDIT130
Change the filename to the one just created (for instance "UPD2504.BIN" from step 'b')
RUN

The selected bank will have now the new version of the extender

cheers
pere

EDIT1 - I have changed the VDK because I have found a lot of 'lost' sectors.
The programs were OK, but the disk not.
Attachments
21 - DW42 v0.25.03 SDC-Updater.zip
(26.39 KiB) Downloaded 334 times
tjewell
Posts: 346
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: A DOSPlus Extender for Drivewire & CoCo-SDC

Post by tjewell »

Thanks for all the disks, Pere - I'm just getting ready to write my first SDC ROM now!

Just checking I understand the basics first - would this be a safe way to back up the current ROM to an unused slot:

Code: Select all

CLEAR200,&H2FFF
SCOPY MEM @0
WRITE MEM @7
Cheers, Tony
Post Reply