BASE EQU 078H ;HDC BASE ADDRESS
HD_D EQU BASE ;HDC DATA REGISTER
HD_E EQU BASE+1 ;HDC ERROR REGISTER
HD_W EQU BASE+1 ;HDC WRITE PRECOMP
HD_X EQU BASE+2 ;HDC SECTOR COUNT
HD_S EQU BASE+3 ;HDC SECTOR REGISTER
HD_L EQU BASE+4 ;HDC CYLINDER LOW
HD_H EQU BASE+5 ;HDC CYLINDER HIGH
HD_Q EQU BASE+6 ;HDC SIZE/HEAD/DRIVE
HD_C EQU BASE+7 ;HDC COMMAND/STATUS
;
; WD-1000 COMMANDS
;
HREST EQU 00010000B ;RESTORE & INIT
HREAD EQU 00100000B ;READ SECTOR
HWRTE EQU 00110000B ;WRITE SECTOR
HFRMT EQU 01010000B ;FORMAT TRACK
HSEEK EQU 01110000B ;SEEK ADDRESS
For further information I recommend the DOSPLUS manual, the driver
example is at the end of the technical section.
In the example in the model I/III manual the base is 10H
Then there is also model 4 where the example in the manual provides the
base 50H.
But, I do have the RIGID/DVR for DOSPLUS IV too and a quick look agrees
with the model III RIGID/DVR base 78H.
In addition I have an unmarked interface card I'm convinced is the III/4
HD interface, it has 78H as the base address.
BTW:
Disassembling the driver provided two internal functions that were not
documented: REGSAV% and SDIVD% which for model III are 4488H and 4494H
respectively. Searching for similar code in model I DOSPLUS yielded
4525H and 4943H where they are direct calls rather than vectors (no
vectors provided).
model I
REGSAV% EQU 4525H
SDIVD% EQU 4943H
model III
REGSAV% EQU 4485H
SDIVD% EQU 4494H
Knut
The base port address id C0H
Here is some information from the internals page of www.trs-80.com:
This chart provides reference on the Western Digital Hard Disk
Controller board WD1000-TB1, based on the WD1010 controller chip and WD1100
support chip. This board is used in later (white) versions of the Radio
Shack 15 Meg Hard Disk (26-4155).
Earlier versions of the 15M, the 5M, and 12M hard disk systems all use
a larger controller board based on the 8X300 controller chip. I've heard the
R/S 8M hard disk also uses the 8X300 board, but that's unconfirmed.
I have little information on the 8X300 board, but since both 15 and 5
Meg systems are known to work with the same driver/format software from at
least three sources (Tandy/MISOSYS/PowerSOFT), it is assumed most of this
chart also applies to the earlier 8X300 board. (one difference is noted
above)
Although Radio Shack has mapped the HD access ports from C0-CFH as a
standard configuration, both boards can re-map the ports to 50-5FH, 60-6FH,
or 70-7FH simply by changing some jumpers. (If interested, drop a line for
details.)
Special thanks to Adam Rubin, who reviewed the information to help
confirm its accuracy. Comments, corrections and updates are welcome!
Radio Shack 5/15 Meg HD Port Assignments
.--------------------------------------------------------------------------.
|PORT C0H - READ ONLY |PORT C1H - R/W - HD Control Register |
|Bits 2-3 unused |Bits 0-2, 5-7 unused (see note 4) |
| 0-INTRQ-Interrupt request | 3 If set, enables controller |
| 1-HWPL-If set, at least one HD | 4 If set, resets controller |
| is write protected |-------------------------------------|
| 4-WPD4-drive 4 write protected |PORT C2-C3H - READ - HD Dev. ID Reg. |
| 5-WPD3-drive 3 write protected | C4-C7H - HD CTC Channels 0-3 |
| 6-WPD2-drive 2 write protected | See note 1 |
| 7-WPD1-drive 1 write protected |-------------------------------------|
|------------------------------------|PORT C8H - R/W - HD Data Register |
|PORT C9H - READ - Error Register |-------------------------------------|
|Bits 3,5 all reserved (zero) |PORT C9H - WRITE - Wrt Pre-Comp Cyl. |
| 0-DAM not found (see note 2) |The value stored here multiplied x4 |
| 1-Track 0 Error (restore cmnd) |is the RWC start cylinder number. |
| 2-Aborted Command |-------------------------------------|
| 4-ID Not Found Error |PORT CAH - R/W - Sector Count |
| 6-CRC Data Field Error |Used only for multiple sector access |
| 7-Bad Block Detected |don't care w/ single sector commands,|
|------------------------------------|internally decrements when used. |
|PORT CBH - R/W - Sector number |-------------------------------------|
|------------------------------------| PORT CDH - R/W - Cylinder MSB |
|PORT CCH - R/W - Cylinder LSB | (bits 0-1 only; max cyls = 1024) |
|--------------------------------------------------------------------------|
|PORT CEH - R/W - SDH - Sector size/Drive #/Head # |
|Bits 0-2 Head number (0-7) |
| 3-4 Drive number (00-11 reference DSEL1-DSEL4 respectively) |
| 5-6 Sector size (00=256, 01=512, 10=1024, 11=128) |
| 7 EXTension: if set, ECC (Error Checking and Correction) codes |
| are in use, R/W data (sector length+7 bytes) do |
| not check/generate CRC. |
|--------------------------------------------------------------------------|
|PORT CFH - READ - Error Status Register |
|Bit 0 Error (OR of bits 1-7) Bit 4 Seek complete |
| 1 Command in progress 5 Write fault |
| 2 Reserved (0) 6 Drive ready |
| 3 Data request 7 Busy |
|--------------------------------------------------------------------------|
|PORT CFH - WRITE - Command Register Instruction Set - see note 3 |
| Bits: 7 6 5 4 3 2 1 0 | Bits: 7 6 5 4 3 2 1 0 |
| Restore | 0 0 0 1 d c b a | Read Sector | 0 0 1 0 i m 0 0 |
| Seek | 0 1 1 1 d c b a | Write Sector | 0 0 1 1 0 m 0 0 |
| Scan ID | 0 1 0 0 0 0 0 0 | Write Format | 0 1 0 1 0 0 0 0 |
| | |
| "dcba" defines step rate field: | "i" defines interrupt enable status: |
| 0000 = 35 us. | 0 = interrupt when data request |
| 0001-1111 = 0.5-7.5 ms in | line (DRQ*) is enabled |
| 0.5 ms steps | 1 = interrupt at end of command |
| |
| "m" defines multiple sector flag: 0 = one sector, 1 = multiple sectors |
`--------------------------------------------------------------------------'
Notes:
1. Ports C2-C7 are applicable to the Model II configuration with interface
board and 8X300 controller board only. (no further information was
available, sorry!)
2. Port C9, bit 0, READ: R/S 15M HD Service Manual indicates this bit is
reserved (forced zero), but WD1010-00 spec sheet indicates it is used to
indicate a "DAM not found" error.
3. Port CF, WRITE: The 4P ROM is known to send three commands to this port:
16H-restore, 20H-read one sector, 70H-seek. Draw your own conclusions re
the step rate and interrupt values.
4. Although there is no formal documentation of this, according to the
schematics, port C1H bit 2 seems to be used to enable wait state support
on the 8X300 controller board. I cannot absolutely confirm this,
neither
can I say whether the later WD-1000-TB1 board implements this function.
The port address used by DOSPlus was, I think, used by drives they sold
themselves (Aerocomp?).
You can also download the complete service manual from www-trs-80.com
Larry
I don't remember where that came from but I was once collecting
information with the intention to make an IDE interface, never did
though. I really like the silence of the old machines, a spinning
harddisk would destroy that.
Knut
Knut,
That sounds like the host interface posted on the Dutch TRS-80 site. You
are correct, that interface uses 8 ports starting at C8H. If you look at
the port description I pulled from Ira's site, port C8 is the R/W port for
the Tandy drives.
I actually built one each of those interfaces for my Model I's and Model
4's. They work really well. They do not implement hardware write-protect,
so I had to patch the drivers to not look at port C0H which is where that is
done. Other than that, the CP/M and LDOS drivers work the same on those as
they do on the Tandy 5 MB drives.
Larry
Husky
The manual and service manual for the 5M drive is on www.trs-80.com
Larry