home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
misc_programming
/
disk.doc
< prev
next >
Wrap
Text File
|
1990-01-11
|
14KB
|
524 lines
Fixed Disk System Trainning Course
1. Introduction
1.1 Basic Function of Disk Controller
1.2 Disk Interface Standard
A. ST-506/412 Winchester
B. Enhanced Small Device Interface(ESDI)
C. Storage Module Device(SMD)
D. Enhanced SMD
E. Small Computer Systems Interface(SCSI)
F. Intelligent Peripheral Interface(IPI)
G. AT-Bus
1.3 Coding
A. Frequency Modulation(FM)
B. Modified Frequency MOdulation(MFM)
C. Run Length Limited(RLL)
D. Group Code Recording(GCR)
E. Zone Bit Recording(ZBR)*
1.4 Data Format
1.5 Sector Interleaving
1.6 Disk Formatting
A. Physical Format
B. Partitioning
C. Logical Format
1.7 Translative Versus Non-Translative Mode
2. Winchester Disk Controller
2.1 System Configuration for Fixed Disk System
3. Programming Sequence in Fixed Disk Service Program
4. Q & A
1. Introduction
1.1 Basic Function of a Disk Controller
1. Write data to the disk
2. Read data from the disk
3. Serialize and de-serialize data
4. Control the disk drive(option)
5. Ensure data integrity
6. Provide reasonable system interface(option)
7. Buffer data to/from disk
1.2 Disk Interface Standard
│
High │
│
│
│ . IPI
│
│ . SMD . ESMD
│
│ . SCSI
COST │ . ESDI
│
│
│
│ . ST-412HP
│
│ . ST-506/412 . AT Bus
│
Low │ . 3.5 Floppy
│
└───────────────────────────────────────────────────────>
Low High
PERFORMANCE
Fig 1 : Fixed Disk Interface Versus Market
A. ST-506 412 Winchester Interface
1. Industry standard since 1981
2. Low capacity Winchester(5 - 150 Mbytes)
3. small size
4. Serial data transfer rate of 5 Mbits/second
5. Cost(not performance) oriented
6. Simple disk interface(most effort is in the disk controller)
B. Enhanced Small Device Interface(ESDI)
1. Substantial upgrade to ST-506/412 interface
2. Oriented towards high-capacity, high speed small winchesters
3. Also capable of handling magnetic tapes and optical disks
4. Serial transfer rate 10 Mbits/second
5. Controller complexity simpler
C. Storage Module Device(SMD)
D. Enhanced SMD
E. Small Computer Systems Interface(SCSI)
1. ANSI defined intelligent, low-cost peripheral interface
2. Derived from SASI(Shgart Assoc. Systems Interface)
3. 8-bit parallel data transfer, 1.5 to 4 Mbytes/second
4. Provides device independent software
5. Function more as a computer interface than a disk interface
6. Requires lots of intelligence in the peripheral
F. Intelligent Peripheral Interface(IPI)
G. AT-Bus
1. Cost dowm
2. Data transfer rate
3. An I/O slot more for another add on card
4. The fixed disk controller is no longer required
1.3 Coding
There are 4 different ways of improving the storage capacity of
disk drives:
1) Added more platters
2) Added more tracks per platter
3) Increase BPI(Bit Per Inch)
4) Use better encoding methods
For method 1, it will increase manufacture cost for extra platter
and extra read/write head set.
For method 2, it will increase control logic complexity for write
current precompensation and interfere.
For method 3, it will use better read/write set to shorten the
length between read/write head and platter.
For method 4, it will increase the encoding/decoding complexity.
A. Frequency Modulation(FM)
1 bit cell
│<----->│
┌───────┐ ┌───────┐ ┌───────┐
│ 1 │ 0 │ 1 │ 0 0 0 │ 1 │ 0
NRZ Data ──┘ └───────┘ └───────────────────────┘ └────
c d c c d c c c c d c
┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
FM Data ──┘ └─┘ └─┘ └─────┘ └─┘ └─┘ └─────┘ └─────┘ └─────┘ └─┘ └─┘ └─
┌───┐ ┌───────┐ ┌───┐ ┌───────┐ ┌───┐ ┌───
Disk Flux │ │ │ │ │ │ │ │ │ │ │
Transitions ──┘ └───┘ └───┘ └───────┘ └───────┘ └───┘
FM Encoding Rules :
1. Insert clock pulse for each bit cell
2. Insert data pulse when NRZ data is "1"
B. Modified Frequency Modulation(MFM)
1 bit cell
│<----->│
┌───────┐ ┌───────┐ ┌───────┐
│ 1 │ 0 │ 1 │ 0 0 0 │ 1 │ 0
NRZ Data ──┘ └───────┘ └───────────────────────┘ └────
┌─┐ ┌─┐
│ │ │ │
Clock ──────────────────────────────────┘ └─────┘ └──────────────
┌─┐ ┌─┐ ┌─┐
│ │ │ │ │ │
Data ──────┘ └─────────────┘ └─────────────────────────────┘ └────
d d c c d
┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐
│ │ │ │ │ │ │ │ │ │
MFM Data ──────┘ └─────────────┘ └─────────┘ └─────┘ └─────────┘ └────
┌───────────────┐ ┌───────┐ ┌─────
Disk Flux │ │ │ │ │
Transitions ──────┘ └───────────┘ └───────────┘
MFM Encoding Rules :
1. Insert clock in pulse at the beginning of a bit cell only
if NRZ data = 0 for two consecutive bits
2. If data bit = 1, insert data pulse in the middle of the bit
cell.
3. If data bit = 0, no insertion of data pulses in the bit cell
C. Run Length Limited(RLL)
RLL 2,7 Encoding Rules :
According to following table to encoding/decoding :
┌─────────┬────┬────┬──────┬──────┬────────┬────────┬────────┐
│ NRZ Data│10 │11 │000 │010 │011 │0010 │0011 │
├─────────┼────┼────┼──────┼──────┼────────┼────────┼────────┤
│ RLL 2,7 │1000│0100│100100│001000│000100 │00001000│00100100│
└─────────┴────┴────┴──────┴──────┴────────┴────────┴────────┘
D. Group Code Recording(GCR)
4,5 GCR Encoding Rules :
According to following table to encoding/decoding :
┌─────────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ NRZ Data│0000 │000 1│0010 │0011 │0100 │0101 │0110 │0111 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ 4,5 GCR │11001│11011│10010│10011│11101│10101│10110│10111│
└─────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
┌─────────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ NRZ Data│1000 │1001 │1010 │1011 │1100 │1101 │1110 │1111 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ 4,5 GCR │11010│01001│01010│01011│11110│01101│01110│01111│
└─────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
E. Zone Bit Recording(ZBR)
According to track no, the fixed disk drive is divided into serval
zones. The tracks in the same zone have the same format, but the tracks
in different zone may have different format.
1.4 Data Format
┌─┐ ┌─┐
│ │ │ │
Index ─┘ └──────────────────────────────────────────────────────────┘ └────
┌───────────┬──────┬──────┬────────────────┬──────┬──────┬─────┐
│Index delay│Sector│Sector│ . . . . │Sector│Sector│Final│
│ Field │ 0 │ 1 │ . . . . │ N-1 │ N │ Gap │
└───────────┴──────┴──────┴────────────────┴──────┴──────┴─────┘
│ │
┌───────────┘ └─────────────────────────────────────────────┐
┌───────────┬───────┬────────┬───┬───────────┬──────┬────────────┐
│Preamble 1 │Address│ I.D. │EDC│Postamble 1│Sector│Inter sector│
│(Synch 1) │ Mark │(Header)│ECC│ │Data │ Gap │
└───────────┴───────┴────────┴───┴───────────┴──────┴────────────┘
│ │ │ │
┌───────────────────┘ └─────┐ │ │
┌─────┬─────┬─────┬────┬──────┬────┐ │ │
│ID AM│Track│Track│Head│Sector│ ID │ │ │
│ │(MSD)│(LSD)│ # │ # │Flag│ │ │
└─────┴─────┴─────┴────┴──────┴────┘ │ │
│ │
│ │
┌───────────────────────────┘ └────────────┐
┌───────────┬───────┬────┬──────┬───┬───────────┐
│Preamble 2 │Address│Data│ Data │EDC│Postamble 2│
│(Synch 2) │ Mark │Mark│Record│ECC│ │
└───────────┴───────┴────┴──────┴───┴───────────┘
1.5 Sector Interleaving
The initial formatting of a disk determines where sectors are
located within a track. It is not necessary to allocate sectors
sequentially around the track. The Technique known as sector inter-
leaving optimizes access times when, although sectors are accessed
sequentially, a small amount of processing must be performed between
sector read/write.
interleave factor = 3
interleave factor = 2
1.6 Disk Formatting
A. Physical Format(initialization)
Initializes the fixed disk with sectors and address so that
data can be access
B. Partitioning
Assign a partical amount of disk space to DOS
C. Logical Format
Verify that the initialization of fixed disk drive was
successfully completed
1.7 Translative Versus Non-Translative Mode
Owing to using advanced technique, the new WDD contain more
cylinders, more heads, and more sectors in a track. But due to
DOS limitation, some DOS software can't access the extra disk
space. So some WDD manufacturer support "Translative mode" to
translate the extra disk space into DOS disk space.
Example 1 :
Assume WDD have 1033 cylinders, 2 heads, 33 sectors/track in
non-translative mode, but it can have 1002 cylinders, 4 heads, and
17 sectors/track in translative mode.
1033 * 2 * 33 = 68178 sectors/drive in non-translative mode
1002 * 4 * 17 = 68136 sectors/drive in translative mode
So it will loss 42 sectors in translative mode.
2. Winchester Disk Controller
2.1 System Configuration for Fixed Disk System
┌────────┐
┌────────────┤ │<───────────┐
│ │ 8259A │ │
│ ┌───>│ │ │
│ │ └────────┘ │ ┌────────┐
│ ┌─────┴──┐ ┌───┴────┐ ┌---->│ WDD 0 │
│ │ CPU ├──────────────────>│ │<─────|──┬─>│ │
│ │ INT 13H│<----┬-------------│ WDC │ | │ └────────┘
│ │ -------│ | │ │<-----| │ ┌────────┐
└>│ INT 0EH│ | └────────┘ | └─>│ WDD 1 │
└────────┘ | ^ └---->│ │
| | └────────┘
| |
┌───┴────┐ |
│ DRAM │<-----------┘
└────────┘
Command/Control ────────
Data/Status --------
Fig : System Configuration for Fixed Disk System
3. Programming Sequence in Fixed Disk Service Program
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;Module_Name: read_sector_hd
;Calling Sequence:
;
; Input : AH = 02h
; AH(in stack) = no_error
; DL = drive no.(not value check)
; DH = head no.
; CH = cylinder low
; CL = bit 7-6 -- cylinder high
; bit 5-0 -- sector no.(1 base)
; AL = no. of sectors to be read
; output : AH(in stack) = status of operation
;
;PDL: IF WDC valid THEN
; prepare task file
; IF WDC ready THEN
; write READ command to WDC
; ENDIF
; IF interrupt occurred THEN
; read one sector from data register
; get result back
; ELSE
; ELSE
; return error code = 01H(invalid function call)
; ENDIF
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
page
f02_00: ; check valid_WDC
call valid_wdc ; check valid_wdc
jc f02_60 ; goto f02_40 if error occurred
; send read command block to WDC
call write_data ; Send command
mov ah, 021h ; BX = 021h for read command
call out_com ; out command byte to WDC
jc f02_60 ; goto f02_60 if WDC not ready
mov di, [bp-4] ; DI = offset of transfer address
call wait_drq ;
jc f02_60 ;
f02_20: ; wait DRQ and test 64K boundary
cmp di, 0fe00h ; if in 64K boundary
jb f02_30 ; goto f02_30 if no boundary error
mov ax, es ;
add ax, 20h ;
mov es, ax ; adjust ES
sub di, 200h ; adjust DI
f02_30:
call wait_int ; wait_interrupt
jc f02_60 ; goto f02_60 if time out
mov dx, hd_port0 ; data register
mov cx, 100h ; count = 256 words
cld ;
cli ;
rep insw ;
sti ;
; get result back
call get_result ; get result byte into AL
jc f02_60 ;
dec byte ptr [bp-2] ;
jnz f02_20 ;
f02_60:
jmp disk_end
4. Q & A