Technical Reference Options and Adapters Volume 2 2of3
Technical Reference Options and Adapters Volume 2 2of3
Hardware Reference
Library
mM Printer Adapter
6361507
ii
Contents
Description .................................... 1
Programming Considerations ...................... 3
Specifications .................................. 7
Logic Diagrams ................................. 9
iii
iv
Description
The input/ output signals are made available at the back of the
adapter through a right-angle, printed-circuit-board-mounted,
25-pin, D-shell connector. This connector protrudes through the
rear panel of the system unit or expansion unit, where a cable may
be attached.
The output ports may also be read at the card's interface for
diagnostic loop functions. This allows faults to be isolated to the
adapter or the attaching device.
Printer Adapter 1
The following is a block diagram of the Printer Adapter.
8 25-Pin D-Shell
Connector
~U'BUff"8 .Data Latch 8
po
~ Trans- .....
...
8
...
ceiver
r DIR
~ O.C.
Read Drivers SLCTIN
~
A Data
STROBE
Write Data po
Command AUTO
Decoder Write Control
- -
FDXT
Read Status
-INIT
Read
Control
-
A
Bus Control
Buffers Latch
~ Enable
~ ..... Clock r-
5 ERROR
po
4 Enable SLCT
R eset
r r.. ~ Clear PE
ACK
BUSY
2 Printer Adapter
Programming Considerations
Printer Adapter
The instruction captures data from the data bus and is present on
the respective pins. Each of these pins is capable of sourcing 2.6
rnA and sinking 24 rnA.
It is essential that the external device does not try to pull these
lines to ground.
Printer Adapter
Printer Adapter 3
respective pins as shown in the previous figure. If bit 4 is written
as aI, the card will interrupt the system unit's microprocessor on
the condition that pin 10 changes from high to low.
Printer Adapter
Input from address hex 378
Printer Adapter
Input from address hex 379
BitO
Printer Adapter
Input from address hex 37 A
4 Printer Adapter
This instruction causes the data present on pins 1, 14, 16, 17, and
the IRQ bit to be read by the system unit's microprocessor. In
the absence of external drive applied to these pins, data read by
the system unit's microprocessor will match data last written to
hex 3BE in the same bit positions. Notice that data bits 0-2 are
not included. If external drivers are dotted to these pins, that
data will be ORed with data applied to the pins by the hex 3BE
latch.
These pins assume the states shown after a reset from the system
unit's microprocessor.
Printer Adapter 5
6 Printer Adapter
Specifica tions
25-Pin D-Shell
Connector
o
• • 14
• •
• •
• •
• •
• •
• •
•• •
•
•• ••
• • 25
13 •
o
At Standard TTL Levels
Signal Adapter
Name Pin Number
- Strobe 1
+ Data Bit 0 2
+ Data Bit 1 3
+ Data Bit 2 4
+ Data Bit 3 5
+ Data Bit 4 6
+ Data Bit 5 7
+ Data Bit 6 8
Printer + Data Bit 7 9 Printer
- Acknowledge 10 Adapter
+ Busy 11
+ P.End (out of paper) 12
+ Select 13
- Auto Feed 14
- Error 15
- Initialize Printer 16
- Select Input 17
Ground 18-25
Connector Specifications
Printer Adapter 7
8 Printer Adapter
Logic Diagrams
The following page contains the logic diagram for the IBM Printer
Adapter.
Printer Adapter 9
~""
,~ -"--NO ..
---..- oM
~ , !:, '"
."
~LFrE5~J'"
... ~
- -~'
.: "' COXl.""""
.:~~~
.. .-. " ..~
fTTT~ ~
tf
m .. .~
,
ri' ~ .~
E
~
r--- --'" --~-L'.-n-"";·'''' '~
t.
~[Jt
~
, roo '"
.on.
....
~!.D ,r<::."
-~.
....... I.tk,
~:§~
-"
-.~ v ...,..
,,~,~
~,
mM 5-114" Diskette
Drive Adapter
6361505
ii
Contents
Description .................................... 1
Programming Considerations ...................... 3
Digital-Output Register ...................... 3
Floppy Disk Controller ....................... 4
Command Summary ......................... 8
Programming Summary ...................... 17
Interface ..................................... 19
System 110 Channel Interface ................ 19
Drive A and B Interface ..................... 20
Specifications ................................. 23
Logic Diagrams ................................ 25
iii
iv
Description
The IBM 5-1/4" Diskette Drive Adapter fits into one of the
expansion slots in the system unit. It is connected to one or two
diskette drives through an internal, daisy-chained flat cable. The
adapter has a connector at the other end that extends through the
rear panel of the system unit. This connector has signals for two
additional external diskette drives; thus, the 5-1/4 inch diskette
drive adapter can attach four 5-1/4 inch drives - two internal
and two external.
Diskette Adapter 1
Clock
and
Timing
Circuit
1
• Write
. • Write
Precompensate
Circuit ~
Write Data
t'-- .../
I Data Read Data
Data
VCO SYNC· Separator
<}- I--
I-
STD. DATA
~ Buffer
I'r- r-v'
NEC
Floppy
Disk
""
Data Window
V
Step
Direction
Write Enable
f " , ,
~-
Controller
V Head Select
Index
I"" "'-.J Write Protect
./1 '-J Track 0
iRes~t f-- B
Drive A Motor On
Digital
~
f--C
Control Decoder f--D Drive A Select
'1
Port
I-- B
INTR. f-- C
I I-- D
Digital-Output Register
The Digital-Output register (DOR) is an output-only register used
to control drive motors, drive selection, and feature enable. All
bits are cleared by the I/O interface 'reset' line. The bits have the
following functions:
Bit 1 0 Drive
00 0 (A)
o1 1 (B)
10 2 (e)
11 3 (D)
Diskette Adapter 3
Floppy Disk Controller
The floppy disk controller (FDC) contains two registers that may
be accessed by the system unit's microprocessor: a status register
and a data register. The 8-bit main status register contains the
status information of the FDC and may be accessed at any time.
The 8-bit data register (actually consisting of several registers in a
stack with only one register presented to the data bus at a time)
stores data, commands, parameters, and provides floppy disk
drive (FDD) status information. Data bytes are read from or
written to the data register in order to program or obtain results
after a particular command. The main status register can only be
read and is used to facilitate the transfer of data between the
system unit's microprocessor and FDC.
The bits in the main status register (hex 34F) are defined as
follows:
Bit
Number Name Symbol Description
DBO FDD A Busy DAB FDD number 0 is in the Seek mode.
DB1 FDD B Busy DBB FDD number 1 is in the Seek mode.
DB2 FDD C Busy DCB FDD number 2 is in the Seek mode.
DB3 FDD 0 Busy DDB FDD number 3 is in the Seek mode.
DB4 FOC Busy CB A read or write command is in process.
DB5 Non-DMA NDM The FDC is in the non-DMA mode.
Mode
DB6 Data Inputl 010 Indicates direction of data transfer
Output between FDC and processor. If DIO =" 1;'
then transfer is from FDC data register to
the processor. If 010 = "0;' then transfer
is from the processor to FDC data register.
DB7 Request for ROM Indicates data register is ready to send or
Master receive data to or from the processor. Both
bits 010 and ROM should be used to
perform the handshaking functions of
"ready" and "direction" to the processor.
4 Diskette Adapter
unit's microprocessor. Because of this multi-byte interchange of
information between the FDC and the system unit's
microprocessor, it is convenient to consider each command as
consisting of three phases:
Command Phase
The FDC receives all information required to perform a particular
operation from the system unit's microprocessor.
Execution Phase
The FDC performs the operation it was instructed to do.
Result Phase
After completion of the operation, status and other housekeeping
information are made available to the system unit's
microprocessor.
Diskette Adapter 5
Symbol Name Description
6 Diskette Adapter
Symbol Name Description
Diskette Adapter 7
Command Summary
In the following table, 0 indicates "logical 0" for that bit, 1 means
"logical 1," and X means "don't care."
Data Bus
Phase R/W D7 D6 D5 D4 D3 D2 D1 DO Remarks
Read Data
Command W MT MF SK 0 0 1 1 0 Command Codes
W X X X X X HD US1 usa
w C Sector ID information
W H prior to command
W R execution.
W N
W EOT
W GPL
W DTL
Execution Data transfer
between the FDD
and main system.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C Sector ID information
R H after command
R R execution.
R N
Read Deleted Data
Command W MT MF SK 0 1 1 0 0 Command Codes
W X X X X X HDUS1USO
W C Sector ID information
W H prior to command
W R execution.
W N
W EOT
W GPL
W DTL
Execution Data transfer
between the FDD
and main system.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C Sector ID information
R H after command
R R execution.
R N
8 Diskette Adapter
Data Bus
Phase R/W 07 06 05 04 03 02 01 DO Remarks
Write Data
Command W MT MF 0 a a 1 a 1 Command Codes
W X X X X X HO US1 usa
W C Sector 10 information
W H prior to command
W R execution.
W N
W EOT
W GPL
W OTL
Execution Data transfer
between the main
system and FOO.
Result R ST a Status information
R ST 1 after command
R ST 2 execution.
R C Sector 10 information
R H after command
R R execution.
R N
Write Deleted Data
Command W MT MF a a 1 1a a Command Codes
W X X X X X HO US1 usa
w C Sector 10 information
W H prior to command
W R execution.
W N
W EOT
W GPL
W OTL
Execution Data transfer
between the FOD and
main system.
Result R STa Status 10 information
R ST 1 after command
R ST 2 execution.
R C Sector 10 information
R H after command
R R execution.
R N
Diskette Adapter 9
Oata Bus
Phase R/W 07 06 05 04 03 02 01 00 Remarks
Read a Track
Command W 0 MF SK 0 0 0 1 0 Command Codes
W X X X X X HO US1 usa
w C Sector ID information
W H prior to command
W R execution.
W N
W EOT
W GPL
W DTL
Execution Data transfer
between the FDD
and main system.
FDC reads all of
cylinder's contents
from index hole to
EOT.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C Sector ID information
R H after command
R R execution.
R N
Read 10
Command W 0 MF 0 0 1 0 1 0 Command Codes
W X X X X X HD US1 usa
Execution The first correct ID
information on the
cylinder is stored in
data register.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C Sector ID information
R H during execution
R R phase.
R N
10 Diskette Adapter
Oata Bus
Phase R/W 07 06 05 04 03 02 01 00 Remarks
Format a Track
Command W 0 MF 0 0 1 1 0 0 Command Codes
W X X X X X HD US1 usa
W N Bytes/Sector
W SC Sector/Track
W GPL Gap 3
W D filler byte.
Execution FDC formats an
entire cylinder.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C In this case, the ID
R H information has no
R R meaning.
R N
Scan Equal
Command W MT MF SK 1 0 0 0 1 Command Codes
W X X X X X HD US1 usa
w C Sector ID information
W H prior to command
W R execution.
W N
W EOT
W GPL
W STP
Execution Data compared
between the FDD
and the main system.
Result R STO Status information
R ST 1 after Command
R ST 2 execution.
R C Sector ID information
R H after command
R R execution.
R N
Diskette Adapter 11
Oata Bus
Phase R/W 07 06 05 04 03 02 01 00 Remarks
Scan Low or Equal
Command W MT MF SK 1 1 0 0 1 Command Codes
W X X X X X HD US1 usa
w C Sector 10 information
W H prior to command
W R execution.
W N
W EOT
W GPL
W STP
Execution Data compared
between the FDD
and main system.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C Sector 10 information
R H after command
R R execution.
R N
Scan High or Equal
Command W MT MF SK 1 1 1 0 1 Command Codes
W X X X X X HD US1 usa
w C Sector 10 information
W H prior to command
W R execution.
W N
W EOT
W GPL
W STP
Execution Data compared
between the FDD
and main system.
Result R STO Status information
R ST 1 after command
R ST 2 execution.
R C Sector 10 information
R H after command
R R execution.
R N
12 Diskette Adapter
Data Bus
Phase R/W 07 06 05 04 03 02 01 DO Remarks
Recalibrate
Command W 0 0 0 0 0 1 1 1 Command Codes
W X X X X X 0 US1USO
Execution Head retracted to
No Result track 0
Phase
Sense Interrupt Status
Command W 0 0 0 0 1 0 0 0 Command Codes
Result R STO Status information at
R PCN the end of seek
operation about the
FOC
Specify
Command W 0 0 0 0 0 0 1 1 Command Codes
W t--SRT HUT-
W HLT ND
No Result
Phase
Sense Drive Status
Command W 0 0 0 0 0 1 0 0 Command Codes
W X X X X X HO US1 usa
Result R ST 3 Status information
about FDD.
Seek
Command W 0 0 0 0 1 1 1 1 Command Codes
W X X X X X HO US1 usa
w NCN
Execution Head is positioned
over proper cylinder
on diskette.
No Result
Phase
Invalid
Command W Invalid Codes Invalid command
codes (NoOp - FOC
goes into standby
state).
Result R STO ST 0: 80.
Diskette Adapter 13
Bit
No. Name Symbol Description
D7 D7 = 0 and D6 = 0
Interrupt IC Normal termination of command (NT).
Code Command was completed and properly
executed.
D6 D7 = 0 and D6 = 1
Abnormal termination of command (AT).
Execution of command was started, but
was not successfully completed.
D7 = 1 and D6 = 0
Invalid command issue (IC). Command
that was issued was never started.
D7 = 1 and D6 = 1
Abnormal termination because, during
command execution, the ready signal
from FDD changed state.
D5 Seek End SE When the FDC completes the seek
command, this flag is set to 1 (high).
D4 Equipment EC If a fault signal is received from the
Check FDD, or if the track 0 signal fails to occur
after 77 step pulses (recalibrate
command), then this flag is set.
D3 Not Ready NR When the FDD is in the not-ready state
and a read or write command is issued,
this flag is set. If a read or write command
is issued to side 1 of a single-sided drive,
then this flag is set.
D2 Head Address HD This flag is used to indicate the state of
the head at interrupt.
D1 Unit Select 1 US 1 These flags are used to indicate a drive
DO Unit Select 0 usa unit number at interrupt.
14 Diskette Adapter
Bit
No. Name Symbol Description
D7 End of EN When the FDC tries to access a sector
Cylinder beyond the final sector of a cylinder, this
flag is set.
D6 - - Not used. This bit is always 0 (low).
D5 Data Error DE When the FDC detects a CRC error in
either the ID field or the data field, this
flag is set.
D4 Over Run OR If the FDC is not serviced by the main
system during data transfers within a
certain time interval, this flag is set.
D3 - - Not used. This bit is always 0 (low).
D2 No Data ND During execution of a read data, write
deleted data, or scan command, if the
FDC cannot find the sector specified in
the ID register, this flag is set. During
execution of the read ID command, if the
FDC cannot read the ID field without an
error, then this flag is set. During the
execution of the read a cylinder
command, if the starting sector cannot be
found, then this flag is set.
D1 Not Writable NW During execution of a write data, write
deleted data, or format-a-cylinder
command, if the FDC detects a
write-protect signal from the FDD, then
this flag is set.
DO Missing MA If the FDC cannot detect the ID address
Address mark, this flag is set. Also, at the same
Mark time, the MD (missing address mark in
the data field) of status register 2 is set.
Diskette Adapter 15
Bit
No. Name Symbol Description
D7 - - Not used. This bit is always 0 (low).
D6 Control Mark CM During execution of the read data or scan
command, if the FDC encounters a sector
that contains a deleted data address
mark, this flag is set.
D5 Data Error in DD If the FDC detects a CRC error in the data,
Data Field then this flag is set.
16 Diskette Adapter
Bit
No. Name Symbol Description
07 Fault FT This bit is the status of the fault signal
from the FDD.
06 Write WP This bit is the status of the
Protected write-protected signal from the FDD.
05 Ready RY This bit is the status of the ready signal
from the FDD.
04 Track 0 TO This bit is the status of the track 0 signal
from the FDD.
03 Two Side TS This bit is the status of the two-side
signal from the FDD.
02 Head Address HD This bit is the status of the side-select
signal from the FDD.
01 Unit Select 1 US 1 This bit is the status of the unit-select-1
signal from the FDD.
DO Unit Select 0 USO This bit is the status of the unit-select-O
signal from the FDD.
Programming Summary
FDC Data Register I/O Address Hex 3F5
FDC Main Status Register I/O Address Hex 3F4
Digital Output Register I/O Address Hex 3F2
BitO Drive 00: DR #A 10: DR #C
1 Select 01:DR#B 11 : DR #0
2 Not FDC Reset
3 Enable INT & DMA Requests
4 Drive A Motor Enable
5 Drive B Motor Enable
6 Drive C Motor Enable
7 Drive 0 Motor Enable
All bits cleared with channel reset.
OPC Registers
Diskette Adapter 17
FDC Constants (in hex)
N: 02 GPL Format: 05
SC: 08 GPLR/W: 2A
HUT: F HLT: 01
SRT: C (6 ms track-to-track)
Drive Constants
Head Load 35 ms
Head Settle 15 ms
Motor Start 250 ms
Comments
• Head loads with drive select, wait HD load time before R/W.
18 Diskette Adapter
Interface
Diskette Adapter 19
+T/C (Adapter input, load: 4 74LS): This line along with
DACK2 being active indicates that the byte of data for
which the DMA count was initialized is now being
transferred.
20 Diskette Adapter
Adapter Outputs
Diskette Adapter 21
Adapter Inputs
- Write Protect The selected drive must make this line active
if a write-protected diskette is in the drive.
22 Diskette Adapter
Specifications
34- Pin Keyed
Edge Connector
Component
Side
Diskette Adapter 23
37-Pin D-Shell
Connector
o
1 • • 20
19 • 37
o
24 Diskette Adapter
(2) + El'A8LE DRtVE 314
!2) - ENABl.E DAM 314
+",11> 2118
'"
'"
'"
(S) + WRITE DATA
~~~~g~, ~,~il"~
lSI + WRITE ENABlE
(2) _ DRIVE SELECT 3
!2) _ DflIV£SELECT4
(2) _ MOTOftENABl.E3 10 DR[VES3&4 n
(2) _ MOTOR ENABLE 4
NOTES I &2
'"'"
+A9 (2)
I SIGNALS ON DRIVE PINS 10 THRU II> ARE SWAPPED BV THE DRIVE (ABLE
:~ :~ ".
,e,
+AEN
-lOR
(ll
12)
:~
TIO
:~ 8.21lFD
'" :~~ET l!:
14
I')
12
II
'"
,e'
,e,
_ +TC
_ _ +00
+01
(3)
(2)
(2)
II> TO 10
'"
'CO
,"
+02
_ _ _ +03
(2)
(2)
2 ALL DRiVES ARE JUMPERED FOR MULTIPLO OPERAT[ON. HEAD LOAD
WITH DRIVE SELECT AND DRIVE SELECT ViA INPUT PIN 12. TERMINATlNG
,,. .. 04
_ _ _ +05
(2)
(2)
:g~
_ _ +06 (2)
_ _ _ +07 (2)
rn .0'11 ",FO SHOULD BE ADJACENT TO MODU~ES MC ,'161. 1'+.8. 7451'1.lbMHZOSC.
RI'-I.I1C'I0'fI.11{'I02'I,74L5Ibl&74LSI'I1 B.2"Fl)CAPSSHOULD8ENEARAS'i)(lATED~ PltlS '"
_ _ _ OACK2 (3)
[LD ALL SlGtlAL UNES H["HER THAN OR EQUAL TO IMHZ SHOULD BE IIEPT TO THE
SHORTEST 'POSSIBLE LENGTH. THIS IS A PRIMARV DESIGN GOAL
') MAKE NO CONNEClIOt< TO UNUSED PINS ON 1HE VCO. CHARGE PUMP & DATA SEI'!!IRATOR MODULES
b ALL VOLTAGE AND (,ROUtlD eONtiECTIONS TO THE veo. CHARGE PUMP AND ASSOCIATED DISCRETE
COMPONENTS SHOULD 6E SEPARATE FROM OTHER CIRCUITS AND THEN JOINED TO THE OTHER
CiRCUITS AT ONE POINT
K:~'
11, +Ab
(1)
(1)
+A7
+AB
7'+:18,
I,
'"
, 74~~ L
(1) +A9
u"
~'SO»'~'----l1~~:~~,'~"r,'~~~====jt=L~~~-----------
,I
~ ~ rV UZ9
L __ -.JuIS
DRIVE SELECT 3
'"
~ ,"'mJ
----r---;======4::j"tl--' Ag~ ~I;~~~lll
~ ~ g~ :~ ~
(11 +AZ
II 6 U 14
J
Ll--______+-__________--+-lJ:::~,,~l:[).__t-'·'------------MOTOA
UI2 9 1"38-'1
ENABLE 2 (1)
__ ..J U ..
91
L-l-____________________-W===::l,,4=:[)~.lL-----------MOTOR
7'1'18-'118
ENABLE 3 (1)
p, -DA"
(3) Dl.CK< 12 ~ 14i8--I j'
'"'" 'D'
.00 L---t====================~==jt~==~~"=-----------
13
L_---1ulS
MQTORENABLE4 (1)
.02
'" 'D'
'"'"'" 'D'
.",
.""
'"'" .D7 '"
."
'''"""
HO
(1) -IOR
r
IK~~~
MR2 GlI'l
, t2 MHZ (21
~roo--oo2 ,
C::
+WRITE DATA III
D I~(~
+2TRQbNC TR 10 .----- ,
" ~~ R~:
.2 8 <A 7 + DIRECTION III
4 CLK!
~Ol
OSC.
~ ---L: ~-~CLKI
n .. we
CPI Qi :>--N( ~2A
7 .". I CLF 7 14 PO Q~ II = IS CLR ~~A
~D2 Q2~ IrEA
= NOTE 5J 74lS10'l ~ 14LS10"
~OB r-'!---
U2
"' U2 ~D~ ~~NC II IB
YB
,
.-" RD'
WE 2S
74lSIS'> UIO , +WRITE ENABLE III
17 lOX
III +!NOEX
, FRISTP ,7
.. 74LSOB
8 , +STEP III
III + WR'lTE PROTECT ~4 WPITS SEEK "3" 10
HDL~NC ""
, I 74lS0B USO~NC
USI t2t;- N(
~'
1~ FLT/TRO MF .... p-NC
U4
lC~ ~~ , +V FO SYNC (4)
HO 27 4
74LSOB
, ,
~4
+SELECT HEAD I III
(4) SfANDARDOATAiCLK
, 2~ ROO
(4) +OATA WINDOW 22 ROW
j.iPD7f;f)
CONTlJUEO FROM SHEET 4"'
1074LSOB
'"
(1)- OA(K 2 j==============~f5~====~==~==)!8~
9
74lS04
_____--------------------------------~, +DACK & TC 12j
I~ 7'il50B 14LSO'+
U" " DACK (2)
(2) +OMA GATE ~-------------~~~U'
... ....
"STANDARD DATA" GENI!RATOR
...
•.
~
~~. ~
11 J PR Q'
un
1'0Ic~C~ TC~
un
3~5 11
,..3L
.I
u..
.
!"....
Q •
, ,-----'- J •
~4 +STANDAltD DATA 131
. ,.
LS112 13 1/1 La11:t :I LA1" t1lLS112 1/2LS1U
'--( CK1/2
'--< OK ~PCP ,-----'-< OK ~ CO<
-7f-
orL- r -7.t- Q' rEO'-7f- ~ K
~
Q'
I"¥
> '4 a
f
~
I3J+VCOSYNC
. . ,.1 U24
k
+0'
..,
B U20
'co A
..
(3) +500 KHZ
WRIT. CLOCK
L'-!- '01
,co u,a
..• ......
~
......-:c. .
B 10 lCO CONTI. OUT •
• B
.f<
IIC4024
t!!.2C1 oct-!-
...
Xl E• •
@~
U"
~2C2 AI. a GO ' +DATA WINDOW (3)
~2C3
, lit:
. r~
2.15K C17
UF~ '"
'r"
INPUT SELECTOR
4 pu OF 10
. . . . . 1IOTECTOfI
R5
LOOP FILTI!R
--- ~
7
+
(PULLUPI
+ •
mM Fixed Disk
Adapter
6361503
ii
Contents
Description .................................... 1
Fixed Disk Controller ........................ 1
Programming Considerations ...................... 3
Status Register ............................. 3
Sense Bytes ................................ 4
Data Register .............................. 7
Control Byte ............................... 8
Command Summary ........................ 10
Programming Summary ...................... 14
Interface ..................................... 15
Specifications ................................. 17
Logic Diagrams ................................ 19
BIOS Listing .................................. 25
iii
it>
Description
The Fixed Disk Adapter attaches to one or two fixed disk drive
units through an internal, daisy-chained, flat cable (datal control
cable). Each system supports a maximum of one Fixed Disk
Adapter and two fixed disk drives.
The adapter is buffered on the I/O bus and uses the system
board's direct memory access (DMA) for record data transfers.
An interrupt level also is used to indicate operation completion
and status conditions that require microprocessor attention.
The device level control for the Fixed Disk Adapter is contained
on a ROM module on the adapter. A listing of this device level
control can be found in "BIOS Listing" of this section.
Edge
Connector
Data Bus
OB7-DBO
Control Sector
Buffer
a-Bit
Processor
Status Register
At the end of all commands from the system board, the disk
controller sends a completion status byte to the system board.
This byte informs the system unit's microprocessor if an error
occurred during the execution of the command. The following
shows the format of this byte.
~I
6 5 4 3 2
o d o o o e
Bits 7 6 5 4 3 2 1 0
Byte 0 Address Error Type Error Code
Valid I o I I
Byte 1 0 0 d
I Head Number
Byte 2 Cylinder High I Sector Number
Byte 3 Cylinder Low
Remarks
d = drive
0 0 0 1 1 1 Not used.
0 0 1 0 0 0 The drive is still seeking. This status is
reported by the Test Drive Ready command
for an overlap seek condition when the
drive has not completed the seek. No
time-out is measured by the controller for
the seek to complete.
0 1 0 1 1 1 Not used.
0 1 1 0 0 0 Correctable Data Error: The controller
detected a correctable ECC error in the
target field.
0 1 1 0 0 1 Bad Track: The controller detected a bad
track flag during the last operation. No
retries are attempted on this error.
Data Register
The system unit's microprocessor specifies the operation by
sending the 6-byte device control block (DCB) to the controller.
The figure below shows the coniposition of the DCB, and defines
the bytes that make up the DCB.
Bit 7 6 5 4 3 2 1 0
Byte 0 Command Opcode
Class
Byte 1 0 0 d Head Number
Byte 2 Cylinder High
I Sector Number
Byte 3 Cylinder Low
Byte 4 Interleave or Block Count
Byte 5 Control Field
Control Byte
Byte 5 is the control field of the DeB and allows the user to
select options for several types of disk drives. The format of this
byte is as follows:
I I
Bits
7
r
6
a
5
0
4
0
3
0
2
s s ~I
Remarks
r = retries
s = step option
a = retry option on data ECC
error
Bits 5, 4, 3 Set to O.
Bits 2. 1. 0
0 0 0 This drive is [lot specified and defaults to 3 milliseconqs per
steP
0 0 1 N/A
0 1 0 N/A
0 1 1 N/A
1 0 0 200 microseconds per step.
1 0 1 70 microseconds per step (specified by BIOS).
1 1 0 3 milliseconds per step.
1 1 1 3 milliseconds per step.
*Initialize Drive Characteristics: The DBC must be followed by eight additional bytes.
Maximum number of cylinders (2 bytes)
Maximum number of heads (1 byte)
Start reduced write current cylinder (2 bytes)
Start write precompensation cylinder (2 bytes)
Maximum ECC data burst length (1 byte)
DO-D7 Positive 8-bit data bus over which data and status
information is passed between the system board and
the controller.
Pin 20rru!ZlJ!-...'
::::::
"
';~
..........
:::~~
, Pin 1
Pin 2~2~ ,-
Position 5 has No Pin
(for Cable Orientation)
Pin 1
Signal Pin Number
Ground-Odd Numbers 1-33
Reserved 4.16.30.32
- Reduced Write Current 2
- Write Gate 6
- Seek Complete 8
Disk - Track 00 10 Disk
Drive - Write Fault 12 Adapter
Connector - Head"Select 2° 14 Connector
J1 - Head Select 2' 18 J1
-Index 20
- Ready 22
-Step 24
- Drive Select 1 26
- Drive Select 2 28
- Direction In 34
B ~~~ ...=~
4 lS244l=! -RESET
!~~ ~ ~4 ~~ "
5H 6 12 LS321
Al3 EN AB 4 l1F
• :~R 2 6J 11
Tlg '*
1 D1
1o-o,16t~ul
11Y~
A
I 7 :
: '6D2~
6 D6
05 •
AI2-=~.~D ~~.
I I 1511H 1 •
,• A
I"
lC S04
':' 5
, 6 D4
•
lS24 ~ 1~~;,I~I2~I~'~-'-I~'jf~~~ij~~t~~~~~5~~~~~
5
" ~g
D3
D2
A
A
CJCI
....
=
R5D
••
so~2iET:" ~'1'
I DI
m
:ll
A22
A8
A:'
A
AI
17
~
lOJ 38 8 Z
. ,
:: 5
: AI'CE
;
1 0"60004 -'
,:'9R~O 10F 5
"
3
"NTERRUPTEN::Bl:J~~O
OF"
rtrlS04
a
:~; ~~ il~5~'=1t~¥'!G~~~~~'S~DO~~:I~'~o~8:t'~'~K'>"""':-i',f--'=~D •
"05 23 fI.l
:~ A2
A4
11
13
12 3
ITYPI 7 4
~ 6 DO ~O,
11 ':" LS244
LS74 11
12
02 : +DMAENABlE ~3 LSI25
~fl9 ±::i ,
'f;f~,\~~:~
D
~ "~'V1~~II9t=~D~~~~~~~~==~~~'hJ.L ~
.30 AI lS244' I AD 6F ClCl 02" ,·5Dp4lS1.kk,'
A31 I~
lS244 10 19 ~3 5~S041~"D'AI" ::-: A51 4
----- 3 9JQ 6
OR03
12 9K:>"'-1-I\,}---="--i::> 81
~ ~4 Z5-SELECT Cl LS125
~
::R ION;6
1 J't
16 +5V
8H rLSI5~D~I~6~-~"~SE~TID::;:===1111~t11--------------il
1 -OATADUT .50
¥ 74lS688 ~4 rl rs~!IIP 2 - 3 11 -DRIVE TYPE I I~Ol
C>-';=D~=-'------'l-'-SD:-:'-::~;::-8K--8=::;::q--I~~~I~;~AS~'~~~] r~ '~,~. ~ l:~' ~:~'f'l~':S7:-:.N-====--
+ACKNOWlEDGE
A" ,
81' ~lSD' CLYi'
taK-.J;r:pi~'~O~;============:::t;'~~:6==~'~1:J~~6!j=i ~jS:S~~ss~~~~d~
OJ
81'
~
K3lSD41312 5 ~l§
h, '''' __
815 IDA 11
9 g8K LS04 8J lS08 15lS244~ ~501aR50LS74
~
~
,'~_~8~U:S.Y~DI_~o~Di=iA~=S3~~:;~~~~~~~~~~~~~~~~~~~~~~~~~==~~~~I~B~~~4~~'l~:!l==~~I2~D'~~'j
3 + -D + OH T/-FR MH E ii10"''+-I----------='- 4 ITYPI I 11 ~ ',I
Co
t:;j
, -ClBUSY 1 ~ el l3
I •rrn5Vj:~ ~
-EN IN 5 LS32
/il' ,2
-EN HOST •
~'''OUEST
OJ ' 22K 1
~
, , " 3 ~~D~IP~~~'
2 6
-r; ~614 ,2I
lS244 12
>
Co
-EN OUT 1 6J 3
:
12
1314 4
ITYPI
~
....
...
~
~
+;:62~HK 6 J Q I J 0
5V
16
~~K
~~' I
T
8131
~
[ .7
,••t. 1
11118 15144 5
• 1 2530
" 35
R2
.70 NAZ eLK
. 1 12
35 llC 1 +A KNDWLE E
~
>II'-
87
gc
.st. 2 4 IE 3
.51:;>-5 "7 Mst'
11. 21
22 0
Msce
LSI
~
LSI
~-t-- ,1 LSI 23
O.
OJ
3
01 15 lS04 2B 1 n +
••
ill
vee", 11 27
~r-- •
14 vee 35
~ 3.'
GNO=29
'-7 VCC=31.5
GND=20
29
30
01
D
3. GND -15 32
3
16
I .81: 33~1~1:738 40 Bl 00 D5 0302100
~
+A1
All 21
R~+ 11 0
~
~• I•"
~ 7f 3 ~-!::-
~
A5
~ "VA ~
LS3 AS A9
LSI 13 9F 0 !!...!!Z.
~LS257 7 ISUC.1 11 0 2148
02 !l....!!fi.. E"OJD2~
~
~
2732
t:::lsYG PROM 01 ~ ~21~1~
' t -~ I--
4 1H 0-
-;:1l t:! • 17
AD DI ~ ¥,=t oo~
~
• 6 AQ DO
5 ~ CSOE
AD , ~ csiE '·'-P~iiiE I TE N l T BUS 3.1
~12
I' 8ll-
S-
~' 3 LS3Z IOLS
11
9
11
1H
'Y"
rr T EHOUT
1,3
1
- a;P." 00
~LS74'3 12:l_.
11 8 11 10~l 9
lS04 ~3
.51
+SElDR2
SEL~~~3S=t::===iE
-ORASEL
-ORB
-INDEX
11
13
+SELDRT
~14lh~~ATOR
+tNDEX
~:~:.~IS~@~[:====::i±~~ :f- ~
LSI55 1 6
f')c;:¥'--""---------r-:miB"l -HDl
I~---~~ -HDO
-RESET
,,
+WRITEGATE
2B
-READY GiJj:j'·!D~---.......,*-'-~<m-:::T.1.l!-~[;d
03
, 4.6
~
~ WINDOW CLOCK
+NRZ DO DATA
2.6
Q.
t
.
'a 10 MHZ CRVSTAL
5.6
~
+MFMWRO
-MFMWRO
+MFMWRI
-MIIMWRI
.
-INCREASE PRECOMP
-TESTENA L
All +5V
"
Fixed Disk Adapter (Sheet 4 of 6)
WINODWClK
+ DEL DATA
J-'
+5VA
-1
J3-1 TPB
'38
33"
-CLAMP VCO
\'1"" AG5l0pF
9'"
-AM DETECT
'_6
+ RD GATE
-AM RESET
I·~·i
.;,." .Bom '5'
3 >-Wi AM [L:>
5)=:~ D:~~ DD
J4
~1,3.7"1
IK
.48
04.
:;~-~'.~C'~'A~S~'..P',,'C"B._P________________~~
>--RO GATE crr::> ':' TEST CONNECTOR .SO
: :> 10 MHZ CRYSTAL UI:> .51
r-------------.u-----------,
l 3300 TO 202 PACKAGE I
I I
: L.320MP5.0 I
I IQ·OII--t-----~::-:-----.,_--~~ -5VA
I CI G
I
I ~ I
4MHZClDCK
I I
I
I
IL___ ____________________________ J I
~
D +5V6LTS
83.829
rpg TP10
GROUItD
Bl,BID,B31
B9
o +12VOLTS
NOTES:
UNLESS OTHERWISE SPECIFIED:
1. All RESISTOIIS 1/4 W,5'\'1, CARBON FILTER.
2. ALL CAPS +10V DR BREATER+ID%.
3. NO MORE THAN 15 lOADS PER PULLUP NET.
The BIOS Listing for the IBM Fixed Disk Adapter follows.
'"
153 - CONTROLLER I/O PORT
154 > WHEI'i READ FIWM,
000& ."
.0_ HAX]IlE EQU
0002
...
'06
S_HAX_FIlE
ASS\Jt1E
EQU
CS:COOE
0000 207 o.G 0"
0000 55
0001 AA .0.
'08 DB
DB
055H
OUH
I GENERIC BIOS HEADER
."
212 1-----"" -.. -.. ---------------------------------------- ... ----------... -
213 1 FIXED DISK lID SETUP
21_
215 - ESTABLISH TRANSFER VECTORS FOR THE FIXED DISK
216 - PERFORM POWER ON DIAGNOSTICS
217 SHOULD AN ERROR OCCUR" "1701" MESSAGE IS DISPUYED
218
219 1_ -- ------- -- --------------- w _w _______ . ____________ w - - -----------
•• 0
.21 DISK_SETUP PROC FAR
...
0003
0003 EBIE
0005 35303030303539
••• JHP
DB
SHORT L3
'5000059 (C)COPYRIGHT IBM 19B2' I COPYRIGHT NOTICE
20284329434FSO
5952494748542.0
20494240203139
0023
3632
0023 tBCO
..-
••S
"6
l3:
ASSU1E
SUB
DS:Dl.It1MY
AX,AX I ZERO
002:5 8E08 ,.7 MO. DS,AX
...
8"
8"
j
(1
1 BYTE) - MAXIMUM tM1BER OF HEADS
WORD' - STARTING REDUCED WRITE CURRENT
(1 WORO I - STARTING WRITE PRECOMPENSATlON CYL
cn
91.
915 ;----- DRIVE TYPE 03
91.
0417 3201 917 OW 03060
0419 04 918 DB 040
1073 ENDP
1074
1075 ; --- .. -- - ... ------............... -- --- ...... --_ .. _______ "' __ .. ___ _
1076 REAl) SECTOR BUFFER UH = DEH)
1077 i -------- .. ----------------- .. ---------------------
1(178
04F9 1079
04F9 C606420DOE Hl80
04FE C60b46DOOl 1081 MOV CHD_BlOCK+4.1 , ONLY ONE BLOCK
0503 se47 11182 MOV AL.OHA_READ
050,5 E83E 1083 JMP SHORT DMA_OPH
1084 !lUi/_BUFF ENDP
108S
1086 ; .. -------------------------... -_ .. _________________ _
1187 WJfITE SECTOR BUFfER I AH = IFH)
lIJ88 ; ------------------------------------___________ _
1089
0,87 1690
OSI7 C"'428"" 1691
osee C6U46DOOl 1092 MOV CHll_BlDCK+4.1 I ONLY ONE BLOCK
0511 11948 109] MOV AL.DNA_WRITE
osn Eel8 1094 JH" SHaRT DNA_OPH
1096
1 0 97 ; --------- -- --- .. - --------________________ .... ___ .. _ ..
1098 TEST DISK READY (AH = 01 OH)
1 0 99 ; ----------------- --- _ - ---- --- --- - _____ .. ________ _
1110
0515 1101 TST_ROY PROC NEAR
0$15 C:,,6£t20ote 1102 MaV CHO_BlOCKt-O, TST_ROY_C~
05U EBlA 1103 JMP SHORT NOHA_OPN
1104 TST_RDY ENDP
1105
1106 ; --.. -----.. ----------.. ---... ---------- _____ .. _______ _
1107
Il08
RECALIBRATE (AH =
011H)
; ------------- __ "._ .. __ ... ___ ... _______________ .... _____ _
1109
OSlt 1110 HDISK_"ECAL PROC NEAR
D51C C606420001 1111 MOV tHO_BLOCK ,RECA~CHO
0521 EBU 1112 JMP SHORT NDMA_OPN
1113 HDISK_RECAL ENOP
1114
1115 ; -- .. -- .. ----------- .. ,.-- .. -------_________________ .. _____ .. __ _
1116 CONTROLLER RAM DIAGNOSTICS UH 012H) =
1117 ; - .... ---------------------- ______________ .. ______ .. ________ _
1118
0523 1119 PAce NEAR
0523 C60Mt200ED 1120 MOV
0528 EBOC 1l/!:1 JMP
1122 ,NOP
1123
1124 ; - .. ---------- .. ------------------.. ----- .... --- ____ .. _
1125 DRIVE DIAGNOSTICS (AH = 013H)
1126 ; -----------.. ..,.----- .... --- .. ----------- .... -----------
1127
052A 1128 CHK_DRV PROC NEAR
052A C6D6428eE3 1129
aS2:F EB85 1130 JMP
1131 CHK_DRV Et-I>P
1132
1133 J --... --- .......... ---- ....... ---- .. ------ .. - ......... ---.. ------------ .... -----
1134 CONTROLLER INTERNAL DIAGNOSTICS (AH = 014HI
1135 ) ---------.--- ... ------.--- .... ---- .. -- .. ------ ... ---.......... -- .. ----
1136
0531 1137 PROC NEAR
0$31 C6f16421&E4 1138 MOV CMD_BLOCK+O .CNTLR....DIAG_CHD
1139 ENDP
11ItG
1141 i -------....... ----- .. ------------------.. --.. - .. ----------------
1142 SUPPORT ROUTINES
1143 ; - .. ------.------------------------ .. --------------------- ..
ll44
1536 1145 N&lMA_OP'N:
0536 eOll2 1146 HOV AL,02H
1538 E82:700 1147 CALL COMMAND I IS$UE THE COtflAHD
0538 7221 1148 JC GIl
11-530 lun, 1149 JMP SHORT Gl
1227
1228 ; BYTE 2:
1229 BITS 7-5 CYlINDER HIGH
1230 BITS 4-0 SECTOR HUMBER
1231
1232 ; BYTE 3
1233 BITS 7-0 CYLINDER LOW
1234
1235 i ------- ------- - -------------- ------ -------------
1236
0590 1237 ERROR_CHK PROt NEAR
1238 ASSUME ES:OATA
059C A07400 1239 MOY AL,OISK_STATUS I CHECK IF THERE WAS AN ERROR
059F OACO 1240 OR Al,Al
05Al 7501 1241 JNZ G'I
05A3 C3 1242 RET
1243
1244 j----- PERFORM SENSE STATUS
1245
05A4 1246 G21:
05A4 884000 1247 MaY AX,DATA
05A 7 8EtO 1248 MaY ES,AX ESTABLISH SEGMENT
05A9 2BCO 1249 SUB AX,AX
05A6 SSFe 1250 MOY DI,AX
05AO C606420003 1251 MOY CMD_BLOCK+O ,SENSE_tHO
0562 2ACO 1252 SUB Al,Al
0564 E8ABFF 1253 CALL COMMAND i ISSUE SENSE STATUS COMMAND
0587 7223 1254 JC SENSE_ABORT ; CAHNOT RECOVER
0589 B90400 1255 MOY CX,4
osse 12:56 G22 :
05BC E8CBOO 1257 CALL HO_WAIT_REQ
05BF 7220 1258 JC G24
05Cl E8AOOI 1259 CALL PORT_O
05C4 EC 1260 IN Al.OX
05C5 26884542 1261 MaY ES :HO_ERRORt OI] .Al ; STORE AWAY SENSE BYTES
05C9 47 1262 INC or
05CA E8BI01 1263 CAll PORT_l
05CO E2ED 1264 LOOP G22
05CF E88800 1265 CALL HO_WAIT_REQ
0502 7200 1266 JC G24
0504 E09AOl 1267 CALL PORT_O
0507 EC 1268 IN AL.oX
0508 A802 1269 TEST AL.2
050A 740F 1270 JZ STAT_ERR
050e 1271 SENSE_ABORT:
05DC C6067400FF 1272 MOY DISK_STATUS .SENSE_FAIl
05El 1273 G24:
05El F9 1274 STC
05E2 C3 1275 RET
1276 ERROR_CHK ENDP
1277
05E3 1A06 1278 T_O OW TYPE_a
05E5 2706 1279 T_I OW TYPE_I
05E7 6A06 1280 T_' ow TYPE_2
05E9 7706 1281 T_' ow TYPE_3
1282
05EB 1283 STAT_ERR:
05EB 268AIE4200 1284 MOV Bl,ES:HD_ERROR ; GET ERROR BYTE
05FO 8AC3 1285 MaV AliBl
05F2 240F 1286 ANO Al.OFH
05F4 80E330 1287 AND Bl. 00 1100008 ; ISOLATE TYPE
05F7 2AFF 1288 SUB BH.BH
05F9 BI03 1289 MOV Cl.3
05FB 03EB 1290 SHR BX,Cl ; ADJUST
05FD 2EFFA7E305 1291 JMP WORD PTR CS:[BX .. OFFSET T_O I
1292 ASSUME ES:NOTHING
1293
0602 1294 TYPE a_TABLE LABEl BYTE
0602 00204020800020 1295 OB O. BAD_CHTLR .BAO_SEEK • BAO_CHTLR • TIHE_OUT, 0, BAD_CN'lLR
0609 0040 1296 OB o ,BAD_SEEK
0009 1297 TYPEO_LEN EOU $- TYPEO_ TABLE
JI
I BLOCK COUNT OUT OF RANGE
060A 50
0608 Mft200
06DE 3Ce5
1444
1445
1446
1447
1448
PUSH
,",V
C"P
.
1----- HAtilLE READ AND WRITE LONG 15160 BYTE BLOCKS)
AL,ct1D_aLOCK+O
ALoRD_LONG_CHO
I SAVE REGISTER
I GET COMMAND
SHORT J20
1 RESTORE REGISTER
Description .................................... 1
Fixed Disk Function ............................. 1
Task File .................................. 2
Task File Registers .......................... 2
Miscellaneous Information ................... 11
Diskette Function .............................. 11
Diskette Controller ......................... 14
Diskette Controller Commands ............... 16
Controller Commands ...................... 20
Command Status Registers ................... 32
Interfaces .................................... 36
Interface Lines ............................ 37
Logic Diagrams ................................ 41
iii
Notes:
iv
Description
I/O Address
Primary Secondary Read Write
1 FO 170 Data Register Data Register
1 F1 171 Error Register Write Precomp
1 F2 172 Sector Count Sector Count
1 F3 173 Sector Number Sector Number
1 F4 174 Cylinder Low Cylinder Low
1F5 175 Cylinder High Cylinder High
1 F6 176 Drive/Head Drive/Head
1 F7 177 Status Register Command Register
Task File
The data register provides access to the sector buffer for read and
write operations in the PIG mode. This register must not be
accessed unless a Read or Write command is being executed. The
register provides a 16-bit path into the sector buffer for normal
Read and Write commands. When a R/W Long is issued, the 4
ECC bytes are transferred by byte with at least 2 microseconds
between transfers. Data Request (DRQ) must be active before
I I
Error Register
01 No errors
02 Controller error
Operational Mode
Bit 7 Bad Block Detect-This bit indicates that the bad block
mark was detected in the target's ID field. No Read or
Write commands will be executed in any data fields
marked bad.
The target's logical sector number for Read, Write, and Verify
commands is loaded into this register. The starting sector number
is loaded into this register for multi-sector operations.
The target number for Read, Write, Seek, and Verify commands
is loaded into these registers as shown in the following figure. The
cylinder-number registers address up to 1024 cylinders.
Drive/Head Register
Bit 7 Set to 1
Bit 6 Set to 0
Bit 5 Set to 1
Status Register
The controller sets up the status register with the command status
after execution. The program must look at this register to
determine the result of any operation. If the busy bit is set, no
other bits are valid. A read of the status register clears interrupt
aborted.
Command Register
Command Bits
7 6 5 4 3 2 1 0
Restore 0 0 0 1 R3 R2 Rl RO
Seek 0 1 1 1 R3 R2 Rl RO
Read Sector 0 0 1 0 0 0 L T
Write Sector 0 0 1 1 0 0 L T
Format Track 0 1 0 1 0 0 0 0
Read Verify 0 1 0 0 0 0 0 T
Diagnose 1 0 0 1 0 0 0 0
Set Parameters 1 0 0 1 0 0 0 1
Valid Command-Register Commands
R3 R2 R1 RD Stepping Rate
a a a a 35 us
a a a 1 0.5 ms
a a 1 a 1.0 ms
a a 1 1 1.5 ms
a 1 a a 2.0ms
a 1 a 1 2.5 ms
a 1 1 a 3.0ms
a 1 1 1 3.5 ms
1 a a a 4.0ms
1 a a 1 4.5 ms
1 a 1 a 5.0 ms
1 a 1 1 5.5 ms
1 1 a a 6.0 ms
1 1 a 1 6.5 ms
1 1 1 a 7.0 ms
1 1 1 1 7.5 ms
Stepping Rate
The following figure shows the bit definitions for bits Land T.
Bit Definition D 1
L Data Mode Data Only Data Plus 4 Byte ECC
T Retry Mode Retries Enabled Retries Disabled
Land T Bit Definitions
Restore: The controller issues step pulses to the drive until the
Track 000 indicator from the drive is active. If Track 000 is not
active within 1023 steps the error bit in the status register is set
and a Track 000 error is posted in the error register. The implied
seek step rate can be set up using the stepping rate figure on the
Seek: The Seek command moves the R/W heads to the cylinder
specified in the task files. The adapter supports overlapped
seeking on two drives or setup of the buffered seek stepping rate
for the implied seek during a Read/Write command. An interrupt
is generated at the completion of the command.
1. Restore
3. Restore
• ID fields are checked for errors when read from the disk.
• The adapter supports only Eee on data fields and only eRe
on ID fields. The eRe polynomial is X16 + X12 + X5 + 1;
the Eee polynomial is X32 + X28 + X26 + X19 + X17 +
X10 + X6 + X2 + 1. All shift registers are preset to hex F
before calculating the checksums, which begin with the
respective address marks.
Diskette Function
I/O Address
Primary Secondary Read Write
3F2 372 - Digital Output Register
3F4 374 Main Status Register Main Status Register
3F5 375 Diskette Data Register Diskette Data Register
3F6 376 - Fixed Disk Register
3F7 377 Digital Input Register Diskette Control Register
Diskette Function
Bit 7 Reserved
Bit 6 Reserved
Data Rates
The diskette function will support three data rates: 250,000,
300,000 and 500,000 bits per second.
The bits in the status register (hex 34F) are defined as follows:
Bit 3 Reserved
Bit 2 Reserved
Bits 7 - 2 Reserved
Bits 7 - 4 Reserved
Bit 0 Reserved
• Read Data
• Write Data
• Read a Track
• Read ID
• Format a Track
• Scan Equal
• Specify
• Seek
• Invalid.
Symbol Descriptions
signal.
Read Data
07 06 05 04 03 02 01 DO
MT MF SK 0 0 1 1 0
X X X X X HO US1 usa
c
H
R
N
EOT
GPL
OTL
STO
STl
ST2
C
H
R
N
07 06 05 04 03 02 01 DO
MT MF SK 0 1 1 0 0
X X X X X HO US1 usa
c
H
R
N
EOT
GPL
OTL
STO
STl
C
H
R
N
07 06 05 04 03 02 01 DO
MT MF a a a 1 a 1
x X x x X HO US1 usa
c
H
R
N
EaT
GPL
OTL
STO
STl
ST2
C
H
R
N
07 06 05 04 03 02 01 00
MT MF 0 0 1 0 0 1
X X X X X HO US1 USO
C
H
R
N
EOT
GPL
OTL
STO
STl
ST2
C
H
R
N
07 06 05 04 03 02 01 DO
a MF SK a a a 1 a
x x x x X HO US1 usa
c
H
R
N
EaT
GPL
OTL
STO
STl
ST2
C
H
R
N
07 06 05 04 03 02 01 DO
a MF a a 1 a 1 a
x x x x X HO US1 usa
Result Phase: The following bytes are issued by the processor in
the command phase:
STO
STl
ST2
C
H
R
N
Format a Track
07 06 05 04 03 02 01 DO
a MF a a 1 1 a a
x x x x X HO US1 usa
N
SC
GPL
0
STO
STl
ST2
C
H
R
N
Scan Equal
07 06 05 04 03 02 01 DO
MT MF SK 1 0 0 0 1
X X X X X HO US1 usa
c
H
R
N
EOT
GPL
STP
STO
STl
ST2
C
H
R
N
07 06 05 04 03 02 01 DO
MT MF SK 1 1 0 0 1
X X X X X HO US1 usa
c
H
R
N
EOT
GPL
STP
STO
STl
ST2
C
H
R
N
07 06 05 04 03 02 01 00
MT MF SK 1 1 1 a 1
x X x x X HO US1 usa
c
H
R
N
EDT
GPL
STP
STO
STl
ST2
C
H
R
N
Recalibrate
07 06 05 04 03 02 01 00
a a a a 0111
X X X X X a US1 usa
07 06 05 04 03 02 01 00
o 000 100 0
STO
peN
Specify
07 06 05 04 03 02 01 00
o 0 0 0 0 0 1 1
( SRT ) ( HUT
( HLT ) ( NO
07 06 05 04 03 02 01 DO
a a a a a a 1 a
x x x x X HO US1 usa
Result Phase: The following bytes are issued by the controller in
the result phase:
sn
Seek
07 06 05 04 03 02 01 DO
a a a a 1 1 1 1
x x x X X HO US1 usa
NCN
07 06 05 04 03 02 01 00
Invalid Codes
X X X X X HO US1 USO
STO
(Recalibrate Command).
diskette drive.
I/O Address
Primary Secondary Read Write
3F2 372 Digital Output Register
3F4 374 Main Status Register Main Status Register
3F5 375 Diskette Data Register Diskette Data Register
3F6 376 Fixed Disk Register
3F7 377 DiQital Input ReQister Diskette Control ReQister
Diskette Function
I/O Address
Primary Secondary Read Write
1FO 170 Data Register Data Register
1 F1 171 Error Register Write Precomp
1F2 172 Sector Count Sector Count
1F3 173 Sector Number Sector Number
1F4 174 Cylinder Low Cylinder Low
1F5 175 Cylinder High Cylinder High
1F6 176 Drive/Head Register Drive / Head Register
1F7 177 Status Register Command Register
Fixed Disk Function
··..
··..
··.
·.
34
- r---
- Ready 22_
-
- - Step
- Drive Select 1
24
26
-= - Drive Select 2 28
- Reserved 30
Reserved 32
_ - Direction In 34
-
- '---
..
- -
+ MFM Write Data 13
- '----
···....
c:::::Jc:::::::::::J c=J C=:l
···...
c::.::J c:::::J;~c:::::::::::Jc::JCJ
C J== =
c:=::::J c:=::::J ==
c::::::J ~ c::::::J c::==:J c::=::J [=::J c::::J c::J
··..
c.::::::J c=J
CJ~c_~=Jc=J~c:::J
c:::::::::::J c::l [===:J c::::::::J C=::J c:::::J c::J c:::::J c::::J
c:::::J c:::::Jc::Jc:=::J D~ ·
33 34
.
- r---
--
Reduced Write 2
Reserved 4
Drive Select 3 6
- Index 8_
...
- Write Gate
Track 00
24
26 _
..
Write Protect 28_
..
Read Data 30
..
-- Side 1 Select
Diskette Change
32
34 _
- L..-
PUP11\SHT4.5,l}
"
2N'NO&
."
,.
'"
17.8Kn
L - t - - - t - - - ' = + - - - - - . - - - - V A R welK (SHT11
~PINS '.1.'>.1.9.1I.ll.I'5.17,IQ,ZI.2l,2';.27,2CJ.1IIt4D11AREGROUNDONJI&J'>
&
.& ,J1 & Jlt GND PlNS:Z.'I.&.II,IZ,I'>.I&,IQANOZO
utS SDHOf'''''--------+------~'f-l:-»'-+'-,-___1-------,----,-----,----"'O'::++f--f--f--____i
(SHT2IB(R-
22 :~t~-~If-''''---------+------,"'::H:»-i'-'',,----1-------1------~+++--+-------i
(SHT7)WRC:P
(SHT5) AD
~~ ~2~~"--------+------~lrt~~I~-+-------~------~-+-+-+--~
(SHT5IAI 1"5 AI I
SIlIflf-'''''----------'
(SNT51A2
(SHTI) HRST-
(SHTil WR-
; M,~E'-_ ~,,~,,~------~-~-'~.~~"--~,lr~~'~I~,---------l---,-----,--~------+-+__-____i
1
cu 1'J 112
(SHT51 RO-
(IH12) B(S-
18 ~_l::H~~~"'~,,~.='='.~,--------~~LH:_~~~---------,----------+--____i
(IHT3IRAb
(SHYij(SO-
=:-=-
17
9JZ8 DRQH~""'- - - - - - , -
~ 21 :~t~~:;3:SHT21
L0,GND
(SHT2) (St-
LUB-
~
19
CIN(- (SHT3)
:~~
1N0E~
r--+~--'M~f"__-----'''_II TlOlOO
(IHTI)
""
"'" g.; ~; lO WAUP(SHY U) r--+~-~~~~-~-.-,,-.--~"-I~::,O
'""'" Db
'"
CMR- Y (MR- (SHY 3)
""r''''~---~'{><':''----' WF (SHY 6) ""
SBEF(SHTZ)
r--+++11~~~~---~~"j~'"
RDY(SHT&) ,)!!&."
,lEPl-'''L-----''-j'1>""'----1
(SHY 3) HoIHID1-+'--'--------------.--------------=--=-++++t---:c---"
r:Z'J r-·no-, 19 00 'ml"~'---~'1'"[>",.,,,,,-""'-'---Illt DIRECTION IN-
I "" I 18 01 INTRQ'Jb INTliO(SHT2)
YOO ALE II
"'00,
I
I
IL... _ _
""
'"
~10
I
I "'"
17",
"",
"", ='n ::
EARLYZ'J
(SHT 1.1)
EAIILY(SHT1)
JI
~ RESEf-
(SHTI) HRST- 00 12
""
"'"
220
_____
"'"
"'"
"",
"", LATE ~ LATE(SNT1)
(SNTI)P\P)I!I "INT 011'J
'" 1;01
HI" "",
8(5-ZI B(S-(5HT2)
(IHY2)WAl,JP
~~ U1I : :~ ""
"'" ,,'"
,'" ,,' ," ~~ 'J8 :~(IHT1)
7 EA D~ I" 11.112 10 AI B(R- 2 BeR-ISHT2)
(SNTZ) INr::~
~ :~~ ~~:: "'''
"'"
'"
"",
" '
11.1 1"5
"<; ~
~:~ P~ ~I
'"
18 07
,,'
(Sa-(IHTZ) A2(SHT5) (SHT&IIII$T- MIi-
=:~:: :=
! ;:~
8 CS-
(SHYZ) SIlEF
'"
'JO
'JI PI~ P21 12 '"
W, '" NJ(SHTS)
.-----------------------~."~'~"~~-"'----~~~::~
Y PI"5 PU 21
"" n PIt. pn 2'1 ""
'J~ PI1 P2~ ~ (SHY 8) RCLK RCLK
P2"5 !~ (SNT8) RllIITA 'J7 RDATA
."
CORRO(IHTB) (SHT1)WReP Zo;WCLK
Wo/oto; ~~ 'J8
ERROIt(SHTI)
WAUPL
(SHT1)IOI'IlZ (SNT5)
-M1?"
20 21t
RAO I):OE DE 1/07 17 SOBle; (SHT 5)
RAI 6 AI 1/06 16
SDB" (SHT 5)
RA2 7 A2 U~~ I/o~ I~
(SHTS)
lr
RD- ~
IblSA
UI9
~RDA-(SHTJ)
~RDB-(SHT3)
RA1
RA4
8 M 20161 IAl't III
I A4 1101 IJ
SDBI1 (SHT 5)
SDBI2 (SHTS)
SOB II (SHTS)
RA~ A~ 9
~
PAL2 2 1/02 SOBIO (SHTS)
(SHTS) WR- F-- WRA - (SHT 3) RAb 1 Ab 1101 10
f!'1--- WRB - SDBQ (SHTS)
=:!
(SHT 5) WDXFER-
~
(SHT 3)
(~~~C2~ -----:S
LS19l
CI >!-
RA7 4 >7 1/00 II SOBa (SHT 5)
pq
(SHT2) RCS- XCV REN-(SHT 3) OA RAB
RAO 19 A8
:~
11 9 a 7 b ~ 4 1 2
C2 QA RA9
RAI 22 A9 IT
OB A A
U>2 RA2 RAID 21 AIO 12
Oc 9 (SHT 5) WR- - - ' DIR U~~
RA1 LSZ4'1)
0D a
RI R2 + ~V -----'24 (SHT 3) X CVREN-~ EN
[
12
LS191
1'2
,
RAO
RAI
RA2
RA1
r;
AD
2016-1
b AI U~1
7 A2
a A1 1/07
n 17
B B
II 12 B 14 II) 16 17 18
HD7
RA4 RA4 Ib HDb
CI OA I" IICb
4 R. .
OB RA~ 2 A~ I~ HO~
Ub2 ~ RAb I/O~
HD~
Oc
Go
b
11
RA7
RAa
RAb
(SHT 2)
RAb
RA7
, Ab
4 A7
I/O"
1101
11 " HD1
.!2, C2 OA
10 RA9
RAa 19 A8 1/02
9 HD2
OB RA9 22 M 10 HDI
9 RAID I/OI
RAID HDO
RI
Oc
R2
21 AIO
WEOECS
1/00
"
T2 1'2 ~ HDO-HD1
=~:~rr
(SHT2) CHR- (SHTJ) WRA- (SHT 2)(SHT 5)
(SH T3 ) RDA -
1""
ISHT 5) 508;
SDBIf II OBit SEEK (5HT 4)
I I ~====~~------------~--~--------------------t-~~~-----j18 DIR-
L soss IZ DBr; OIR 18
150n 150n
_
,on I
..J U22
lSI4
5086
SOB7 11 ~:;
wO!\
PSQ
PSI
10
12
11 "'-'------'22 WRf DATA-
1 WR
INDEX.-
• • 2
, I •
ISHT 5) rOWB-
(5H1 5) IDRB- 2 RD
If cs
&. GNO
U22
LSIIf (SHT 5)·SAOS ' ClK
AO
1 , 2 (SHT 7) FREP IQ
WRf PROl- 2. 21 WCLK
(SHT 7) FWCLK
U22 n lOX
TRK 0- 2'
, , lS11f
lit WP/TS
'---"q>''-_____--'''-'-1'3 FLT/TKO
U59 20
LSIIf
f----4---------9'-<1,,~·--DC HG ISHT 6)
U22
LSIIt
WDA (SHT 7)
FWE (SHT 7)
L.'::::======= PS
PSOI (SHT
(5HT 7)7)
=w
!.:-'
("':I
0
....
IC
ALE - (SHT 5)
pup 68 (SHT I)
£1 h"
Ell
P;
PRI/SEC
STRAP
(SHT 5) JOWB-
(SHT 5) IOR8-
FAST I/O 16-
a
'=
00
.&;. U"
LSI ..
(SHT3)
(SHT 3)
(SHT 3)
SD81'5
SD6I~
el8
C"
SDI')
5014
5DI~
.,= S===~'~~'=~I2~~~~====~
WC (SHT 3) A4 6 CIS 5DI2
..... A£N ~~~
LDDOR- (SHI6) (SHT 3) SDBII ,,' "4
~: s~o
SOli
~ All .. U60 LOFCR - (SHT 6.7) (SHT 1) SDBID ,,4 SOlO
HDCS- (SHT 5)
'"
A2b~===:=;i;~3~
LDFDR- (SHT 6) (SHT 1)
>
2 IG Wc (SHT 3) 5DO.
rr;=====~
5008
SA')
SA'JA28 1J12
14 2G ,/C (SHT 5) I0R8-
""'l "
~====="t1~~~
SALt A27 ENDIR- (SHT 6)
SA9 A22 £NHDSTAT - (SHT 6) 'WD;(FER- (<;-(7)
~ SA7 A24
IoIAUPL (SHT 2,6)
Irr=;========~Jj
~' FDCS- (SHT 4)
(SHT 2) WAUP
~ (SHT2jSBRG
Q.
~ II LS24'; 9
:~ :~&;~S:~ ~
5OB7
(SHT 1) H07
!il' E (SHT 1) H06 12 8~U4S ~ 8 5086
5007
5006
5A2 A29
~ I~ 8"3
A2 (SHT 2)
(SHT 1) HDS A"3 7 16 Bb A6 4 A04 SODS
SAl A3D AI (SHI2)
A4 6
(SHT 1) 1-(14 14 B4 r=; BS AS S AOS 5004
~ SAoa (SHT 4)
(SHT 1) HO"3 I'> 8') A') ') 50" 14 84 A4 6
=
500"3
Q.
SAO
'"
IOW- 81'3 lS'367
AO (SHT 2)
(SHT I) HD2
(SHT 1) HOI
:~ f*,
87
A6
A7
~
SOB2 1"3 8"3
12 B2 A2 8
A~ 7
A08
SOO2
5001
IOR- 914 18 88 AB 2 II 81
(SHT 1) HOC
~ AI ' Aoq 5000
fWCS- (50- (SHT 2)
(SHT3)IORS- I D1Rm IDIR_
(7-05)
" 'N
~
WR- (SHT 2.3)
~
E RD- (SHT 2,3)
" "
.....
.....
(SHT 6.4) 5000 -SOB7
~ (SHT 6) FDMAEN
~
(SHT 2) HINT
>
Q.
(SHT 6) HOHAEN
~
'=
.....
.,
~
:t==
~ HOEN I (SHU)
:~~N
{SHT 2} HSI -
ISHT 2} HS2 - ~
LSlB ~
I~
NIC~
2 ISHU}
(SHT 2) HS1 -/RWC
(SHl2) WG-
----1
~
•
12
(SHT') LDOOR
R
11
(SHU) OCHG -----.!
G EN
• SOB. ISHT.}
SDB7 (SHT 5)
III 11
(SHT 5) END IR-
~O Q~N/C
U" Q~N/C
'---- f----2 o LS175 OfL---NIC
Q~ HDMAEN (SHTS)
12 0 Q~NIC
~'
o II
(SHT 5) LDFDR-
: 0 ,,-It-- H53 ISHTS)
01-'--- H53-ISHT'}
I U,)8
LSOB
HRST - (SHT 2)
(SHT') MR-
P
.
-
~~ :;;' -;::"
~ ~~ m
0
I i
"~ "'...."
Q)
I Q)
~
,.1 "1"1~~ i
I I
ff ~~
·1 ~
.
....Q)Q.
III
"C
~i~~i~m
;<; ... ;<;:;;,,,,:;;,:;;,:;;,:;;,
«Q)
~~~~~~~1~ >
";:
c
~3
....
Q)
....Q)
NN N
~1 ~ ~
III
C
"C
s:::
III
~
III
C
"C
Q)
><
iL:
~
~ l~
"
~
I~~ ''''
ZZl.lF.I'5Y(ELECTROLYTIO
1/2W
.~
(SHY I) PUPil
"
(SNTI)
TI T2
{SlIT 7)
'"
"'" ~~1 RClK {SIfT 2)
'"
I~;V"~ELECTROLYTlc)
"
210n
11'+ RDATA{SIIT2)
"
ROb
--------l
-- +<;VS(SHT9) I
"
L<
4.7MH
FlD/REF -+---+-''4
--FDCLK (SHT4)
I~ U48 veo (SHT 1)
Description ..................................... 1
Fixed Disk Controller .......................... 1
Programming Considerations ....................... 3
Types of Drives ............................... 3
Status Register ............................... 4
Sense Bytes .................................. 4
Data Register ................................ 7
Programming Summary ........................ 14
Interface ...................................... 15
Connectors ............... ;.................... 17
Logic Diagrams ................................. 19
BIOS Listing ................................... 23
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. Index-l
The 20MB Fixed Disk Drive Adapter attaches to one or two fixed
disk drive units through an internal, daisy-chained, flat cable
(datal control cable).
The adapter is buffered on the 110 bus and uses the system
board's direct memory access (DMA) for fixed-disk-drive data
transfers. When the adapter is enabled, an interrupt request
occurs on the IRQ-5 line to the 8259A Interrupt Controller. The
8259A then causes an interrupt hex OD.
The device level control for the Fixed Disk Adapter is contained
on a ROM module on the adapter. A listing of this device level
control can be found in "BIOS Listing" of this section.
Warning: The last cylinder on the fixed disk drive is reserved for
diagnostic use. The diagnostic write test will destroy any data on
this cylinder.
J2
liD
)
SERDES
ECC Interface
Edge liD
Interface J3
Connector
Data Bus
8-Bit
DB7-DBO
-- Sector Buffer
Processor
Types of Drives
The fixed disk drive adapter will accommodate any two of four
different types of drives. The figure below shows the
configuration of the different type drives.
Start of Landing
Type Cylinders Heads Write Pre-Camp Zone
1 306 4 a 306
2 615 4 300 615
13 306 8 128 336
16 612 4 a 663
The figure below shows the switch settings for the above
mentioned drive types. Switches 1 and 2 set the parameters of
Drive 0, and switches 3 and 4 set Drive 1.
Drive a Drive 1
Switch Switch
1 2 3 4
Type 1 On On On On
Type 2 Off On Off On
Type 13 Off Off on Off
Type 16 On Off On Off
I Bit I : I : I : I : I : I : I : I : I
Sense Bytes
If the status register receives an error (bit 1 set), the disk
controller requests four bytes of sense data. The format for the
four bytes is as follows:
Bits 7 6 5 4 3 2 1 0
Byte 0 Address I I
0 Error Type Error Code
Byte 1
Va 1 i d
0 0 d
I
Head Number
Byte 2 Cy 1 i nder High Sector Number
Byte 3 Cylinder Low
Remarks: d = drive
0 1 0 1 1 I Not Used.
Data Register
The system unit's microprocessor specifies the operation by
sending the 6-byte device control block (DCB) to the controller.
The figure below shows the format of the DCB, and defines the
bytes that make up the DeB.
Bits 7 6 5 4 3 2 1 0
Control Byte
Byte 5 is the control field of the DeB and allows the user to
select options for several types of disk drives. The format of this
byte is as follows:
I s;t I : I : I : I : I : I : I : I: I
Bits 2, 1, 0
0 0 0 This drive is not specified and defaults
to 3 mill i seconds per step.
0 0 1 N/A
0 1 0 N/A
0 1 1 N/A
1 0 0 200 microseconds per step.
1 0 1 70 microseconds per step (specified by BIOS).
1 1 0 3 mi 11 iseconds per step.
1 1 1 3 mi 11 iseconds per step.
In i t i a Ii ze Bit 7 6 5 4 3 2 1 0 Bytes 1, 2, 3, 4, 5, =
Drive
Character- Byte 0 0 000 1 1 0 0 don't care.
istics*
(Class 0,
Opcode OC)
Read ECC Bit 76543 2 1 0 Bytes 1, 2, 3, 4, 5, =
Burst Length
(Class 0, Byte 0 o 0 0 0 1 1 0 1 don't care.
Opcode 00)
Read Data Bit 7 6 5 4 3 2 1 0 Bytes 1, 2, 3, 4, 5, =
from Sector
Buffer Byte 0 o0 0 0 1 1 1 0 don't care.
(Class 0,
Opcode OE)
Write Data to Bit 7 6 5 4 3 2 1 0 Bytes 1, 2, 3, 4, 5, =
Sector Buffer
(Class 0, Byte 0 o 000 1 1 1 1 don't care.
Opcode OF)
Dr i ve Bit 7 6 5 4 3 2 1 0 d = drive (0 or 1)
Diagnostic
(Class 7. Byte 0 1 1 1 0 0 0 1 1 r = retries
Opcode 03)
Byte 1 0 0 d x x x x x s = step option
Byte 2 x x x x x x x x x = don't care
Byte 3 x x x x x x x x
Byte 4 x x x x x x x x
Byte 5 r 0 0 o0 s s s
Write Long **
(Class 7. Bit 7 6 543 2 1 0 d = drive (0 or 1)
Opcode 06)
Byte 0 1 1 1 o0 1 1 0 s = step option
Byte 1 0 0 d Head No. s = step option
Byte 2 ch Isector No. ch = cy 1 i nder high
Byte 3 Cyl inder Low s = step option
Byte 4 Block Count
Byte 5 rOO 0 0 s s s
DO-D7 Positive 8-bit data bus over which data and status
information is passed between the system board and
the controller.
Land
At Standard TTL Levels Number
Ground-Odd Numbers 1-33
-Reserved 2, 16, 30, 32
-Head Select 2 4
-Write Gate 6
-Seek Complete 8
-Track 000 10
-Wr i te Fau It 12
-Head Select 0 14
Disk -Head Select 1 18 Disk
Drive Adapter
J1 -Index 20 J1
-Ready 22
-Step 24
-D rive Select 1 26
-Drive Select 2 28
-Drive Select 3 30
-Drive Select 4 32
-D i rect ion In 34
Reserved 3,5,7,9
Key 5
+MFM Wr i te Data 13
-MFM Wr i te Data 14
Fixe d +MFM Read Data 17 Fixed
Disk Disk
Driv e -MFM Read Data 18 Adapt er
J2 0 r J3 J2 or J3
Ground Pins 2,4,6,8,10,11,12,15,
16,19,20
All Other Pins Unused
,-
2
,"'-
IOHHZ
.".
MQ 29
IRQ ~~
DRQ~
IR., ."
'"
ISH. 2. 3)
(SH.2.S) II ~i:
."iI''" 1& PJOR
".
., ....,......
18 PlOW
82 'J6 PRST LS'
(SOCKET>
vee"'6
GND:Z6
A"
AI1
AIS
A"
A"
A ..
AI>
AlB ~.~"--------------------~
AI' rnrr~"------------------~-,
m-
AO
AI
....
.28 "
AV
A26
A2';
A'"
.."
AA
A7
A.
'"All
(SH.2,3) 00
ISH.2.S) 01---
ISH. 2, 3) 1lZ--
~==~~==c===========~
(SH.2.S)
ISH.S)
ISH.S)
(SH.S)
.,--
06--
ISH.S) 07
TA au
(SH.3) AO=====~=============:iI.
(SH.3)
(SH.3)
AI
A2 },
DO (SH.l.S)
(SH.S) ----------------------------i~-------~r_~~~-------C~,,-~.) ~
(SH.4) ~---------------------------__j+-------___1f__t_.."..~
(SH.3) EARlY---------'L>'----'1~""==_'G'"=:_"--t---'
EN HOST ISH. 1)
ISH, 1) BUSY
'"" I I
'" "
WR 22 LSO'f
III " '"
~WR
~(SH,41
~~ AEN
20 BlJSACK
lDRQ 20 17 IOREQ MFH'JTDTA ~b I1FH IoIT DATA (SH.Z)
MIirQ 1'1 16 MREGI WTGTE 37 WRITE GATE (SH.ll
---"
row vcoCLAMP 28 KO CLAMP (SH.4)
TO>
DA~
2
'
I'>
'='
B LDI
NEG PlJI1P ~2
.".....,..
NEG PUMP
(SH.4)
(SH.4)
I5l1J ,., HIrn'IT 2~ iiIinIT
~ ENRO mmmTA 22
(SH.4)
(SH.4)
NRZ RD DATA
39~
OAI 24
DA2
rn>"
14
XENO """'"
LATE 3'+
EARLY
""""
LATE
EARLY
(SH.4)
(SH.2l
(SH_l)
"
~~'~'_£j2 '!MHZ
ISH. 1,2)
ISH.l,2)
ISH. 1,2)
ISH.l,l)
(SH.l)
ISH 1)
ISH.l)
ISH 1)
-- " (SH.Z)
"""
(SH.2l
(SH.2l
- ISH. 1)
I<lAIO
" (SH.2l
tv
...... 20MB Fixed Disk Drive Adapter (Sheet 3 of 4)
tv
tv
+'5VA
"
.OI,..F
~~~~~~~~~-+~~~----~---i,
t:---~~)J!-:"'"'-.---------'lCC CLOCk (SH.3)
LI
'""
4.7,.."1
i=if"GA1N-------'/e
(SH.3)
"
~C;IOPF
'"
(SH.J) veo (LAMP _ _ _ _ _ _ _ _ ~~~/''---"'''L''.y
BD
LS04 S PI RIO
(SH.3) ~ _ _ _ _ _ _ _ _~I{ > . < 2 - - - - - - _ C I : ) 89D~·~I2~V_~~--~---~~~---~---_
"==r-
~~-~---~----LT~---~----
BEAD
IKTVP
~.'
(SH.3) DISABLE AM _ _ _ _ _ _ _ _ _ ~l'L'-
__R"'I~4_ _ _ _ ____{OD R22 .;v
The BIOS Listing for the IBM 20MB Fixed Disk Drive Adapter
follows.
I PAGE 118,121
2 TITLE DISK2 ---- 10/28/85 FIXED DISK BIOS
3
4 ;-- INT 13H -----------------------------
5
6 FIXED DISK I/O INTERFACE
7
8 TH I S I NTERF ACE PROV I DES ACCESS TO F I XED 0 I SKS
9 THROUGH THE IBM F I XED 0 I SK CONTROllER.
10
II ; -- ------- ------------- - - ------------- ------------- ------ - -----
12
13 ; -- ------- - - ------------ - - -------- - ---- -- -- -------- ------- - - -- ---
14 ; THE 81DS ROUT I NES ARE MEANT TO 8E ACCESSED THROUGH
15 ; SOFTWARE INTERRUPTS ONLY. ANY ADDRESSES PRESENT IN
16 THE LISTINGS ARE INCLUDED ONLY FOR COMPLETENESS,
17 NOT FOR REFERENCE. APPL I CAT IONS WH I CH REFERENCE
18 ABSOLUTE ADDRESSES WITH I N THE CODE SEGMENT
19 ; V lOLA TE THE STRUCTURE AND DES I GN OF B [OS.
20 ; -- --
-------- ---- -- - - ---------- ---- - - --------- -------
21
22 INPUT (AH " HEX VALUE)
23
24 (AH)= OOH RESET DISK (DL = 80H,8!HI / DISKETTE
25 (AHi" OIH READ THE STATUS OF THE LAST DISK OPERATION INTO (AU
26 NOTE: DL < 80H - DISKETTE
27 DL > SOH - 0 I SK
28 (AH)= 02H REAO THE DESIRED SECTORS INTO MEMORY
29 (AHI" 03H WRITE THE DESIRED SECTORS FROM MEMORY
30 (AH)" 04H VER I FY THE DES I RED SECTORS
31 (AH)" 05H FORMAT THE OES I RED TRACK
32 (AHI = 06H FORMAT THE DESIRED TRACK AND SET BAD SECTOR FLAGS
33 (AH)= 07H FORMAT THE DRIVE STARTING AT THE DESIRED TRACK
34 (AH)" 08H RETURN THE CURRENT DR [VE PARAMETERS
35
(AHI= 09H [N[TlALIZE DRIVE PAIR CHARACTERISTICS
"
37
38 (AHi" OAH
INTERRUPT 41H POINTS TO DATA BLOCK
READ LONG
39 (AHJ" OBH WR I TE LONG
40 NOTE: READ AND WRITE lONG ENCOMPASS
41 512 BYTES + 4 BYTES OF ECC
42 (AH) " OCH SEEK
43 (AH) " ODH AL TERN ATE DISK RESET (SEE DL I
44 (AH) " OEH READ SECTOR BUFFER
45 (AH) " OFH WR I TE SECTOR BUFFER,
46 (RECOMMENDED PRACT I CE BEFORE FORMATT [NG)
47 (AH) IOH TEST OR I VE READY
48 (AH) IIH RECAL I BRA TE
49 (AH) I2H CONTROLLER RAM 0 [AGNOST I C
50 (AH) I3H DRIVE DIAGNOSTIC
51 (AH) 14H CONTROLLER INTERNAL 0 I AGNOST [C
52
53 REGISTERS USED FOR FIXED DISK OPERATIONS
54
55 (DLI DR[VE NUMBER (80H-87H FOR DISK, VALUE CHECKED)
56 (DHI HEAD NUMBER (0-70 ALLOWED, NOT VALUE CHECKED I
57 (CHI CYLINDER NUMBER (0-10230, NOT VALUE CHECKED) (SEE CU
58 (CLI SECTOR NUMBER ( 1-170, NOT VALUE CHECKED)
59
60 NOTE: HIGH 2 BI TS OF CYL [NDER NUMBER ARE PLACED
61 IN THE HIGH 2 BITS OF THE CL REGISTER
62 (10 BITS TOTAl)
63 (AU NUMBER OF SECTORS (MAXIMUM POSSIBLE RANGE 1-80H,
64 FOR READ/WRITE LONG 1-79H)
65 ( I NTERLEA VE VALI,IE FOR FORMAT I - I 60 I
66 (ES:BXI ADDRESS OF BUFFER FOR READS AND WR [TES,
67 (NOT REQU I RED FOR VER I FY I
68
69 OUTPUT
70 AH " STATUS OF CURRENT OPERATION
71 STATUS BITS ARE DEFINEO IN THE EGlUATES BELOW
72 CY = 0 SUCCESSFUL OPERATION (AH" OOH ON RETURN)
73 CY " I FA[LED OPERATION (AH HAS ERROR REASON)
74
75 NOTE: ERROR IIH [NDICATES THAT THE DATA READ HAD A RECOVERABLE
76 ERROR WHICH WAS CORRECTED BY THE ECC ALGORITHM. THE DATA
77 IS PROBABLY GOOD, HOWEVER THE BIOS ROUT I NE I NO [CA TES AN
78 ERROR TO ALLOW THE CON TROLL [NG PROGRAM A CHANCE TO DEC I DE
79 FOR ITSELF, THE ERROR MAY NOT RECUR IF THE DATA IS
80 REWRITTEN. (ALI CONTAINS THE BURST LENGTH.
81
82 I F DR I VE PARAMETERS WERE REQUESTED,
83
84 DL " NUMBER OF CONSECUTIVE ACKNOWLEDGING DRIVES
85 ATTACHED (0-21 ICONTROlLER CARD ZERO TALLY ONLYI
86 DH " MAX I MUM USEABLE VALUE FOR HEAD NUMBER
87 CH " MAXIMUM USEABLE VALUE FOR CYLINDER NUMBER
88 CL " MAX I MUM USEABLE VALUE FOR SECTOR NUMBER
89 AND CYL I NDER NUMBER H [GH BITS
90
91 IF AN ERROR OCCURS ON READ DRIVE PARAMETERS,
92
93 AH " ERROR CODE (INIT FAILI
94 AL :: CX '" OX " 0 -
95
96 REGISTERS WILL BE PRESERVED EXCEPT WHEN THEY ARE USED TO RETURN
97 INFORMATION.
98
99 NOTE: IF AN ERROR [S REPORTED BY THE D[SK CODE, THE APPROPRIATE
100 ACT I ON I S TO RESET THE 0 [SK, THEN RETRY THE OPERAT I ON.
101
102
103 PAGE
104 ; ----- - - -- ------- - ------- ------- - - ---- - -- - -------- - ------
105 ; ERROR RETURN STATUS (AH):: PH WHEN CY= I
106
107
108 DOFF SENSE FAIL EQU OFFH SENSE OPERAT I ON FA [LED
109 :: OOCC WR I TE-F AUL T EQU OCCH WRITE FAULT ON SELECTED DRIVE
110 OOBB UNDEF-ERR EQU OBSH UNDEF I NED ERROR OCCURRED
I I 1 0080 TIME OUT EQU 080H A TT ACHMENT FA I LED TO RESPOND
112 :: 0040 BAD SEEK EQU 040H SEEK OPERATION FAILED
1 13 0020 BAD-CNTLR EQU 020H CONTROLLER HAS FA [LEO
114 0011 DA TA CORRECTED EQU o 11H ECC CORRECTED DATA ERROR
115 00 I 0 BAD ECC EQU O\OH BAD ECC ON 0 [SK READ
I 16 OOOB BAD-TRACK EQU OOBH BAD TRACK FLAG DETECTED
I 17 0009 DMA -BOUNDARY EQU 009H ATTEMPT TO OMA ACROSS 64K BOUNDARY
I 18 0007 [NIT FAIL EQU 007H DRIVE PARAMETER ACTIVITY FAILED
I 19 0005 BAD RESET EQU 005H RESET FAILED
120 0004 RECaRD NOT FNo EQU 004H REQUESTED SECTOR NOT FOUND
121 0002 BAD ADDR MARK EQU 002H ADDRESS MARK NOT FOUND
122 0001 BAo::::CMo - EQU 00 I H BAD COMMAND PASSED TO 0 I SK I {a
123
124
125 I NTERRUPT AND STATUS AREAS
126
127
;- - - --------- - - - --
- - - --
128 0000 ABSO SEGMENT AT OH
129 0034 ORG 000H·4 F [XED 0 I SK I NTERRUPT VECTOR
130 0034 Ho [SK I NT LABEL DWORO
131 004C ORG o 13H·4 DISK I NTERRUPT VECTOR
132 004C ORG_ VECTOR LABEL DWORD
133 0064 ORG o 19H·4 BOOTSTRAP INTERRUPT VECTOR
134 0064 BOOT _ VEC LABEL oWORD
135 0078 ORG 01 EH·4 DISKETTE PARAMETERS
136 0078 DISKETTE_PARM LABEL DWORD
137 0 I 00 ORG 040H-4 NEW 0 I SKETTE [NTERRUPT VECTOR
138 0100 01 SK_VECTOR LABEL oWORD
139 0104 ORG 041H·4 F I XED 0 [SK PARAMETER VECTOR
140 0 I 04 HF _ TBL_ VEC LABEL DWORD
141 7COO ORG 7COOH BOOTSTRAP LOADER VECTOR
142 7COO BOOT LOCN LABEL FAR
143 7COO ABSO- ENOS
144
145 0000 DATA SEGMENT AT 40H
146
147
006C
006C 1777
ORG
OW , T I MER LOW WORD
148
149
0072
0072 RESET_FLAG
ORG
OW ,
072H
1234H [F KEYBOARD RESET UNDERWAY
150 0074 ORG 074H
151 0074 DISK STATUS DB FIXED DISK STATUS BYTE
152 0075 HF NOM DB COUNT OF FIXED DISK DRIVES
153 0076 CONTROL BYTE DB CONTROL BYTE DR I VE OPT IONS
154 0077 PORT OFF DB PORT OFFSET
155 0078 oATA- ENOS
156
157 0000 CODE SEGMENT
158
159 ; - --- ---- --- - - - - - -------- - - - - -----
160 HARDWARE SPECIFIC VALUES
161 1
162 CONTROLLER I {O PORT
163 > WHEN READ FROM:
164 HF PORT+O READ DATA (FROM CONTROLLER TO CPUI
165 HF-PORT + 1 READ CONTROLLER HARDWARE STATUS
166 - (CONTROLLER TO CPU I
167 HF _PORT+2 READ CONFIGURATION SWITCHES
168 HF PORT + 3 - NOT USED
169 > WHEN WR I TTEN TO:
170 HF PORT+ 0 WR I TE OAT A I FROM CPU TO CONTROLLER I
171 HF-PORT+ I CONTROLLER RESET
172 HF-PORT+2 GENERATE CONTROLLER SELECT PULSE
173 HF-PORT+3 WR I TE PATTERN TO DMA AND INTERRUPT
174 MASK REG! STER
175
176
177
178 CMD BLOCK EQU 8YTE PTR [BP1-B CMO BLOCK HEAD
179 0320 HF PORT EQU 0320H 01 SK PORT
180 0020 INTAOO EQU 020H 8259 PORT
181 0021 INTAO I EQU 021 H 8259 PORT
182 0020 EOI EQU 020H END OF I NTERRUPT COMMAND
183 0008 R I 8USY EQU 00001000B DISK PORT 1 BUSY BIT
184 0004 R I-BUS EQU OOOOOIOOB COMMAND/DATA BIT
185 0002 Rl-IOMOoE EQU 000000 1 DB MODE BIT
1860001 R1::::REQ EQU 0000000 I B REQUEST B[T
187
188 0047 DMA READ EOU 01000111B 1047HI
189 004B DMA-WR [TE EQU 01001011B CHANNEL 3 (04BH)
190 0000 OMA EQU OOOH OMA ADDRESS
191 0082 DMA_H I GH EOU OB2H PORT FOR HIGH 4 BITS OF OMA
192
193 0000 TST ROY CMD EQU 000000008 CNTLR READY { OOHI
194 0001 RECAL CMD EQU 0000000IB RECAL (OIHI
195 0003 SENSE-CMD EQU 00000011 B SENSE 103H)
196 0004 FMToRV CMD EOU 00000 I OOB DRIVE (04Hl
197 0005 CHK TRK CMD EOU 000001018 T CHK ( 05H)
198 0006 FMTTRK CMD EQU 000001108 TRACK 106H)
199 0007 FMTBAO-CMD EQU OOOOOIIIB BAD 107H)
200 0008 READ CMD EQU 0000 I 0008 READ 108H)
20 I OOOA WRITE CMo EQU 000010108 WRITE (OAHI
202 OOOB SEEK CMD EQU OOOOIOIIB SEEK (08H)
203 OOOC I N I T-ORV CMD EOU OOOOIIOOB INIT (OCHI
204 0000 RD ECC CMO EOU 000011018 8URST (DOH)
205 OOOE RD-BUFF CMD EQU 00001110B BUFFR (OEHI
206 OOOF WR-BUFF-CMO EQU 000011118 BUFFR (OFH)
207 OOEO RAM O[AG CMD EOU 1 I 100000B RAM IEOHI
208 00E3 CHK-DRV CMD EQU 11100011 B ORV IE3HI
209 00E4 CNTLR DIAG CMO EQU I I 1001 OOB CNTLR {E4HI
210 00E5 RD LONG CMD EOU I I 100101 B RLONG {E5HI
211 00E6 WR:::LONG:::CMD EQU I I 10011 OB WLONG (E6HI
212
213 OOOB MAX FILE EQU
214 0002 S_MAX FILE EQU
215 PAGE
216 ASSUME CS:CODE,OS:ABSO
217 0000 ORG OH
218 0000 55 DB 055H I GENER [C B I as HEADER
219 0001 AA DB OAAH
220 OOOZ 08 DB 080 ; 4K MODULE
221
222 ; --- - -------- - - - ----- - - - - --- - - - ----- ---- ----- -- - ---
223 ; FIXED DISK I/O SETUP
224 ;
225 ; ESTABl [SH TRANSFER VECTORS FOR THE F I XED 0 I SK
225 PERFORM POWER ON 0 I AGNOSTI CS
227 ; SHOULD AN ERROR OCCUR A "170 I" MESSAGE IS D I SPLA YEO
228 ;
229 ;
230
231 0003 01 SK SETUP FROC FAR
232 0003 E8 35 - JMP SHORT L3
233 0005 35 39 58 37 32 39 DB '59X7291 IC) COPYRIGHT IBM CORP.' COPYR I GHT NOT I CE
234 31 20 Z8 43 29 20
235 43 4F 50 59 52 49
236 47 48 54 20 49 42
237 40 20 20 43 4F 52
238 50 2E
239 0025 2C 31 39 38 32 ZO DB ',1982,1985,'
240 2C 31 39 38 35 2E
241 0031 20 31 30 ZF 32 38 DB , 10/28/85' RELEASE MARKER
242 2F 38 35
243 D03A L3 :
244 003A 28 CO SUB AX ,AX ADDRESS LOW RAM
245 003C 8E 08 MOV OS,AX
240 003E FA CLI
247 003F A I 004C R MOV AX, WORD PTR ORG VECTOR LOAD 0 I SKETTE [P
248 0042 A3 0100 R MOV WORD PTR 01 SK VECTOR,AX STORE AT I NT 40H
249 0045 A I 004E R MOV AX,WORD PTR ORG VECTOR+2 LOAD D [SKETTE CS
250 0048 A3 0102 R MOV WORD PTR DISK VECTOR+2,AX STORE AT INT 40H
251 0048 C7 06 004C R 0251 R MOV WORD PTR ORG VECTOR, OFFSET 0 I SK 10 F I XED 0 [SK HANDLER
252 0051 8C DE 004E R MDV WORD PTR ORG-VECTOR+2,CS AT [NT 13H
253 0055 B8 0755 R MDV AX, OFFSET Hi) I NT F I XED 0 I SK INTERRUPT
254 0058 A3 0034 R MOV WORD PTR HOI SI< INT ,AX HANDLER AT I NT ODH
255 0058 8C OE 0036 R MOV WORD FTR HDISK-INT+2,CS
256 005F C7 06 0064 R 0192 R MOV WORD FTR SOOT VEC,OFFSET BOOT STRAP BOOTSTRAP ROUT[NE AT
257 0065 8C DE 0066 R MOV WORD PTR BOOT-VEC+2,CS - [NT 19H
258 0069 C7 06 0104 R 03FF R MOV WORD PTR HF TeL VEC, OFFSET FO TBL PARAMETER TABLE AT
259 006F 8C DE 0106 R MDV WORD PTR HF=:TBL=:VEC+2,CS - [NT 41H
260 0073 F8 STI
261
252 ASSUME
263 0074 88 ---- R MOV AX,oATA ESTA8L I SH SEGMENT
254 0077 8E 08 MOV OS,AX
265 0079 C6 06 0074 R 00 MOV DISK STATUS,O RESET THE STATUS INDICATOR
266 007E C6 06 0075 R 00 MOV HF NUM,O ZERO COUNT OF DR I YES
267 0083 C6 06 0077 R 00 MOV PORT OFF, 0 ZERO CARD OFFSET
268 0088 B9 0025 MOV CX,25H RETRY COUNT
269 008B L4:
270 0088 E8 0177 R CALL HO RESET 1 RESET CONTROLLER
271 008E 73 05 JNC L 7- -
272 0090 E2 F9 LOOP L4 TRY RESET AGA I N
273 0092 E9 0154 R JMP ERROR_EX
274 0095 L 7:
275 0095 89 000 I MOV CX,l
216 0098 8A 0080 MOV DX,80H
277 0098 B8 1200 MOV AX,I200H CONTROLLER D I AGNOST I CS
278 009E CO 13 INT I3H CHECK THE I NTERNAL RAM
279 OOAO 73 03 JNC P7 BUFFERS
280 00A2 E9 0154 R JMP ERROR_EX
281 00A5 P7 :
282 00A5 88 1400 MOV AX,I400H CONTROLLER D I AGNOST I CS
283 00A8 CO 13 INT I3H I NTERNAL CHECKSUM AND
284 OOAA 73 03 JNC P9 ECC CIRCUITRY TEST.
285 OOAC E9 0154 R JMP ERROR_EX
285 OOAF P9:
287 OOAF C7 06 006C R 0000 MOV TIMER LOW,O ZERO TIMER
288 00B5 81 3E 0072 R 1234 CMP RESET-FLAG, 1234H KEYBOARD RESET
289 00B8 75 06 JNE P8 -
290 OOBO C7 06 006C R 019A MDV TIMER_LOW,410D SKIP WAIT ON RESET
291 00C3 P8:
292 00C3 FA CLI D I SABLE INTERRUPTS
293 00C4 E4 21 IN AL,INTAOI TIMER
294 ODC6 24 FE ANO AL,OFEH ENABLE T [MER
295 00C8 E6 21 OUT INTA01,AL START TIMER
296 OOCA FB ST I I NTERRUPTS ON
297 00C8 P4:
298 00C8 E8 0177 R· CALL HD RESET 1 RESET CONTROLLER
299 OOCE 72 07 JC p(5 -
300 0000 88 1000 MOV AX,IOOOH TEST TO SEE IF THE DRIVE
301 00D3 CD 13 INT I3H [S READY
302 0005 73 OA JNC P2
303 0007 PIO:
304 0007 AI 006C R MDV AX, Tl MER LOW
305 OODA 30 OIBE CMP AX,446D - 25 SECONDS
306 0000 72 EC JB P4
307 OOOF E8 73 JMP SHORT ERROR_EX
308 OOEI P2:
309 OOEI 88 1100 MDV AX,IIOOH RECAL 18RATE THE OR I YE 0
310 00E4 CO 13 INT I3H
311 OOE6 72 6C JC ERROR_EX
312
313 00E8 88 0900 MOV AX,0900H SET DR I VE PARAMETERS
314 O{)EB CD 13 INT I3H FOR DRIVE 0
315 ODED 72 65 JC ERROR_EX
316
317 OOEF 88 C800 MOV AX ,OC800H DNA TO BUFFER
318 00F2 8E CO MDV ES,AX SET SEGMENT
319 00F4 2B 08 SUB BX,ex
320 00F6 88 OFOO MDV AX,OFOOH WR [TE SECTOR BUFFER
321 00F9 CD 13 INT I3H
322 00,F8 72 57 JC ERROR_EX
323
324 OOFO FE 06 0075 R INC HF NUM DR I VE ZERO RESPONDED
325 0101 BA 0213 MDV OX-;213H EXPANS [ON BOX
326 0104 80 00 MOV Al,O
327 0106 EE OUT OX,AL TURN BOX OFF
328 Ol078A0321 MDV DX,321H TEST IF CONTROLLER
OX
NEAR
SAVE REG I STER
409 PAGE
410 ; --- I NT 19 H --- ------- --- ------- ------ -- ----------- ---------
411
412 INTERRUPT 19 800T STRAP LOADER
413
414 THE F I XED 0 I SK B I OS REPLACES THE INTERRUPT 19H BOOT
415 STRAP VECTOR WITH A PO I NTER TO TH I S BOOT ROUT I NE AND
416 RESETS THE DEFAULT DISK AND DISKETTE PARAMETER VECTORS
411
418 THE BOOT BLOCK TO BE READ IN WILL 8E ATTEMPTED FROM
419 CYL I NDER 0 SECTOR 1 OF THE DEV I CE.
420
421 THE BOOTSTRAP SEQUENCE IS:
422 ATTEMPT TO LOAD FROM THE DISKETTE INTO THE BOOT
423 LoCAT I ON (0000: 7COOH) WHERE CONTROL I S TRANSFERRED.
424 IF THE DISKETTE FAILS THE FIXED DISK IS TRIED FOR A
42S VALID BOOTSTRAP 8LOCK. A VALID 800T 8LoCK ON THE
426 F I XED 0 I SK CONS I STS OF THE 8YTES 055H OAAH AS THE
427 LAST TWO 8YTES OF THE 8LOCK.
428 IF THE A80VE FAILS CONTROL IS PASSED TO RESIDENT BASIC
429
430
431
432 0192 BOOT STRAP:
433 - ASSUME OS: ABSO, ES: ABSO
434 0192 2B CO SUB AX,AX
43S 0194 8E 08 NOV DS,AX EST A8L I SH SEGMENT
436 0196 B4 CO NOV AH,OCOH
437 0198 CD 15 IN7 ISH READ CONF I GURAT I ON PARAMETERS
438 IF XT OR PC, I NTERRUPTS ARE 0 I SABLEO
439 RESET PARAMETER VECTORS AT THIS POINT.
440
441 o 19A FA CLI
442 0198 CT 06 0104 R 03FF R MoV WORD PTR HF TBL VEC, OFFSET FD TBL
443 01AI 8C OE 0106 R MOV WORD PTR HF-TBL -VEC+2, CS -
444 0lA5 73 OA JNC HO - - ; JMP I F I NT 15 FUNCT I ON IMPLEMENTED
44S
446 0lA7 C7 06 0078 R 0227 R MOV WORD PTR 0 I SKETTE PARM, OFFSET 0 I SKETTE TBL
447 OIAD 8C OE 001A R MOV WORD PTR DISKETTE:::PARM+2,CS -
448 OIBI HO:
449 0181 FB STI
4S0
4S1 ATTEMPT BOOTSTRAP FROM 01 SKETTE
4S2
4S3 01 B2 2B 02 SUB OX,DX OR I VE ZERO
4S4
4SS ESTABLISH ES:BX POINTER
4S6
4S7 0lB4 8E C2 NOV ES ,OX ESTABLISH SEGMENT
4S8 0186 BB 7COO R NOV BX,OFFSET BooT_LOCN SET BX TO 1COOH
4S9
460 CLEAR BOOT_LOCN
461
462 0189 FC CLO DIRECT I ON FORWARD
463 o IBA 33 CO XOR AX, AX
464 018C 89 0100 NOV CX,256 CLEAR 256 WORDS
46S 018F 88 FB NOV DI,8X POINT TO BOOT LOCATION 8UFFER
466 OICI F3/ A8 REP STOSW ZERO THE BOOT LOCAT I ON BUFFER
467
468 0lC3 89 0004 NOV CX,4 SET RETRY COUNT
469 o IC6 HI: IPL SYSTEM
470 o IC6 51 PUSH CX SAVE RETRY COUNT
471 0lC7 2B CO SUB AX,AX RESET THE 0 I SKETTE
472 0lC9 CD 13 INT 13H FILE 10 CALL
473 OICB 72 08 JC H2 IF ERROR, TRY AGAIN
474
47S OICD B8 0201 NOV AX,020!H READ I N THE SINGLE SECTOR
476 0100 B9 000 I NOV CX,I SECTOR I, TRACK 0
477 0103 CO 13 INT 13H FILE 10 CALL •
478 0105 59 H2: POP CX RECOVER RETRY COUNT
479 0106 73 09 JNC H3 CARRY FLAG SET 8'1' UNSUCCESSFUL READ
480
481 0108 80 FC 80 CNP AH,80H IF TIME OUT, NO RETRY
482 OIOB 74 22 JZ H6 TRY FIXED DISK
483
484 0100 E2 E7 LOOP HI DO I T FOR RETRY TIMES
48S OIOF EB IE JNP SHORT H6 UNABLE TO I PL FROM THE 0 I SKETTE
486
487 OIEI 80 3E 7COO R 06 H3: CMP BYTE PTR BOOT_LOCN,06H CHECK FOR FIRST INSTRUCTION INVALID
488 0lE6 72 30 JB HIO IF 800T NOT VAllO, GO TO BASIC
489
490 INSURE DATA PATTERN FIRST 8 WORDS NOT ALL EQUAL
491
492 0lE8 8F 7COO R NOV 01 ,OFFSET BOOT LoCN ; CHECK DATA PATTERN
493 0lE8 89 0008 NOV CX,8 - ; CHECK THE NEXT 8 WORDS
494 OIEE AI 7COO R NOV AX,WORD PTR BOOT_LOCN ; LOAD THE FIRST WORD
49S
496 OIFI 83 C7 02 H4: AOO 01,2 ; PO I NT TO NEXT WORD
497 0lF4 38 05 CNP AX, (01 J ; CHECK DATA PATTERN FOR A FILL PATTERN
498 01F6 EI F9 LoOPZ H4
499 0lF8 74 28 JZ HIO ; BOOT NOT VALID, GO TO BASIC
SOO o IFA H5:
SOl OIFA EA 7COO ---- R JMP 800T _LOCN
S02
S03 ATTEMPT BOOTSTRAP FROM FIXED DISK
S04
SOS 01 FF H6:
S06 01 FF 28 CO SUB AX, AX RESET D (SKETTE
S07 0201 CD 13 INT 13H
S08 0203 89 0003 MOV CX,3 SET RETRY COUNT
S09 0206 8A 0080 NOV DX,ooaOH FIXED DISK ZERO
SIO 0209 H7 : IPL SYSTEM
SII 0209 51 PUSH SAVE RETRY COUNT
SI2 020A 2B CO SUB AX, AX RESET THE F I XED 0 I SK
SI3 020C CD 13 INT 13H FILE 10 CALL
SI4 020E 72 08 JC H8 IF ERROR, TRY AGAIN
SIS
SI6 ES AND BX ALREADY ESTABLISHED
SI1
SI8 0210 B8 0201 NOV AX, 020 1H READ I N THE SINGLE SECTOR
5>9 0213 89 0001 NOV ex, I SECTOR I, TRACK 0
S20 0216 CD 13 INT 13H FILE 10 CALL
S21 0218 59 H8: POP CX RECOVER RETRY COUNT
S22 0219 12 08 JC H9
.2.
521
.28
53.
0223 E2 E4
;-----
LOOP H1 ;
531 0225
532 0225 CO 18 INT 18H RESIDENT BASIC
533
534 0227 01 SKETTE_ TBL I
.35
536 0227 CF DB 110011 I IB SRT=O, HD UNLOAD=OF - 1 ST SPEC BYTE
537 0228 02 DB 2 HD LOAD= I, MODE=DMA - 2ND SPEC BYTE
538 0229 25 DB 25H MOTOR TIMEOUT AFTER OPERATION
539 022A 02 DB 2 51 2 8YTES PER SECTOR
540 0228 08 DB 8 EOT (LAST SECTOR ON TRACK)
541 022C 2A DB 02AH GAP LENGTH
542 0220 FF DB OFFH DTL
543 022E 50 DB 050H GAP LENGTH FOR FORMAT
544 022F F6 DB OF6H FILL BYTE FOR FORMAT
545
546
0230
0231
19
04
DB 2. HEAD SETTLE T I ME (M I LL I SECONDS)
MOTOR START TIME (118 SECOND)
DB 4
.41
548 ;----- MAKE SURE THAT ALL HOUSEKEEPING IS DONE BEFORE EXIT
'4'
550 0232 D58L PROC NEAR
551 0232 2A CO SUB AL,AL ; RESET I NT IDMA MASK
552 0234 BA 0323 MDV DX,HF _PORT+3 LOAD FOR PORT ADDRESS :3
553 0231 FA eLi 01 SA8LE INTERRUPTS
554 0238 EE DUT DX,AL RESET I NT/DMA MASK CARD a
555 0239 83 C2 04 ADD DX,4
556 023C EE DUT DX,AL RESET INT/DMA MASK CARD 1
557 0230 83 C2 04 ADD DX,4
558 0240 EE DUT aX,AL RESET (NT/DMA MASK CARD 2
559 0241 83 C2 04 ADD OX,4
560 0244 EE DUT DX,AL J RESET INT /DMA MASK CARD :3
'61
562 0245 80 07 MDV AL,07H
563 0247 E6 OA DUT DMA+IO,AL SET DMA MODE TO 0 I SA8LE
564 0249 E4 21 IN AL,INTAOI
565 0248 OC 20 DR AL,020H
566 0240 E6 21 OUT INTAOI,AL oI SABLE I REQ 5
567 024F FB 511 ENABLE INTERRUPTS
568 0250 C3 RET
569 0251 OSBL ENDP
51 •
• 11
512
.13 FIXED DISK BIOS ENTRY POINT
.14
51. ; - --- -- - - -- - ---- - - - - - ------- -- - --------------------------
516
577 0251 DISK 10 PROC FAR
518 - ASSUME OS :DATA,ES:NOTHING
579 0251 80 FA 80 eMP DL,080H TEST FOR FIXED DISK DRIVE
580 0254 73 05 "AE HARD 01 SK YES, HANDLE HERE
581 0256 CO 40 INT 40H - DISKETTE HANDLER
582 0258
583 0258 CA 0002 RET J BACK TO CALLER
.84
585 0258 HARD DISK:
586 0258 FB - STI J ENABLE INTERRUPTS
587 025C OA E4 OR AH,AH
588 025E 75 09 "NZ A3
589 0260 CO 40 INT 40H RESET NEC WHEN AH=O
590 0262 2A E4 SUB AH,AH
591 0264 80 FA 81 e"p DL, (80H+S MAX FILE-I) DL IN LIMITS?
592 0267 77 EF "A RET_2 - -
593 0269 A3:
594 0269 80 FC 08 e"p AH,8 GET PARAMETERS I S A SPEC I AL CASE
595 026C 75 03 "NZ A2
596
597
026E
0271
E9 0380 R
A21 ""P GET_PARM_N
6.,
600 0274 83 EC 08 SUB SP,8 ALLOCATE SPACE FOR THE COMMAND BLOCK
ON THE STACK.
602 0277 53 PUSH BX SAVE REGISTERS DURING OPERATION
603 0278 51 PUSH ex
604 0279 52 PUSH ox
605 027A IE PUSH DS
606 0278 06 PUSH ES
607 02IC 56 PUSH 51
608 0270 57 PUSH DI
609 027E 8E ---- R NOV 51 ,DATA
610 0281 8E DE NOV DS,SI J ESTABLISH DATA SEGMENT
6"
612 0283 E8 0200 R CALL DISK_IO_CONT PERFORM THE OPERATION
613
614 0286 SO PUSH AX
615 0287 E8 0232 R CALL DSBL BE SURE 0 I SABLES OCCURRED
616 028A 88 ---- R MOV AX,DATA
617 0280 8E 08 MOV DS,AX ESTA8L I SH SEGMENT
618 028F 58 POP AX RESTORE THE REGI STERS
619 0290 8A 26 0074 R MOV AH,DISK STATUS GET STATUS FROM OPERATION
620 0294 SF POP DI -
621 0295 5E POP 51
622 0296 07 POP ES
623 0297 IF POP OS
624 029B SA POP OX
625 0299 59 POP ex
626 029A 5B POP BX
621
628 0298 83 C4 08 ADD SP,8 ADJUST FOR THE COMMAND BLOCK.
629 029E 50 POP BP RESTORE 8ASE POINTER
630 029F BO FC 01 eMP AH, I SET THE CARRY FLAG TO INDICATE
631 02A2 FS eMe SUCCESS OR FAILURE
632 02A3 CA 0002 RET THROW AWAY SAVED FLAGS
633 02A6 DISK_IO ENDP
.34 PAGE
635 02A6 MI LA8EL WORD FUNCT [ON TRANSFER TA8LE
636 02A6 032E R OW DISK RESET OOOH
637 02A8 0347 R OW RETURN STATUS 001 H
638 02AA 0350 R OW DISK READ 002H
639 02AC 0359 R OW DISK-WR[TE 003H
640 02AE 0362 R OW 01 SK-VERF 004H
641 0280 0369 R OW FMT TRK DOSH
642 0282 036F R OW FMT-BAD D06H
643 0284 0375 R OW FMT-DRV D07H
644 0286 0326 R OW 8AD-COMMAND OOSH
645 0288 043F R OW [NIT DRV 009H
646 028A 04F4 R OW RD LONG OOAH
647 028C 0501 R OW WR-LONG 008H
648 028E 0515 R OW D 15K SEEK DOCH
649 02CO 032E R OW DISK-RESET OODH
650 02C2 0518 R OW RD 8UFF OOEH
651 02C4 0527 R OW WR-8UFF OOFH
652 02C6 0533 R OW TST ROY OIOH
653 02C8 0539 R OW HOISK RECAL OIIH
654 02CA 053F R OW RAM OTAG QI2H
655 02CC 0545 R OW CHK-DRV o 13H
656 02CE 0548 R OW CNTLR DIAG 014H
657 '" 002A MIL EQU $-M1 -
.58
659 0200 01 SK 10 CONT PROC NEAR
660 0200 80 FC 01 - -CMP AH,OIH RETURN STATUS
661 0203 74 72 JE RETURN_STATUS
•• 2
CONVERT DR I VE NUM8ER TO 0 8ASED RANGE
...
663 0205 80 EA 80 5UB DL ,080H
664 0208 80 FA 08 e"p DL,MAX FILE LEGAL DR I VE TEST
665 0208 73 49 JAE 8AO_COMMAND
..•••,
•• 0
•• 2
PAGE
I NIT I AL I ZE DR I VE CHARACTER I ST I CS
•••
•••
FIXED DISK PARAMETER TABLE
...•••
•••
•• 7
.70
THE TABLE IS COMPOSED OF A BLOCK DEFINED AS:
(I
(I
(I
WORD)
BYTE)
WORD)
-
-
-
MAXIMUM NUMBER OF CYLINDERS
MAXIMUM NUMBER OF HEADS
STARTING REDUCED WRITE CURRENT CYL
.71 (I WORD) - STARTING WRITE PRECOMPENSATION CYL
."
.72
.,.
.7.
II
II
BYTE}
BYTE)
-
-
MAXIMUM ECC DATA BURST LENGTH
CONTROL BYTE IDRIVE STEP OPTION)
.7..77 BIT
BIT
1 DISABLE DISK-ACCESS RETRIES
6 DISABLE ECC RETRIES
..,
.7'
•• 0
•• 2
•••
II
(1
(I
(I
(I
(I
BYTE)
BYTE)
BYTE)
WORD)
BYTEl
BYTE)
-
-
-
-
-
-
STANDARD TIME OUT VALUE (SEE BELOW)
TIME OUT VALUE FOR FORMAT DRIVE
T I ME OUT VALUE FOR CHECK OR I VE
LAND I NG ZONE
SECTORS/TRACK
RESERVED FOR FUTURE USE
•••
••• - TO DYNAMICALLY DEFINE A SET OF PARAMETERS
•••
•• 7
BUILD A TABLE OF VALUES AND PLACE THE
CORRESPONDING VECTOR INTO INTERRUPT 41 •
..•••••••••,
•• 0
NOTE: THE DEFAULT TABLE IS VECTORED
AN INTERRUPT 19H (BOOTSTRAP)
IN FOR
...••••••
•• 2 ON THE CARD SW ITCH SETT I NGS
ON:
DRP/E 0
I
DRIVE I
I
.'7 I -1- -2- I -3- -4-:
•••
•••
OFF I :
• 00
.0..0.
'01
'02
TRANSLATION TABLE
DRIVE 0
1/2
: DRIVE I
3/4
: TABLE ENTRY
'0'
'0. ON ON : ON ON
.0..,0
'07
'0.
ON OFF
OFF ON
OFF OFF
:
:
:
ON OFF
OFF ON
OFF OFF
:
:
:
..
.11
912
.,,.
913 03FF FD_TBL:
.2.'.0
921 0400 II DB 0170 SECTORS/TRACK
928 040E 00 DB 0 RESERVED
;----- OR I VE TABLE I
.31
932 040F 0264 OW 06120 MAX CYL I NDERS
933 0411 04 DB 0.0 MAX HEADS
934 0412 0264 OW 06120 START REDUCED WRITE CURRENT CYL
935 0414 0000 OW 0 START WRITE PRECOMPENSATION CYL
936 0416 OB DB OBH MAX ECC BURST DATA LENGTH
931 0411 05 DB 0000010lB CONTROL BYTE
938 0418 28 DB 028H STANDARD TIME OUT
939 0419 EO DB OEOH T I ME OUT FOR FORMAT DR I VE
940 041A 42 DB 042H T I ME FOR CHECK DR I VE
941 041B 0297 OW 06630 LAND I NG ZONE
942 0410 11 DB 0110 SECTORS/TRACK
943 041E 00 DB 0 RESERVED
•••
••• ;----- DRIVE TABLE 2
•••
947 041F 0267 OW 06150 MAX CYLI NOERS
948 0421 04 DB 0.0 MAX HEADS
949 0422 0267 OW 06150 START REDUCED WRITE CURRENT CYL
950 0424 01 2C OW 03000 START WRITE PRECOMPENSATION CYL
951 0426 OB DB OBH MAX ECC BURST DATA LENGTH
952 0427 05 DB OOOOOIOIB CONTROL BYTE
953 0428 28 DB 028H STANDARD TIME OUT
954 0429 EO DB OEOH TIME OUT FOR FORMAT DRIVE
955 042A 42 DB 042H TIME FOR CHECK DRIVE
956 042B 0267 OW 06150 LAND I NG ZONE
957 0420 It DB 0170 SECTORS/TRACK
..•••,
958 042E 00 DB 0 RESERVED
97.
975 ; ----- - -- ------ ---- - - --------- -------- ----------- -----
976 ; INITIALIZE DRIVE (AH = 09H) :
977
978
979 043F PROC NEAR
980
981 DO OR I VE ZERO
982
983 043F C6 46 F8 OC "OV CMD BLOCK+O, INIT ORV CMD
984 0443 C6 46 F9 00 "OV CMD-BLDCK+I,O - - SET FOR DR I VE 0
985 0447 E8 0458 R CALL INIT DRV R SEND THE PARAMETERS
986 044A 72 08 JC INIT::::DRV::::OUT ERROR?
987
988 DO DRIVE ONE
989
990 044C C6 46 F8 OC "OV CMD 8LOCK+O,INIT DRV CMD
99 I 0450 C6 46 F9 20 "OV CMD-BLOCK+l,OOtOOOOOB SET TO DRIVE I
992 0454 E8 0458 R CALL INIT_DRV_R SEND THE PARAMETERS
993 0457 INIT DRV OUT;
994 0457 C3 - RET EXIT
995 0458 lNIT_ORV
996
997 0458 INIT DRV R PROC NEAR
998 0458 2A CO - SUB AL,AL
999 045A E8 057C R CALL COMMAND I SSUE THE COMMAND
10000450 73 01 JNC BI OX = PORT 0 AFTER CALL
1001 045F C3 RET
\ 002 0460 61 :
1003 0460 8C 09 "OV CX,DS SAVE SEGMENT
1004
1005 ASSUME DS:ABSO
1006 0462 28 CO SUB AX ,AX
1007 0464 8E 08 "OV DS,AX ESTA8L I SH SEGMENT
10080466 C4 IE 0104 R LES 8X ,HF TBL VEC LOAD THE TABLE VECTOR
1009 046A 8E 09 "OV DS,CX- - RESTORE SEGMENT
1010
101 I ASSUME DS:DATA
1012 . - - - - ------ - -- - - ---- - - - - ---- -----
1013 ; DETERMINE PARAMETER TABLE OFFSET
1014 US I NG CONTROLLER PORT TWO AND
1015 DRIVE NUMBER SPECIFIER (0-1)
1016
1017 046C 42 INC OX
1018 0460 42 INC ox ADDRESS PORT 2
1019 046E EC IN AL,DX READ THE SW ITCH SETT I NGS
1020 046F 8A 66 F9 "OV AH ,CMD_BLOCK+ I
1021 047280 E4 20 ANO AH,OOIOOOOOB DRIVE 0 OR I
1022 0475 75 04 JNZ B2
1023 0477 DO E8 SHR AL, I ADJUST
1024 0479 00 E8 SHR AL, I
1025 0478 B2:
1026 0478 24 03 ANO AL,Ol18 ISOLATE
1027 0470 81 04 "OV CL,4
1028 047F 02 EO SHL AL,CL ADJUST
10290481 2A E4 SUB AH,AH
1030 0483 03 08 AOO 8X ,AX
1031 04858409 "OV AH,OOOOl0018 SET MASK FOR DATA MODE CPU TO CARD
1032
1033 SEND DRIVE PARAMETERS MOST SIGNIFICANT BYTE FIRST
1034
10350487 SF 0001 "OV DI, I SEND MS8 OF MAX CYLINDER
1036 048A E8 04E9 R CALL INIT DRV S
1037 0480 72 4C JC 83 - -
1038
1039 048F 8F 0000 "DV PI,O SEND LS8 OF MAX CYL I NDER
1040 0492 E8 04E9 R CALL INIT DRV S
1041 0495 72 44 JC 83 - -
1042
1043 0497 8F 0002 "DV 01,2 SEND THE MAX I MUM HEADS
1044 049A E8 04E9 R CALL INIT DRV S
1045 0490 72 3C JC 83 - -
1046
1047 049F 8F 0004 "OV DI,4 SEND MS8 OF REDUCE WR I TE CURRENT
1048 04A2 E8 04E9 R CALL INIT DRV S CYL I NDER
1049 04A5 72 34 JC 83 - -
t 050
1051 04A7 8F 0003 "OV o [,3 SEND LSB OF REDUCE WRITE CURRENT
1052 04AA E8 04E9 R CALL INIT DRV S CYLINDER
1053 04AD 72 2C JC 83 - -
1054
1055 04AF BF 0006 "OV o [,6 SEND MSB OF WR I TE PRECOMP CYL I NDER
1056 04B2 E8 04E9 R CALL INIT DRV S
1057 0485 72 24 JC 83 - -
\ 058
1059 04B7 SF 0005 "OV DI,5
1060 048A E8 04E9 R CALL INIT DRV S
1061 048072 IC JC B3 - -
1062
1063 04BF 6F 0007 "OV 01,7 SEND ECC BURST LENGTH
1064 04C2 E8 04E9 R CALL [NIT DRV S
1065 04C5 72 14 JC 83 - -
1066
1067 04C7 BF 0008 "OV 01,8 LOAD THE CONTROL BYTE AND PLACE IN
1068 04CA 26: 8A 01 "OV AL, ES: [8X+D I] MEMORY AT 40:76H
1069 04CD A2 0076 R "OV CONTROL_ 8YTE, AL
1070
1071 040026 C9 SUB CX,CX
1072 0402 B4 OF "DV AH,OOOOl1118
10730404 85:
1074 0404 E8 0680 R CALL HD WA IT GO WA I T FOR THE STATE TO HAPPEN
1075 0407 73 09 JNC B6- JMP TO READ THE STATUS 8YTE
1076 0409 E2 F9 LOOP B5 TRY AGAIN
1077 0408 83:
1078 0408 C6 06 0074 R 07 "OV DISK STATUS,INIT_FAIL OPERATION FAILED
1079 04EO F9 STC SET THE ERROR eOND I T I ON
1080 04E I C3 RET
1081 04E2 B6:
1082 04E2 4A OEC DX ADDRESS PORT 0
1083 04E3 EC IN AL,DX READ STATUS BYTE OF THE OPERATION
1084 04E4 24 02 ANO AL,2 MASK ERROR 81T
1085 04E6 75 F3 JNZ 83 ERROR 81T SET?
1086 04E8 C3 RET
1087 04E9 INIT_DRV_R ENDP
1088
1089 SEND THE BYTE OUT TO THE CONTROLLER
\ 090
\09\ 04E9 INIT DRV S PROC NEAR
1092 04E9 E8 0680 R - CALL HD WA I T GO WA I T FOR REQUEST
1093 04EC 12 05 JC D'- AFTER CALL OX = PORT 1
1094 04EE 411. DEC DX ADDRESS PORT 0
1095 04EF 26: MOV AL,ES: [BX+Ol ]
10<;16 04F2 EE OUT aX,AL WRITE THE OATil. TO THE CARD
1097 04F3 01 :
1098 04F3 C3 RET
1099 04F4 lNIT_DRV_S ENDP
1100
1101
I 102 READ LONG (AH = OAHI :
1 103
I 104
1I0504F4 RD_LONG PROC NEAR
1106 04F4 E8 050E R CALL CHK LONG ; CHECK LIM I TS
1101 04F7 12 SF JC GS -
1108 04F9 C6 46 F8 E5 MDV CMD BLOCK+O,RD LONG CMD
I 109 04FO BO 47 MDV AL,DMA READ - -
I I \ 0 04FF EB 50 JMP SHORT - DMA OPN
I I I I 050 I ENDP -
II \2
1113
1114 ,----
;
WR ITE LONG (AH = OBHI :
1115
1116
1111 050 I WR_LONG PROC NEAR
1118 0501 E8 050E R CALL CHK LONG ; CHECK LIM I TS
1 I 19 0504 12 52 JC GS -
1120 0506 C6 46 F8 E6 MOV CMD BLOCK + 0, WR LONG CMD
1 121 05011. 80 4B MDV AL,DMA WRITE - -
I 122 050C E8 50 JMP SHORT - OMA OPN
1123 050E WR_LONG ENOP -
1124
1125 050E CHK LONG PROC NEAR
1126 050E 811. 46 FC - MOV AL,CMD BLOCK+4 LOAD THE NUMBER OF SECTORS
11210511 3C 80 CMP AL,080H COMPARE WITH LIMITS
1128 0513 F5 CMC SET THE COND I T I ON
1129 0514 C3 RET
11300515 CHK_LONG ENDP
::.~~
1133 SEEK IAH = OCH) :
1134
1135
1136 0515 DISK SEEK PROC NEAR
1131 0515 C6 46 F8 OB - MOV CMD BLOCK+O, SEEK CMD
11380519 E8 34 JMP SHORT NOMA OPN-
11390518 01 SK_SEEK ENDP -
1140
1141
1142 READ SECTOR BUFFER (AH = OEHI :
1143
1144
1145 051B RD BUFF PROC NEAR
1146 0518 C6 46 F8 OE - MOV CMO BLOCK+O,RD BUFF CMD
1141 051F C6 46 FC 01 MDV CMD-BLOCK+4,1 - - ONLY ONE BLOCK
1148 0523 BO 41 MDV AL,OMA READ
1149 0525 EB 31 JMP SHORT - DMA_OPN
I 150 0527 RD_BUFF ENDP
1151
1152
1153
1154
,-----
;
WR I TE SECTOR 8UFFER (AH = OFHI
1155
1156 0521 WR BUFF PROC NEAR
11510521 C6 46 F8 OF - MOV CMO BLOCK + 0 • WR BUFF CMD
1158 052B C6 46 Fe 01 MDV CMD-BLOCK+4, 1 - - ONLY ONE BLOCK
1159 052F BO 4B MOV AL,OMA WRITE
1160 0531 EB 28 JMP SHORT - OMA _ OPN
11610533 WR _BUFF ENDP
1162
1163 ._-------------------------------------------------------
1164 ; TEST DISK READY (AH = OIOHI :
1165
1166
1 167 0533 TST ROY PROC NEAR
1168 0533 C6 46 F8 00 - MOV CMD 8LOCK+O, TST ROY CMD
1169 0537 EB 16 JMP SHORT NDMA_OPN -
1110 0539 TST_ROY ENDP
1111
1112 ; --- ------ - ---------- ------------- ----
1113 ; RECAL I BRATE (AH = 011HI :
1114
1175
11760539 HD I SK RECAL PROC NEAR
1111 0539 C6 46 F8 01 - MOV CMD BLOCK+O,RECAL CMD
11180530 EB 10 JMP SHORT NOMA OPN -
1119053F HDISK_RECAL ENDP -
180 PAGE
181 ; - - ---------------- ----------- - ------- - --- - - --- ----------
182 ; CONTROLLER RAM DIAGNOSTICS IAH = 012HI :
183
184
185 053F RAM DIAG PROC NEAR
186 053F C6 46 F8 EO - MOV CMD BLOCK+O,RAM DIAG CMD
181 0543 E8 OA J"P SHORT NOMA OPN -
188 0545 RAM_D I Ar::. ENOP -
189
190
1191 DR I VE 0 I AGNOSTI CS (AH = 013HI :
1192 ; ------ -- ---- ------ - ---------------- --------- ------ - -----
1193
1194 0545 CHK DRV PROC
11950545 C6 46 F8 E3 - MOV
1196 0549 E8 04 J"P
1191 0546 CHK_DRV ENOP
1198
1199 ; --- - -------- ------ --------------------------- ----------
1200 ; CONTROLLER INTERNAL DIAGNOSTICS {AH = 014Hl :
1201
1202
1203 0548 CNTLR DI AG PROC NEAR
1204 0548 C6 46 F8 E4 - MOV CMD BLOCK + 0 ,CNTLR 0 I AG CMO
1205 054F CNTLR_D I AG ENDP --
1206
1201 ; ------- -- ----- ------- ------ - --------- --------- ----- - ----
1208 ; SUPPORT ROUT! NES
1209
1210
1211054F NOMA OPN:
1212 054F BO 02 - MOV AL,02H
1213 0551 E8 057C R CALL COMMAND I S SUE THE COMMAND
1214 0554 72 22 JC Gil
1215 0556 EB 16 J"P SHORT G3
1216 0558 G8:
12110558 C6 06 0074 R 09 "OY
1218 0550 C3 RET
1219 055E OMA OPN:
1220 055E E8 06A5 R - CALL OMA SETUP SET UP FOR OMA OPERAT I ON
1221 0561 72 F5 JC G8 -
1222 0563 BO 03 "OY AL,03H
1223 0565 E8 051C R CALL COMMAND I SSUE THE COMMAND
1224 0568 12 OE JC Gil
1225 056A BO 03 "OY AL,03H
1226 056C E6 OA OUT DMA+l0,AL INITIALIZE THE DISK CHANNEL
1227 056E G3:
1228 056E FA CLI NO INTERRUPTS
1229 056F E4 21 IN AL,INTAOI READ THE MASK
1230 0511 24 OF AND AL,ODFH ENABLE IRQ-5
1231 0513 E6 21 OUT INTA01,AL WR I TE THE MASK OUT
1232 0515 E8 0700 R CALL WAIT_INT PROCEDURE DOES ST I
1233 0518 Gil:
1234 0518 E8 05AD R CALL ERROR_CHK SEE I F THERE I S AN ERROR
1235 051B C3 RET EXIT
1236
1237 ; --------- --------- ----------------- - -------------------
1238 ; COMMAND
1239 ; INPUT TH I S ROUT I NE OUTPUTS THE COMMAND BLOCK
1240
1241 AL = CONTROLLER DMA/INTERRUPT REGISTER MASK
1242
1243
1244
1245 051C COMMAND PROC NEAR
1246 051C E8 0160 R CALL PORT 0 GET THE BASE ADDRESS
1241 051F 42 INC OX -
1248 0580 42 INC OX ADDRESS PORT 2
12490581 EE OUT DX,AL I SSUE CONTROLLER SELECT PULSE
1250 0582 42 INC OX ADDRESS PORT 3
1251 0583 2B C9 SUB CX,CX WA IT COUNT
1252 0585 EE OUT DX,AL WRITE DMA MASK REGISTER
1253 0586 4A DEC OX
1254 0581 4A DEC OX ADDRESS PORT 1
1255 0588 WAIT BUSY:
1256 0588 EC - IN AL,DX READ THE HARDWARE STATUS
1251 0589 24 OF AND AL,OFH
1258 0586 3C 00 C"P AL,Rl BUSY OR RI BUS OR Rl REQ ; CHECK FOR BUSY,COMMAND
1259 0580 14 09 JE CI - - -; AND REQUEST BITS
1260 058F E2 F1 LOOP WA I T BUSY KEEP TRY I NG
1261 0591 C6 06 0014 R 80 "OY 01 SK::::STATUS, T I ME_OUT
1262 0596 F9 STC SET THE ERROR CONo I T I ON
1263 0597 C3 RET ERROR RETURN
1264 0598 CI:
1265 0598 B9 0006 "OY CX,6 SET FOR 6 BYTES OF COMMAND
1266 0598 4A DEC OX ADDRESS PORT 0
1261 059C 88 F5 "OY SI,BP SAVE THE BASE POINTER
1268 059E 83 ED 08 SUB BP,8 SET FIRST BYTE OF COMMAND BLOCK
1269 05AI FA CLI NO I NTERRUPTS I N COMMAND SEQUENCE
1210 05A2 CM3:
1271 05A2 8A 46 00 "OY AL, {BP] GET A COMMAND BYTE
1212 05A5 EE OUT DX,AL ALLOW AT LEAST 2us BETWEEN EACH BYTE
1213 05A6 45 INC BP ON SEND I NG THE COMMAND SEQUENCE.
1274 05A1 E2 F9 LOOP C"3 DO MORE
1215 05A9 88 EE "OY BP,SI RESTORE THE BASE POINTER
1216 05A8 F8 STI I NTERRUPTS BACK ON
1211 05AC C3 RET
1218 05AD COMMAND ENDP
1219 PAGE
1280
1281
:
;
-- - -- -- -- - -- - -- -- -- ----- - - -- --- --- - -- -- - - -- - --- - ---- ---
1282 ; SENSE STATUS BYTES
1283 ; BYTE 0
1284 ; BIT 1 ADDRESS VALID, WHEN SET
1285 ; B[T 6 SPARE, SET TO ZERO
1286 ; BITS 5-4 ERROR TYPE
1281 ; BITS 3-0 ERROR CODE
1288 ;
1289 ; BYTE 1
1290 BITS 7-6 ZERO
1291 ; 81T 5 DRIVE (0-1)
1292 ; B[TS 4-0 HEAD NUMBER
1293 ;
1294 ; BYTE 2
1295 ; 81TS 1-5 CYL! NDER HIGH
1296 ; BITS 4-0 SECTOR NUMBER
1291 ;
1298 ; BYTE 3
1299 ; B[TS 1-0 CYLI NOER LOW
1300 ;
1301 i - ---- - - ---------- ----- ----------- ----------------------
1302
1303 05AD ERROR CHK PROC NEAR
1304 05AD AO 0074 R - MOV AL,DISK STATUS ; CHECK IF THERE WAS AN ERROR
1305 0580 OA CO OR AL,AL - ; ANYTHING IN AL?
13060582 15 01 JNZ 021
1301 0584 C3 RET
1308
1309 .-------------- ---- --------------
t 31 0 ; PERFORM SENSE STATUS
1311
1312 SENSE STATUS CAN BE ISSUED MULTIPLE
1313 TIMES
13140585 G21 :
13150585 C6 46 F8 03 MDV CMD BLOCK+O, SENSE CMO
13160569 2A CO SUB AL,AL - WRITE ZERO IN INT/OMA MASK
13110568 E8 051C R CALL COMMAND [SSUE SENSE STATUS COMMAND
1318 058E 1226 JC 024 CANNOT RECOVER-EX I T WITH COMMAND
1319 ERROR
1320 05CO 28 FF SUB DI,OI SET [NDEX PO I NTER TO ZERO
1321 05C2 89 0004 MDV CX,4 READ FOUR BYTES
1322 05C5 84 DB MDV AH,OOOOIOIIB SET MASK FOR DATA MODE CARD TO CPU
1323 05C7 G22:
1324 05C1 E8 0680 R CALL HO WA I T GO WAIT FOR DATA INPUT STATE
1325 05CA 72 lA JC G24
1326 05CC 4A DEC OX ADDRESS PORT 0
1327 05CD EC IN AL,DX READ THE DATA BYTE
1328 05CE 88 43 F8 MDV [OI+CMD BLDCK],AL STORE AWAY SENSE BYTES
1329 0501 47 INC 01 - NEXT DATA LOCAT[ON
t 330 0502 E2 F3 LOOP 022 LOOP TILL ALL FOUR READ.
1331 0504 B4 OF MDV AH,OOOO! II IB SET THE MASK FOR STATUS MODE
1332 0506 E8 0680 R CALL HD WAIT GO WAIT FOR STATUS STATE
1333 0509 12 DB JC G24
1334 05DB 4A DEC OX ADDRESS PORT 0
1335 05DC EC IN AL,OX READ THE STATUS BYTE
1336 0500 A8 02 TEST AL,2 SENSE OPERATION FAIL?
1331 05DF 14 OF JZ STAT_ERR GO GET THE ERROR.
1338
1339 05E 1 C6 06 0074 R FF MDV DISK_STATUS. SENSE_FA I L SET SENSE OPERAT[ON FAIL
1340 05E6 G24:
1341 05E6 F9 STC
1342 05E7 C3 RET
1343 05E8 ERROR_CHK ENDP
1344
1345 05E8 061E R T_O OW TYPE 0 ERROR TYPE .JUMP T A8LE
1346 05EA 062B R OW TYPE-I
1341 05EC 0660 R OW TYPE-2
1348 OSEE 061A R ow TYPE::)
1349
1350 05FO STAT ERR:
1351 05FO 8A 5E F8 - MOV BL,CMD BLOCK+O GET ERROR BYTE
1352 05F3 8A C3 MDV AL,BL -
1353 05F5 24 OF AND AL,OFH
1354 05F7 80 E3 30 AND BL,00110000B ISOLATE THE TYPE OF ERROR
1355 05FA 2A FF SUB BH,BH
1356 05FC BI 03 MDV Cl,3
1351 05FE 03 EB SHR BX, CL ; AD.JUST
13580600 2E: FF A1 05E8 R JMP WORD PTR CS:{8X + OFFSET T_O)
1359
1360 0605 TYPEO TABLE LABEL BYTE
1361 0605 00 20 40 CC 80 00 - DB 0, BAD _ CNTLR ,BAD_SEEK, WR I TE_F AUL T , T [ME_OUT. 0 ,BAD_CNTLR
1362 20
1363 060C 00 40 DB o ,BAD SEEK
1364 = 0009 TYPEO_LEN EQU - S-TYPEO_TABLE
1365
1366 060E TYPE 1 TABLE LABEL BYTE
1361 060E 04 10 02 00 04 - DB RECORD NOT FND. BAD ECC, BAD ADDR MARK. 0, RECORD NOT FNO
1368061340 00 00 II DB DB BAD SEEK ,0-;-0 ,DATA C:ORRECTED,BAO-TRACK --
1369 = OOOA TYPE I_LEN EQU- S-TYPEI_TABLE -
1310
1371 0618 TYPE2 TABLE LABEL BYTE
1372 0618 01 02 01 - DB BAD CMO ,BAD ADDR MARK ,BAD CMD
1313 = 0003 TYPE2_LEN EQU- S-TYPE2_TABLE -
1374
1315 061B TYPE3 TABLE LABEL BYTE
- DB
1316 061B 20 20
1371= 0003 TYPE3_LEN ~~~_CNTL~~ ~~~E~~~~~L~AD _ ECC
1318 PAGE
1319 TYPE 0 ERROR
1380
1381 ablE
1382 ablE BB 0605 R MOV eX,OFFSET TYPED TABLE
1383 Ob21 3C 09 eMp AL,TYPEO LEN - CHECK I F ERROR I S OEF I NED
1384 0623 13 62 "AE UNDEF ERR L
1385 0625 2E: 01 XLAT CS:TYPEO TABLE T ABLE LOOKUP
! 386 Ob21 A2 0014 R MOV 01 SK_STATUS,AL SET ERROR CODE
1381 062A C3 RET
1388
1389 :------ TYPE I ERROR
t 390
1391 062B TYPE_l :
1392 Ob2B BB ObOE R MOV BX,OFFSET TYPE I_TABLE
1393 Ob2E 8B CB MOV CX,AX
1394 0630 3C OA eMP AL, TYPE 1 LEN CHECK I F ERROR IS OEF I NED
1395 0632
139b Ob34
13 53
2E: 01
"AE
XLAT
UNOEF ERR L
CS:TYPEI TABLE T ABLE LOOKUP
1391 Ob36 A2 0014 R MOV DISK STATUS,AL SET ERROR CODE
1398 0639 80 E 1 08 AND CL,OSH CORRECTED ECC
1399 063C 80 F9 OB eMP CL ,08H
1400 Ob3F 15 29 "NZ G30
140 I
1402 OBTAIN ECC ERROR BURST LENGTH
1403
1404 0641 C6 46 F8 00 MOV ~~~ A~LOCK + 0 ,RD _ ECC _ CMO
1405 Ob45 2A CO SUB
1406 0641 E8 051C R CALL COMMAND I SSUE THE COMMAND
1401 064A 12 IE X G30
1408 064C B4 OB MOV AH,OOOOI01IB SET MASK FOR DATA INPUT CARD TO CPU
1409 Ob4E E8 06BO R CALL HD WAI T GO WAIT FOR THE INPUT STATE
1410 0651
1411 0653
12
4A
17 "e
DEC
GiO
OX ADDRESS PORT 0
1412 Ob54 EC IN AL,OX READ THE LENGTH OF THE ERROR
1413 0655 8A C8 MOV CL,AL CORRECTED AND SAVE IN CL
1414 0657 B4 OF MOV AH,OOOOIIIIB SET MASK FOR STATUS STATE
14150659 E8 0680 R CALL HD WAI T GO WAIT FOR STATUS STATE
1416 065C
1417 Ob5£
72
4A
OC "e
DEC
G30
OX ADDRESS PORT 0
1418 065F £C IN AL.DX READ THE STATUS BYTE
14190660 A8 02 TEST AL,2 ERROR BIT SEn
1420 0662
1421 0664
14
C6
Ob
06 0074 R 20
"Z
MOV
G30
01 SK_ST ATUS, BAD_CNTLR
1422 Ob69 F9 STG
1423 066A G30 :
1424 066A 8A Cl MOV AL,CL
1425 066C C3 RET
1426
1427 TYPE 2 ERROR
1428
1429 0660
1430 0660 BB 0618 R MOV BX, OFFSET TYPE2 TABLE
1431 Ob70 3C 03 eMp AL. TYPE2 LEN - CHECK I F ERROR I S DEF I NED
1432 0672 13 13 "AE UNDEF ERR L
1433 0674 2£: 07 XLAT CS :TYPE2 TABLE TABLE LOOKUP
1434 0676 A2 0074 R "OV DISK_STATUS,AL SET ERROR CODE
1435 0679 C3 RET
1436
1437 TYPE 3 ERROR
143B
1439 061A
1440 067A BB 061B R MOV BX, OFFSET TYPE3 TABLE
1441 0670 3C 03 eMp AL, TYPE3 LEN - CHECK I F ERROR I S OEF I NED
1442 067F 13 06 "AE UNDEF ERR L
1443 0681 2E: 07 XLAT CS: TYPE3 TABLE T ABLE LOOKUP
1444 0683 A2 0074 R "OV 01 SK_STATUS,AL SET ERROR CODE
1445 0686 C3 RET
1446
1447 0687 UNDEF ERR L:
1448 Ob87 C6 Ob 0074 R BB - MOV DISK_STATUS, UNDEF _ERR
1449 068C C3 RET
1450
1451 .- - - - - -- - - - - - - -- - - - - -- - - - - -- - - - - - - --
- - -
1452 ; ON ENTRY AH CONTA I NS THE CONTROLLER BUS STATUS DECODE :
1453
1454 .; - MASK USED TO CHECK THE HARDWARE STATUS. :
- - - - - - - -- - - - - - - - -- - - - -- - - - -- - - - - -- - - - - - - - - -- -- - - - - - ---
-
1455 Ob80 HD_WAIT PROC NEAR
1456 0680 51 PUSH CX SAVE CX
1451 068E 2B C9 SUB CX, CX SET THE LOOP COUNT
1458 0690
1459 0690 E8 0760 R CALL PORT 0
1460 0693 42 INC OX - PORT 1 ADDRESS
1461 0694 £C IN AL,DX READ-THE HARDWARE STATUS
1462 0695 24 OF AND AL,OOOOIIIIB CLEAR UPPER NIBBLE OF HARDWARE STATUS
1463 0697 3A C4 eMp AL,AH CHECK THE STATE WITH THE MASK
1464 0699
\ 465 069B
74
E2
08
F3
"Z
LOOP
L2
LI
.)MP t F o. K Wt TH CARRY CLEARED
TRY AGAIN
1466 0690 C6 06 0074 R 80 "OV o t SK_ST ATUS. T I ME_OUT
1467 06A2 F9 STe SET ERROR CONO I T I ON
1468 06A3 L2:
1469 06A3 59 ex RESTORE CX
1470 06A4 C3
1471 06A5
1472 PAGE
1413 ; -------------- -----------------------------
1474 DMA SETUP
1475 ; - THIS ROUTfNE SETS UP FOR DMA OPERATIONS.
1476 INPUT
1477 (ALl =
MODE BYTE FOR THE DMA
1478 (ES:BX) =
ADDRESS TO READ/WRITE THE DATA
1479 OUTPUT
1480 ; (AX' DESTROYED
148 I ; ----------- - -------------------------------------------
1482
1483 06A5 DMA SETUP PROC NEAR
1484 06A5 80 7E FC 81 - CMP CMO BLOCK +4,81 H BLOCK COUNT OUT OF RANGE
1485 06A9 72 02 JB JI -
1486
1487 06AB F9 STC SET THE ERROR COND I T I ON
1488 06AC C3 RET
1489
1490 D6AD ,)1:
1491 06AD FA CLI NO MORE INTERRUPTS
1492 D6AE E6 DC OUT DMA+12,AL SET THE FIRSTfLAST FIF
1493 06BO BI 04 MOY CL,4 SH 1FT COUNT
1494 0682 E6 08 OUT OMA+ I I,AL OUTPUT THE MODE 8YTE
1495 0684 8C CO MOY AX,ES GET THE ES VALUE
1496 D6B6 D3 CO ROL AX,CL ROTATE LEFT
1497 06B8 8A E8 MOY CH,AL GET HIGHEST NIBBLE OF ES TO CH
1498 068A 24 FO AND AL,OFOH ZERO THE LOW NIBBLE FROM SEGMENT
1499 D6BC 03 C3 ADD AX,BX TEST FOR CARRY FROM ADD I T I ON
1500 D6BE 80 05 00 AOC CH,O CARRY MEANS HIGH 4 B[TS MUST BE [NC
1501
1502 06CI 88 FO MDY S[ ,AX SAVE START ADDRESS
1503 06C3 E6 06 OUT DMA+6,AL OUTPUT LOW ADDRESS
1504 06C5 8A C4 MOY AL,AH
1505 06C7 E6 06 OUT DMA+6,AL OUTPUT HIGH ADDRESS
1506 06C9 8A C5 MOY AL,CH GET HIGH 4 BITS
1507 06CS 24 OF AND AL,OFH
1508 06CO E6 82 OUT DMA_HIGH,AL OUTPUT THE HIGH 4 BITS TO PAGE REG
1509
1510 ;------ DETERMINE COUNT
1511
1512 06CF 8A 66 FC MOY AH,CMD BLOCK+4 RECOVER BLOCK COUNT
t 513 0602 DO E4 SHL AH, I - , MULTIPLY BY 512 BYTES PER SECTOR
1514 0604 32 CO XOR AL,AL ; CLEAR LOW BYTE
1515060648 DEC AX AND DECREMENT VALUE BY ONE
t 516
1517 HANDLE READ AND WRITE LONG (5160 BYTE BLOCKS)
1518
15190607 80 7E F8 E5 CMP CMD BLDCK+O,RD LONG CMD
1520 06DB 74 06 JE ADD4 --
1521
1522 0600 80 7E F8 E6 CMP
1523 06El 75 OF JNE
1524 06E3 ADD4:
1525 06E3 88 0204 MOY AX,516D ONE BLOCK (512) PLUS 4 BYTES ECC
1526 06E6 53 PUSH BX
1527 06E7 2A FF SUB BH,8H
1528 06E9 8A 5E FC MOY BL,CMD BLOCK+4
1529 D6EC 52 PUSH OX -
1530 D6ED F7 E3 MUL BX BLOCK COUNT TIMES 516
1531 06EF 5A POP OX
1532 06FO 58 POP BX
1533 D6FI 48 DEC AX ADJUST
1534 06F2 ,)20:
1535 06F2 86 C8 MOY CX,AX SAVE COUNT VALUE
1536 06F4 E6 07 OUT OMA+7,AL LOW BYTE OF COUNT
1537 OoF6 8A C4 MOY AL,AH
1538 06F8 E6 07 OUT DMA+7,AL HIGH BYTE OF COUNT
1539 06FA F8 ST I INTERRUPT 5 BACK ON
1540 06FB 88 C6 MOY AX,51 RECOVER ADDRESS VALUE
1541 06FD 03 Cl ADO AX,CX ADD, TEST FOR 64K OVERFLOW
1542 06FF C3 RET RETURN TO CALLER,
1543 CY SET BY ABOVE I F ERROR
1544 0700 DMA_SETUP ENDP
1545
1546
1541
:
PAGE
-;~ ~ ~-~~~--- - - - -- -- ---- -----------
1548 ; - THIS ROUTINE WAITS FOR THE FIXED DISK
1549 ; CONTROLLER TO SIGNAL THAT AN INTERRUPT
1550 ; HA S OCCURRED.
155 I
1552
1553 0700 WAIT INT PROC NEAR
1554 - ASSUME DS:ABSO
1555 0700 FB STI TURN ON INTERRUPTS
1556 0101 8C DB MO' BX,DS SAVE OS
1551 0103 2B CO SUB AX,AX
1558 0705 8E 08 MO' OS,AX EST ABL I SH SEGMENT
1559 0701 C4 36 0104 R LES SI,HF_TBL_VEC LOAD THE TABLE VECTOR
1560
1561 ASSUME OS: DATA, ES: NOTH I NG
1562 070B 8E DB MO' DS,BX RESTORE OS
1563
1564 ; -- SET TIMEOUT VALUES
1565
1566 0700 2A FF SUB SH,BH
1561 010F 26: 8A 5C 09 MO' BL ,BYTE PTR ES: [S[] (9) LOAD THE STANDARD T I ME OUT
1568 0113 8A 66 F8 MO' AH,CMD BLOCK+O
1569 0716 80 FC 04 eMP AH,FMTDRV_CMD
1510 0719 15 06 JNZ 05
1511
1512 071B 26: 8A 5C OA MO' BL,BYTE PTR ES:[S[)[OAH] LOAD THE FORMAT DR I VE
1513 071F EB 09 JMP SHORT O. T[ME OUT VALUE
15740721 80 FC E3 W5: CMP AH,CHK_DRV_CMD
1575 0724 75 04 JNZ O.
1576
1577 0726 26: 8A 5C OB MO' BL,BYTE PTR ES:[SI)[OBH) ; LOAD THE CHECK DR I VE
1578 07211. W4: CLEAR ~Y Tl ME OUT VALUE
1579 072A F8 eLC
1580 072B B8 9000 MO' AX,9000H DEV I CE WA I T INTERRUPT
1581 072E CO 15 INT 15H
1582 0730 FB ST I ENABLE [NTERRUPTS FOR PC AND
1583 XT MACH I NES.
1584 0131 2B C9 SUB CX,CX SET THE LOOP COUNT
1585
1586 WA [T FOR 1NTERRUPT
1587
1588 0733 WI:
1589 0733 E8 0160 R CALL PORT 0
1590 0736 42 INC ox - PORT I ADDRESS
1591 0131 EC IN AL,OX READ-THE HARDWARE STATUS
1592 0138 11.8 20 TEST AL,020H 0[0 I NTERRUPT OCCUR
1593 07311. 15 Oil. JNZ 02 .JUMP [F YES
1594
1595 013C E2 F5 LOOP 01 INNER LOOP
1596 013E 4B DEC BX
1591 073F 75 F2 JNZ 01 OUTER LOOP
1598
1599 0741 C6 06 0074 R 80 MOV DISK STATUS,TIME_OUT
1600 0746 W2:
1601 0746 411. DEC ox ADDRESS PORT 0
1602 0747 EC IN AL,DX READ THE STATUS BYTE
1603 0748 24 02 AND AL,2 ISOLATE THE ERROR B[T
1604 074A 08 06 0074 R OR DISK STATUS,AL SAVE I N THE STATUS
1605 074E 83 C2 03 ADO DX,3- PORT 3 ADDRESS
1606 0151 32 CO XOR AL,AL ZERO-
1607 0753 EE OUT OX,AL RESET I NTERRUPT MASK
1608 0754 C3 RET
1609
1610 0755 ENDP
1611
1612 ;--- HD INT
1613
1614 FIXED DISK INTERRUPT ODH ROUTINE IRQ-5
1615
1616
1617
1618 0155 PRoe NEAR
16190755 50 PUSH AX SAVE WORK REGISTER
1620 0156 BO 01 MOV AL,07H SET OMA MODE TO 0 I SABLE
1621 0158 E6 OA OUT DMA+IO,AL
1622 01511. FA eLi NO INTERRUPTS
1623 075B E4 21 IN AL,INTAOI LOAD THE I NTERRUPT ENABLE MASK
1624 0150 OC 20 OR AL,020H TURN OFF FIXED DISK IRQ-5
1625 015F E6 21 OUT INTAOI,AL REPLACE THE MA SK
1626 0761 BO 20 MOV AL,EOI LOAD THE END OF INTERRUPT MASK
1627 0763 E6 20 OUT [NTAOO,AL CLEAR THE ACT [VE I NTERRUPT LEVEL
1628 0165 FB STI I NTERRUPTS BACK ON
1629076688 9100 MOV AX,9100H DEV ICE POST
1630 0169 CO 15 INT 15H INTERRUPT
1631 016B 58 POP AX RESTORE AX
1632 016C CF IRET
16330160 ENDP
1634
1635
1636
: -~~~~~---------------- - -------- ---------
1631 GENERATE PROPER PORT VALUE
1638 BASED ON THE PORT OFFSET
1639
1640
1641 0160 PORT_O PROe NEAR
1642 0760 BA 0320 MOV OX,HF PORT BASE VALUE
1643 0170 02 16 0011 R ADO OL,PORT_OFF ADD [N OFFSET VALUE (00,04,08,OC)
1644 0174 C3 RET
1645 0175 PORT_O ENOP
1646
1647 0775 END ADDRESS LABEL BYTE
1648 0175 CODE ENDS
1649 END
~
addresses, port 14 fixed disk controller 1
fixed disk drive types 3
[!J
BIOS listings 23
block diagram 2 interface 15
interface signals
AEN 15
AO-AI9 15
-DACK 3 16
DO-D7 15
command summary 10 DRQ 3 15
connectors 17 -lOR 15
control byte 8 -lOW 15
controller, fixed disk 1 IRQ 5 15
RESET 15
[EJ
data register 7
description 1 logic diagrams 19
[!]
error tables 5