; -*- Midas -*- ;;; Copyright (c) 1999 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as ;;; published by the Free Software Foundation; either version 3 of the ;;; License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .AUXIL ; Canonical symbol definition macro, FOO==BAR with error check. IFNDEF DEFSYM,[ DEFINE DEFSYM X/ IRPS Z,,[X] IFNDEF Z,X .ELSE [ $$TEM1==Z X IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/` ] .ISTOP TERMIN TERMIN $$TEMP==1 ] ;IFNDEF DEFSYM .ELSE, $$TEMP==0 ; For now, must have a disk type defined to get the correct register ; definitions. IFNDEF RP06P,RP06P==0 IFNDEF RM03P,RM03P==0 IFNDEF RM80P,RM80P==0 IFE RP06P+RM03P+RM80P,.FATAL No disk type specified in RH11 DEFS IFN RP06P,IFN RM03P+RM80P,.FATAL RP/RM Register conflict in RH11 DEFS ;;; Disk RH11 Interrupt vector: DEFSYM PHVEC==254 ; Interrupts occur on level 6 ; (high priority) on UBA #1. ;;; Disk RH11 Unibus register addresses: DEFSYM %HRCS1=:776700 ;CTRL AND STATUS 1. DEFSYM %HXSC== 1_15. ; Special Condition DEFSYM %HXTRE==1_14. ; Transfer Error DEFSYM %HXMCP==1_13. ; Mass I/O Control Bus Parity Error DEFSYM %HXDVA==1_11. ; Drive Available DEFSYM %HXPSE==1_10. ; Port Select DEFSYM %HXA17==1_9. ; UB Address Extension Bit 17 DEFSYM %HXA16==1_8. ; UB Address Extension Bit 16 DEFSYM %HXRDY==1_7. ; Ready DEFSYM %HXIE== 1_6. ; Interrupt Enable DEFSYM $HXCMD==.BP 77 ; Bits 1-5 specify commands. DEFSYM %HXGO== 1_0. ; GO bit ;;; Commands with bit 0 (GO) included: DEFSYM %HMNOP==0 ; No Operation DEFSYM %HMUNL==3 ; Unload ("Standby" -- the pack doesn't fly off). DEFSYM %HMREC==7 ; Recalibrate DEFSYM %HMCLR==11 ; Drive clear (reset errors etc.) DEFSYM %HMRLS==13 ; Drive release (dual port) DEFSYM %HMSRC==31 ; Search (for r.p.s.) DEFSYM %HMWCH==51 ; Write Check (?doesn't work) DEFSYM %HMWCF==53 ; Write Check Format, Header and Data (?doesn't work) DEFSYM %HMWRT==61 ; Write Data DEFSYM %HMWHD==63 ; Write Header And Data (format the pack) DEFSYM %HMRED==71 ; Read Data DEFSYM %HMRHD==73 ; Read Header and Data DEFSYM %HMSEK==5 ; Seek to Cylinder DEFSYM %HMOFS==15 ; Offset Heads Slightly DEFSYM %HMCEN==17 ; Return Heads To Centerline DEFSYM %HMACK==23 ; Acknowledge mounting of pack (required before I/O) DEFSYM %HMRDP==21 ; Read-In Preset DEFSYM %HRWC=:776702 ;WORD COUNT. DEFSYM %HRBA=:776704 ;UNIBUS ADDRESS. DEFSYM %HRADR=:776706 ;DESIRED ADDRESS. ; DEFSYM $HATRK==.BP 7700 ; Bits 12-8 are track. ; DEFSYM $HASEC==.BP 0077 ; Bits 5-0 are sector. DEFSYM $HATRK==.BP 17400 ; Track 0-22 DEFSYM $HASEC==.BP 37 ; Sector 0-23 (128 words each) DEFSYM %HRCS2=:776710 ;CTRL AND STATUS 2. DEFSYM %HYDLT==1_15. ; Data Late DEFSYM %HYWCE==1_14. ; Write Check Error DEFSYM %HYPE== 1_13. ; Parity Error DEFSYM %HYNED==1_12. ; Non-existant Drive DEFSYM %HYNEM==1_11. ; %HRBA is NXM during DMA DEFSYM %HYPGE==1_10. ; Program Error DEFSYM %HYMXF==1_9. ; Missed Transfer DEFSYM %HYMDP==1_8. ; Mass Data Bus Parity Error DEFSYM %HYOR== 1_7. ; Output Ready (for Silo buffer diag.) DEFSYM %HYIR== 1_6. ; Input Ready (for Silo buffer diag.) DEFSYM %HYCLR==1_5. ; Controller Clear DEFSYM %HYPAT==1_4. ; Parity Test DEFSYM %HYBAI==1_3. ; Unibus Address Increment Inhibit DEFSYM $HYDSK==.BP 7 ; Bits 2-0 are the Unit Select. DEFSYM %HRSTS=:776712 ;DRIVE STATUS. DEFSYM %HSATN==1_15. ; Attention Active DEFSYM %HSERR==1_14. ; Error DEFSYM %HSPIP==1_13. ; Positioning In Progress DEFSYM %HSMOL==1_12. ; Medium On-Line DEFSYM %HSWRL==1_11. ; Write Locked DEFSYM %HSLST==1_10. ; Last Sector Transferred DEFSYM %HSPGM==1_9. ; Programmable DEFSYM %HSDPR==1_8. ; Drive Present DEFSYM %HSRDY==1_7. ; Drive Ready DEFSYM %HSVV== 1_6. ; Volume Valid ; These are RP04-only bits in %HRSTS ; DEFSYM %HSDE1==1_5. ; Difference Equals 1 ; DEFSYM %HSL64==1_4. ; Difference Less Than 64 ; DEFSYM %HSGRV==1_3. ; Go Reverse ; DEFSYM %HSDIG==1_2. ; Drive To Inner Guard Band ; DEFSYM %HSF20==1_1. ; Drive Forward 20in/sec ; DEFSYM %HSF5== 1_0. ; Drive Forward 5in/sec DEFSYM %HRER1=:776714 ;ERROR 1. DEFSYM %H1ECC==1_15. ; Data Check DEFSYM %H1UNS==1_14. ; Unsafe DEFSYM %H1OPI==1_13. ; Operation Incomplete DEFSYM %H1DTE==1_12. ; Drive Timing Error DEFSYM %H1WLK==1_11. ; Write Lock Error DEFSYM %H1IAE==1_10. ; Invalid Address Error DEFSYM %H1AOE==1_9. ; Address Overflow Error DEFSYM %H1CRC==1_8. ; Header CRC Error DEFSYM %H1HCE==1_7. ; Header Compare Error DEFSYM %H1ECH==1_6. ; ECC Hard Error DEFSYM %H1WCF==1_5. ; Write Lock Fail DEFSYM %H1FER==1_4. ; Format Error DEFSYM %H1PAR==1_3. ; Parity Error DEFSYM %H1RMR==1_2. ; Register Modification Refused DEFSYM %H1ILR==1_1. ; Illegal Register DEFSYM %H1ILF==1_0. ; Illegal Function DEFSYM %HRATN=:776716 ;ATTENTION SUMMARY. ; Each bit 7-0 corresponds to a drive asserting ATA. DEFSYM %HRLAH=:776720 ;LOOK AHEAD. ; 2.2 - 1.7 Sector Count. ; 1.6 - 1.5 Encoded Extension Field. DEFSYM %HRBUF=:776722 ;DATA BUFFER. DEFSYM %HRMNT=:776724 ;MAINTENANCE. DEFSYM %HRTYP=:776726 ;DRIVE TYPE. ; 2.7 NOT BLOCK ADDRESSED ; 2.6 TAPE ; 2.5 Moving Head (better be a 1!!) ; 2.3 Drive Request Required ; 1.9 - 1.1 Drive Type Number: ; RP04 = 20, RP05 = 21, ; RP06 = 22, RM03 = 24, ; RM80 = 26 DEFSYM %HRSER=:776730 ;SERIAL NUMBER. DEFSYM %HROFS=:776732 ;OFFSET. ; 2.9-2.8 Unused ; 2.7 Sign Change (RP06 only) ; 2.4 Format Bit (1=16, 0=18) ; 2.3 ECC Inhibit ; 2.2 Header Compare Inhibit ; 2.1 Skip Sector Inhibit (RM 16bit only) ; 1.9 Unused ; ; RP06 Offsets ; 1.8 - 1.1 Offset Info ; +400 u" 00010000 ; -400 u" 10010000 ; +800 u" 00100000 ; -800 u" 10100000 ; +1200 u" 00110000 ; -1200 u" 10110000 ; Centerline 00000000 ; RMxx Offsets ; 1.1-1.7 Unused ; 1.8 Offset Direction ; 0 - Away from spindle ; 1 - Towards spindle DEFSYM %HRCYL=:776734 ;DESIRED CYLINDER. IFN RP06P,[ DEFSYM %HRCCY=:776736 ;CURRENT CYLINDER. DEFSYM %HRER2=:776740 ;ERROR 2. DEFSYM %H2NHS==1_10. ; No Head Selection DEFSYM %H2WRU==1_8. ; Write Ready Unsafe DEFSYM %HRER3=:776742 ;ERROR 3. DEFSYM %H3OFC==1_15. ; Off Cylinder DEFSYM %H3SKI==1_14. ; Seek Incomplete (also sets UNS+ATA+PIP+RDY) DEFSYM %H3DCL==1_6. ; DC power low (or perhaps AC?) DEFSYM %H3ACL==1_5. ; AC power low (or perhaps DC?) ; (the documentation is confused about ; which is which.) ] IFN RM03P+RM80P,[ ; RM has no Current Cylinder Register, the Error 2 Register is ; in a different place with different bits, and there is no ; Error 3 register DEFSYM %HRER2=:776742 ;ERROR 2. DEFSYM %H2BSE==1_15. ; Bad Sector (sector marked bad on disk) DEFSYM %H2SKI==1_14. ; Seek Incomplete (also sets UNS+ATA+PIP+RDY) DEFSYM %H2OPE==1_13. ; Drive address plug was removed DEFSYM %H2IVC==1_12. ; Invalid Command (really drive not valid) DEFSYM %H2LSC==1_11. ; LSC Sucks DEFSYM %H2LBC==1_10. ; Loss of Bitcheck (hardware lossage) DEFSYM %H2DVC==1_7 ; Device Check (generic hardware lossage) DEFSYM %H2SSE==1_5 ; Skip Sector found (can't happen in 18bit) DEFSYM %H2DPE==1_3 ; Data Parity Error in controller ] DEFSYM %HRPOS=:776744 ;ECC POSITION. DEFSYM %HRPAT=:776746 ;ECC PATTERN. IFN $$TEMP,EXPUNG DEFSYM