2 ;;; Copyright (c) 1999 Massachusetts Institute of Technology
4 ;;; This program is free software; you can redistribute it and/or
5 ;;; modify it under the terms of the GNU General Public License as
6 ;;; published by the Free Software Foundation; either version 2 of the
7 ;;; License, or (at your option) any later version.
9 ;;; This program is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;;; General Public License for more details.
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with this program; if not, write to the Free Software
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 ; Canonical symbol definition macro, FOO==BAR with error check.
27 IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
35 ; For now, must have a disk type defined to get the correct register
43 IFN RP06P+RP07P+RM03P+RM80P-1,.FATAL Only one disk type allowed in RH11 DEFS
46 ;;; Disk RH11 Interrupt vector:
47 DEFSYM PHVEC==254 ; Interrupts occur on level 6
48 ; (high priority) on UBA #1.
50 ;;; Disk RH11 Unibus register addresses:
52 DEFSYM %HRCS1=:776700 ;CTRL AND STATUS 1.
53 DEFSYM %HXSC== 1_15. ; Special Condition
54 DEFSYM %HXTRE==1_14. ; Transfer Error
55 DEFSYM %HXMCP==1_13. ; Mass I/O Control Bus Parity Error
56 DEFSYM %HXDVA==1_11. ; Drive Available
57 DEFSYM %HXPSE==1_10. ; Port Select
58 DEFSYM %HXA17==1_9. ; UB Address Extension Bit 17
59 DEFSYM %HXA16==1_8. ; UB Address Extension Bit 16
60 DEFSYM %HXRDY==1_7. ; Ready
61 DEFSYM %HXIE== 1_6. ; Interrupt Enable
62 DEFSYM $HXCMD==.BP 77 ; Bits 1-5 specify commands.
63 DEFSYM %HXGO== 1_0. ; GO bit
65 ;;; Commands with bit 0 (GO) included:
67 DEFSYM %HMNOP==0 ; No Operation
68 DEFSYM %HMUNL==3 ; Unload ("Standby" -- the pack doesn't fly off).
69 DEFSYM %HMREC==7 ; Recalibrate
70 DEFSYM %HMCLR==11 ; Drive clear (reset errors etc.)
71 DEFSYM %HMRLS==13 ; Drive release (dual port)
72 DEFSYM %HMSRC==31 ; Search (for r.p.s.)
73 DEFSYM %HMWCH==51 ; Write Check (?doesn't work)
74 DEFSYM %HMWCF==53 ; Write Check Format, Header and Data (?doesn't work)
75 DEFSYM %HMWRT==61 ; Write Data
76 DEFSYM %HMRED==71 ; Read Data
77 DEFSYM %HMWHD==63 ; Write Header And Data (format the pack)
78 DEFSYM %HMRHD==73 ; Read Header and Data
80 DEFSYM %HMWTD==65 ; Write Track Descriptor
81 DEFSYM %HMRTD==75 ; Read Track Descriptor
83 DEFSYM %HMSEK==5 ; Seek to Cylinder
84 DEFSYM %HMOFS==15 ; Offset Heads Slightly
85 ; Just sets %HSOFS on RP07
86 DEFSYM %HMCEN==17 ; Return Heads To Centerline
87 ; Just clears %HSOFS on RP07
88 DEFSYM %HMACK==23 ; Acknowledge mounting of pack (required before I/O)
90 DEFSYM %HMRDP==21 ; Read-In Preset
92 DEFSYM %HRWC=:776702 ;WORD COUNT.
94 DEFSYM %HRBA=:776704 ;UNIBUS ADDRESS.
96 DEFSYM %HRADR=:776706 ;DESIRED ADDRESS.
97 DEFSYM $HATRK==.BP 37400 ; Track
98 DEFSYM $HASEC==.BP 00177 ; Sector
99 ;; These are the sizes on the RP07 -- other drives are smaller.
100 ;; This is OK, as most places calculate this as Track_8+Sector
102 DEFSYM %HRCS2=:776710 ;CTRL AND STATUS 2.
103 DEFSYM %HYDLT==1_15. ; Data Late
104 DEFSYM %HYWCE==1_14. ; Write Check Error
105 DEFSYM %HYPE== 1_13. ; Parity Error
106 DEFSYM %HYNED==1_12. ; Non-existant Drive
107 DEFSYM %HYNEM==1_11. ; %HRBA is NXM during DMA
108 DEFSYM %HYPGE==1_10. ; Program Error
109 DEFSYM %HYMXF==1_9. ; Missed Transfer
110 DEFSYM %HYMDP==1_8. ; Mass Data Bus Parity Error
111 DEFSYM %HYOR== 1_7. ; Output Ready (for Silo buffer diag.)
112 DEFSYM %HYIR== 1_6. ; Input Ready (for Silo buffer diag.)
113 DEFSYM %HYCLR==1_5. ; Controller Clear
114 DEFSYM %HYPAT==1_4. ; Parity Test
115 DEFSYM %HYBAI==1_3. ; Unibus Address Increment Inhibit
116 DEFSYM $HYDSK==.BP 7 ; Bits 2-0 are the Unit Select.
118 DEFSYM %HRSTS=:776712 ;DRIVE STATUS.
119 DEFSYM %HSATN==1_15. ; Attention Active
120 DEFSYM %HSERR==1_14. ; Error
121 DEFSYM %HSPIP==1_13. ; Positioning In Progress
122 DEFSYM %HSMOL==1_12. ; Medium On-Line
123 DEFSYM %HSWRL==1_11. ; Write Locked
124 DEFSYM %HSLST==1_10. ; Last Sector Transferred
125 DEFSYM %HSPGM==1_9. ; Programmable
126 DEFSYM %HSDPR==1_8. ; Drive Present
127 DEFSYM %HSRDY==1_7. ; Drive Ready
128 DEFSYM %HSVV== 1_6. ; Volume Valid
129 ; These are RP04-only bits in %HRSTS
130 ; DEFSYM %HSDE1==1_5. ; Difference Equals 1
131 ; DEFSYM %HSL64==1_4. ; Difference Less Than 64
132 ; DEFSYM %HSGRV==1_3. ; Go Reverse
133 ; DEFSYM %HSDIG==1_2. ; Drive To Inner Guard Band
134 ; DEFSYM %HSF20==1_1. ; Drive Forward 20in/sec
135 ; DEFSYM %HSF5== 1_0. ; Drive Forward 5in/sec
137 DEFSYM %HSILS==1_2. ; Interleaved Sectors
138 DEFSYM %HSWRN==1_1. ; Early Warning
139 DEFSYM %HSOFS==1_0. ; Offset Mode
142 DEFSYM %HRER1=:776714 ;ERROR 1.
143 DEFSYM %H1ECC==1_15. ; Data Check
144 DEFSYM %H1UNS==1_14. ; Unsafe
145 DEFSYM %H1OPI==1_13. ; Operation Incomplete
146 DEFSYM %H1DTE==1_12. ; Drive Timing Error
147 DEFSYM %H1WLK==1_11. ; Write Lock Error
148 DEFSYM %H1IAE==1_10. ; Invalid Address Error
149 DEFSYM %H1AOE==1_9. ; Address Overflow Error
150 DEFSYM %H1CRC==1_8. ; Header CRC Error
151 DEFSYM %H1HCE==1_7. ; Header Compare Error
152 DEFSYM %H1ECH==1_6. ; ECC Hard Error
153 DEFSYM %H1WCF==1_5. ; Write Clock Fail
154 DEFSYM %H1FER==1_4. ; Format Error
155 DEFSYM %H1PAR==1_3. ; Parity Error
156 DEFSYM %H1RMR==1_2. ; Register Modification Refused
157 DEFSYM %H1ILR==1_1. ; Illegal Register
158 DEFSYM %H1ILF==1_0. ; Illegal Function
160 DEFSYM %HRATN=:776716 ;ATTENTION SUMMARY.
161 ; Each bit 7-0 corresponds to a drive asserting ATA.
163 DEFSYM %HRLAH=:776720 ;LOOK AHEAD.
164 ; 2.2 - 1.7 Sector Count.
165 ; 1.6 - 1.5 Encoded Extension Field.
167 DEFSYM %HRBUF=:776722 ;DATA BUFFER.
169 DEFSYM %HRMNT=:776724 ;MAINTENANCE.
171 DEFSYM %HRTYP=:776726 ;DRIVE TYPE.
172 ; 2.7 NOT BLOCK ADDRESSED
174 ; 2.5 Moving Head (better be a 1!!)
175 ; 2.3 Drive Request Required
176 ; 1.9 - 1.1 Drive Type Number:
177 ; RP04 = 20, RP05 = 21,
178 ; RP06 = 22, RM03 = 24,
179 ; RM80 = 26, RP07 = 42
181 DEFSYM %HRSER=:776730 ;SERIAL NUMBER.
183 DEFSYM %HROFS=:776732 ;OFFSET.
185 ; 2.7 Sign Change (RP06 only)
186 ; 2.7 Command Modifier (RP07 only)
187 ; Must be set before %HMWHD, %HMWTD or %HMRTD
188 ; 2.6 Move Track Descriptor (RP07 only)
189 ; 0 = 128. bit track descriptor
190 ; 1 = 344. bit track descriptor
191 ; 2.4 Format Bit (1=16, 0=18)
193 ; 2.2 Header Compare Inhibit
194 ; 2.1 Skip Sector Inhibit (RM 16bit only)
197 ; 1.8 - 1.1 Unused on RP07
198 ; RP07 doesn't support offsets
201 ; 1.8 - 1.1 Offset Info
208 ; Centerline 00000000
212 ; 1.8 Offset Direction
213 ; 0 - Away from spindle
214 ; 1 - Towards spindle
216 DEFSYM %HRCYL=:776734 ;DESIRED CYLINDER.
220 DEFSYM %HRCCY=:776736 ;CURRENT CYLINDER.
222 DEFSYM %HRER2=:776740 ;ERROR 2.
223 DEFSYM %H2NHS==1_10. ; No Head Selection
224 DEFSYM %H2WRU==1_8. ; Write Ready Unsafe
226 DEFSYM %HRER3=:776742 ;ERROR 3.
227 DEFSYM %H3OFC==1_15. ; Off Cylinder
228 DEFSYM %H3SKI==1_14. ; Seek Incomplete (also sets UNS+ATA+PIP+RDY)
229 DEFSYM %H3DCL==1_6. ; DC power low (or perhaps AC?)
230 DEFSYM %H3ACL==1_5. ; AC power low (or perhaps DC?)
231 ; (the documentation is confused about
238 DEFSYM %HRCCY=:776736 ;CURRENT CYLINDER.
240 DEFSYM %HRER2=:776740 ;ERROR 2.
241 DEFSYM %H2PRG==1_15. ; Program Error
242 DEFSYM %H2CRM==1_14. ; Control ROM parity error
243 DEFSYM %H2H88==1_13. ; 8080 in drive is hung
244 ;; DEC unimaginatively calls the following three bits
245 ;; READ/WRITE UNSAFE 1, 2 and 3.
246 DEFSYM %H2WU3==1_12. ; Write current when no write in progress
247 DEFSYM %H2WU2==1_11. ; More than one head selected
248 DEFSYM %H2WU1==1_10. ; No write transitions during a write
249 DEFSYM %H2WOV==1_9. ; Write Overrun
250 DEFSYM %H2WRU==1_8. ; Write Ready Unsafe
251 DEFSYM $H2COD==.BP 377 ; Error Code
253 ;; 012 Seek operation too long.
254 ;; 013 Guard band detected during seek operation.
255 ;; 014 Seek operation overshoot.
256 ;; 104 Guard band detection failure during recalibrate operation.
257 ;; 105 Reference gap or guard band pattern detection failure during
258 ;; recalibrate operation.
259 ;; 106 Seek error during recalibrate operation.
260 ;; 112 Heads have attempted to land on guard band during recalibrate
263 DEFSYM %HRER3=:776742 ;ERROR 3.
264 DEFSYM %H3BDS==1_15. ; Bad Sector
265 DEFSYM %H3SKI==1_14. ; Seek Incomplete (see error code in ER2)
266 DEFSYM %H3DSE==1_13. ; Defect Skip Error
267 DEFSYM %H3WCF==1_12. ; Write Current Failure
268 DEFSYM %H3LCF==1_11. ; Logic Control Failure
269 DEFSYM %H3LBC==1_10. ; Loss of Bit Clock
270 DEFSYM %H3LCE==1_9. ; Loss of Cylinder Error
271 DEFSYM %H3X88==1_8. ; 8080 in drive failed to respond to a command
272 DEFSYM %H3DCK==1_7. ; Device Check
273 DEFSYM %H3WHD==1_6. ; Index Unsafe (Bad %HMWHD)
274 DEFSYM %H3DCL==1_5. ; DC Low voltage
275 DEFSYM %H3SDF==1_4. ; Serdes Data (data buffer timing) Failure
276 DEFSYM %H3PAR==1_3. ; Data Parity Error during write operation
277 DEFSYM %H3SYB==1_2. ; Sync Byte error
278 DEFSYM %H3SYC==1_1. ; Sync Clock failure
279 DEFSYM %H3RTM==1_0. ; Run timeout
284 ; RM has no Current Cylinder Register, the Error 2 Register is
285 ; in a different place with different bits, and there is no
288 DEFSYM %HRER2=:776742 ;ERROR 2.
289 DEFSYM %H2BSE==1_15. ; Bad Sector (sector marked bad on disk)
290 DEFSYM %H2SKI==1_14. ; Seek Incomplete (also sets UNS+ATA+PIP+RDY)
291 DEFSYM %H2OPE==1_13. ; Drive address plug was removed
292 DEFSYM %H2IVC==1_12. ; Invalid Command (really drive not valid)
293 DEFSYM %H2LSC==1_11. ; LSC Sucks
294 DEFSYM %H2LBC==1_10. ; Loss of Bitcheck (hardware lossage)
295 DEFSYM %H2DVC==1_7 ; Device Check (generic hardware lossage)
296 DEFSYM %H2SSE==1_5 ; Skip Sector found (can't happen in 18bit)
297 DEFSYM %H2DPE==1_3 ; Data Parity Error in controller
301 DEFSYM %HRPOS=:776744 ;ECC POSITION.
303 DEFSYM %HRPAT=:776746 ;ECC PATTERN.
305 IFN $$TEMP,EXPUNG DEFSYM