Upgrade to GPLv3
[its.git] / system / rh11.defs38
1 ; -*- Midas -*-
2 ;;; Copyright (c) 1999 Massachusetts Institute of Technology
3 ;;;
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 3 of the
7 ;;; License, or (at your option) any later version.
8 ;;;
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.
13 ;;;
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.
17
18 .AUXIL
19
20 ; Canonical symbol definition macro, FOO==BAR with error check.
21 IFNDEF DEFSYM,[ 
22 DEFINE DEFSYM X/
23 IRPS Z,,[X]
24 IFNDEF Z,X
25 .ELSE [ $$TEM1==Z
26         X
27         IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
28       ]
29 .ISTOP
30 TERMIN TERMIN
31 $$TEMP==1
32 ] ;IFNDEF DEFSYM
33 .ELSE, $$TEMP==0
34
35 ; For now, must have a disk type defined to get the correct register
36 ; definitions. 
37
38 IFNDEF RP06P,RP06P==0
39 IFNDEF RM03P,RM03P==0
40 IFNDEF RM80P,RM80P==0
41
42 IFE RP06P+RM03P+RM80P,.FATAL No disk type specified in RH11 DEFS
43 IFN RP06P,IFN RM03P+RM80P,.FATAL RP/RM Register conflict in RH11 DEFS
44
45 \f
46 ;;; Disk RH11 Interrupt vector:
47 DEFSYM  PHVEC==254              ; Interrupts occur on level 6
48                                 ; (high priority) on UBA #1.
49
50 ;;; Disk RH11 Unibus register addresses:
51
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
64
65 ;;; Commands with bit 0 (GO) included:
66
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  %HMWHD==63      ; Write Header And Data (format the pack)
77 DEFSYM  %HMRED==71      ; Read Data
78 DEFSYM  %HMRHD==73      ; Read Header and Data
79 DEFSYM  %HMSEK==5       ; Seek to Cylinder
80 DEFSYM  %HMOFS==15      ; Offset Heads Slightly
81 DEFSYM  %HMCEN==17      ; Return Heads To Centerline
82 DEFSYM  %HMACK==23      ; Acknowledge mounting of pack (required before I/O)
83 DEFSYM  %HMRDP==21      ; Read-In Preset
84
85 DEFSYM  %HRWC=:776702           ;WORD COUNT.
86
87 DEFSYM  %HRBA=:776704           ;UNIBUS ADDRESS.
88
89 DEFSYM  %HRADR=:776706          ;DESIRED ADDRESS.
90 ; DEFSYM        $HATRK==.BP 7700        ; Bits 12-8 are track.
91 ; DEFSYM        $HASEC==.BP 0077        ; Bits 5-0  are sector.
92   DEFSYM        $HATRK==.BP 17400       ; Track 0-22
93   DEFSYM        $HASEC==.BP 37          ; Sector 0-23 (128 words each)
94 \f
95 DEFSYM  %HRCS2=:776710          ;CTRL AND STATUS 2.
96  DEFSYM %HYDLT==1_15.           ; Data Late
97  DEFSYM %HYWCE==1_14.           ; Write Check Error
98  DEFSYM %HYPE== 1_13.           ; Parity Error
99  DEFSYM %HYNED==1_12.           ; Non-existant Drive
100  DEFSYM %HYNEM==1_11.           ; %HRBA is NXM during DMA
101  DEFSYM %HYPGE==1_10.           ; Program Error
102  DEFSYM %HYMXF==1_9.            ; Missed Transfer
103  DEFSYM %HYMDP==1_8.            ; Mass Data Bus Parity Error
104  DEFSYM %HYOR== 1_7.            ; Output Ready (for Silo buffer diag.)
105  DEFSYM %HYIR== 1_6.            ; Input  Ready (for Silo buffer diag.)
106  DEFSYM %HYCLR==1_5.            ; Controller Clear
107  DEFSYM %HYPAT==1_4.            ; Parity Test
108  DEFSYM %HYBAI==1_3.            ; Unibus Address Increment Inhibit
109  DEFSYM $HYDSK==.BP 7           ; Bits 2-0 are the Unit Select.
110
111 DEFSYM  %HRSTS=:776712          ;DRIVE STATUS.
112  DEFSYM %HSATN==1_15.           ; Attention Active
113  DEFSYM %HSERR==1_14.           ; Error
114  DEFSYM %HSPIP==1_13.           ; Positioning In Progress
115  DEFSYM %HSMOL==1_12.           ; Medium On-Line
116  DEFSYM %HSWRL==1_11.           ; Write Locked
117  DEFSYM %HSLST==1_10.           ; Last Sector Transferred
118  DEFSYM %HSPGM==1_9.            ; Programmable
119  DEFSYM %HSDPR==1_8.            ; Drive Present
120  DEFSYM %HSRDY==1_7.            ; Drive Ready
121  DEFSYM %HSVV== 1_6.            ; Volume Valid
122 ; These are RP04-only bits in %HRSTS
123 ; DEFSYM        %HSDE1==1_5.            ; Difference Equals 1
124 ; DEFSYM        %HSL64==1_4.            ; Difference Less Than 64
125 ; DEFSYM        %HSGRV==1_3.            ; Go Reverse
126 ; DEFSYM        %HSDIG==1_2.            ; Drive To Inner Guard Band
127 ; DEFSYM        %HSF20==1_1.            ; Drive Forward 20in/sec
128 ; DEFSYM        %HSF5== 1_0.            ; Drive Forward 5in/sec
129
130 DEFSYM  %HRER1=:776714          ;ERROR 1.
131  DEFSYM %H1ECC==1_15.           ; Data Check
132  DEFSYM %H1UNS==1_14.           ; Unsafe
133  DEFSYM %H1OPI==1_13.           ; Operation Incomplete
134  DEFSYM %H1DTE==1_12.           ; Drive Timing Error
135  DEFSYM %H1WLK==1_11.           ; Write Lock Error
136  DEFSYM %H1IAE==1_10.           ; Invalid Address Error
137  DEFSYM %H1AOE==1_9.            ; Address Overflow Error
138  DEFSYM %H1CRC==1_8.            ; Header CRC Error
139  DEFSYM %H1HCE==1_7.            ; Header Compare Error
140  DEFSYM %H1ECH==1_6.            ; ECC Hard Error
141  DEFSYM %H1WCF==1_5.            ; Write Lock Fail
142  DEFSYM %H1FER==1_4.            ; Format Error
143  DEFSYM %H1PAR==1_3.            ; Parity Error
144  DEFSYM %H1RMR==1_2.            ; Register Modification Refused
145  DEFSYM %H1ILR==1_1.            ; Illegal Register
146  DEFSYM %H1ILF==1_0.            ; Illegal Function
147
148 DEFSYM  %HRATN=:776716          ;ATTENTION SUMMARY.
149         ; Each bit 7-0 corresponds to a drive asserting ATA.
150 \f
151 DEFSYM  %HRLAH=:776720          ;LOOK AHEAD.
152                                 ; 2.2 - 1.7  Sector Count.
153                                 ; 1.6 - 1.5  Encoded Extension Field.
154
155 DEFSYM  %HRBUF=:776722          ;DATA BUFFER.
156
157 DEFSYM  %HRMNT=:776724          ;MAINTENANCE.
158
159 DEFSYM  %HRTYP=:776726          ;DRIVE TYPE.
160                                 ; 2.7  NOT BLOCK ADDRESSED
161                                 ; 2.6  TAPE
162                                 ; 2.5  Moving Head (better be a 1!!)
163                                 ; 2.3  Drive Request Required
164                                 ; 1.9 - 1.1  Drive Type Number:
165                                 ;  RP04 = 20, RP05 = 21,
166                                 ;  RP06 = 22, RM03 = 24,
167                                 ;  RM80 = 26
168
169 DEFSYM  %HRSER=:776730          ;SERIAL NUMBER.
170
171 DEFSYM  %HROFS=:776732          ;OFFSET.
172                                 ; 2.9-2.8 Unused
173                                 ; 2.7  Sign Change (RP06 only)
174                                 ; 2.4  Format Bit (1=16, 0=18)
175                                 ; 2.3  ECC Inhibit
176                                 ; 2.2  Header Compare Inhibit
177                                 ; 2.1  Skip Sector Inhibit (RM 16bit only)
178                                 ; 1.9  Unused
179                                 ; 
180                                 ; RP06 Offsets
181                                 ; 1.8 - 1.1  Offset Info
182                                 ;   +400  u"   00010000
183                                 ;   -400  u"   10010000
184                                 ;   +800  u"   00100000
185                                 ;   -800  u"   10100000
186                                 ;   +1200 u"   00110000
187                                 ;   -1200 u"   10110000
188                                 ;   Centerline 00000000
189
190                                 ; RMxx Offsets
191                                 ; 1.1-1.7  Unused
192                                 ; 1.8  Offset Direction
193                                 ;   0 - Away from spindle
194                                 ;   1 - Towards spindle
195
196 DEFSYM  %HRCYL=:776734          ;DESIRED CYLINDER.
197
198 IFN RP06P,[
199
200 DEFSYM  %HRCCY=:776736          ;CURRENT CYLINDER.
201
202 DEFSYM  %HRER2=:776740          ;ERROR 2.
203  DEFSYM %H2NHS==1_10.           ; No Head Selection
204  DEFSYM %H2WRU==1_8.            ; Write Ready Unsafe
205
206 DEFSYM  %HRER3=:776742          ;ERROR 3.
207  DEFSYM %H3OFC==1_15.           ; Off Cylinder
208  DEFSYM %H3SKI==1_14.           ; Seek Incomplete (also sets UNS+ATA+PIP+RDY)
209  DEFSYM %H3DCL==1_6.            ; DC power low (or perhaps AC?)
210  DEFSYM %H3ACL==1_5.            ; AC power low (or perhaps DC?)
211                                 ; (the documentation is confused about
212                                 ; which is which.)
213 ]
214
215 IFN RM03P+RM80P,[
216 ; RM has no Current Cylinder Register, the Error 2 Register is
217 ; in a different place with different bits, and there is no 
218 ; Error 3 register
219
220 DEFSYM  %HRER2=:776742          ;ERROR 2.
221  DEFSYM %H2BSE==1_15.           ; Bad Sector (sector marked bad on disk)
222  DEFSYM %H2SKI==1_14.           ; Seek Incomplete (also sets UNS+ATA+PIP+RDY)
223  DEFSYM %H2OPE==1_13.           ; Drive address plug was removed
224  DEFSYM %H2IVC==1_12.           ; Invalid Command (really drive not valid)
225  DEFSYM %H2LSC==1_11.           ; LSC Sucks
226  DEFSYM %H2LBC==1_10.           ; Loss of Bitcheck (hardware lossage)
227  DEFSYM %H2DVC==1_7             ; Device Check (generic hardware lossage)
228  DEFSYM %H2SSE==1_5             ; Skip Sector found (can't happen in 18bit)
229  DEFSYM %H2DPE==1_3             ; Data Parity Error in controller
230 ]
231
232 DEFSYM  %HRPOS=:776744          ;ECC POSITION.
233
234 DEFSYM  %HRPAT=:776746          ;ECC PATTERN.
235
236 IFN $$TEMP,EXPUNG DEFSYM