Article View: net.micro.6809
Article #673Re: Newdisk bug fixed
From: dml
Date: Fri, 16 May 1986 18:08
Date: Fri, 16 May 1986 18:08
69 lines
3521 bytes
3521 bytes
In article <111@vaxb.calgary.UUCP> ingoldsby@calgary.UUCP (Terry Ingoldsby)
writes:
>After some late night hacking, I think I have been able to locate and
>correct the bug in Dave Lewis' `Newdisk' device driver for OS9. I
>hope the following will allow other people to correct their versions.
>
You have not only my permission, but my blessing and any help you need.
Your analysis of the problem looks right and the fix is pretty simple. The
only change needed is to take the command activation out of the subroutine.
RWCMDX LDX PD.BUF,Y Point to sector buffer
LDB DPRT.IMG,U Do a side verify using the
BITB #$40 DPORT image byte as a side
BEQ WTKCMDX select indicator
ORA #8 Compare for side 1
WTKCMDX LDB #$A8 Set up DRQ halt function
ORB DPRT.IMG,U OR in select bits
RTS
And the calling routines should be modified to: (in four places I believe)
--> ADDED LINES
WRITE2 LDA #$A2 `Write sector' command
BSR RWCMDX Set up for disk command
--> STA >COMDREG Issue command to controller
--> LDA #2 Identify DRQ status bit
WAITWDRQ BITA >STATREG Wait until controller is
BEQ WAITWDRQ ready to transfer data
*
WRTLOOP LDA ,X+ Get byte from data buffer
STA >DATAREG Put it in data register
STB >DPORT Activate DRQ halt function
BRA WRTLOOP Loop until interrupted
The whole idea being to get that command store instruction out of the
(insert weird punctuation here) SUBROUTINE!
>In Dave's code, he uses the NMI generated by the WD1793 disk controller
>as an asynchronous RTS. The idea is sound but he had a little, itty, bitty
Don't be bashful -- just say "*!BUG!!!*" With hair and nippy claws!
The NMI/RTS wasn't my idea; the standard Radio Shack CCDisk module does it
that way, and so does the [GGAAAKKKK!] Disk Basic driver. The hardware's set
up that way you see. The 6809/6883 in normal speed mode is not fast enough
to run a polling loop in the time it takes the disk controller chip to read
a byte. The super-tight infinite loop in there now takes 17 machine cycles
per iteration. That's more than 19 microseconds of the ~25 microsec available.
So, the 6809 is synchronized to the 1793 by tying DRQ (data ready) to HALT!
The NMI is used to break it out of this loop.
I will change the driver on my system this week or next and see how it works.
Many thanx to Terry for finding and exterminating this lil ba???rd.
>>>>>>> Terry Ingoldsby
-------------------------------
Dave Lewis Loral Instrumentation San Diego
sdcsvax--\ gould9 --\
ihnp4 ---->-->!sdcc3 ---->--->!loral!dml (uucp)
sdcrdcf -/ crash ---/
"...got the most in you and use the least. Got a million in you and spend
pennies. Got a genius in you and think crazies. Got a heart in you and feel
empties."
-------------------------------
Technical Details
Message-ID:
<1132@loral.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!ucbvax!sdcsvax!sdcc6!loral!dmlReferences:
<111@vaxb.calgary.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!ucbvax!sdcsvax!sdcc6!loral!dml From: dml@loral.UUCP Newsgroups: net.micro.6809 Subject: Re: Newdisk bug fixed Message-ID: <1132@loral.UUCP> Date: Fri, 16-May-86 14:08:47 EDT Article-I.D.: loral.1132 Posted: Fri May 16 14:08:47 1986 Date-Received: Mon, 19-May-86 05:43:58 EDT References: <111@vaxb.calgary.UUCP> Reply-To: dml@loral.UUCP (Dave Lewis) Organization: Loral Instrumentation, San Diego Lines: 69 Keywords: Device driver