Abstract:
A dual mode disk controller is disclosed for use between a host processor and its storage medium for controlling data transfer to and from the storage medium. The data is formatted on the medium in two distinct formats, one capable of bulk fast transfers useful in a swapping operation, and the other capable of periodic slower transfers as is acceptable for file retrieval. The disk controller is designed having a small fast buffer memory for accepting information from the storage medium. File transfer data is transferred immediately without host CPU intervention, to a larger cache memory. The host CPU accesses the fast buffer memory periodically to retrieve swap transfer data while only accessing the larger cache memory when it needs to retrieve the file formatted information.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to computer system disk access control and more particularly to such systems where both swapping and file access capability is desired from a single disk drive (actuator). 
     In disk systems it is typical that the disk can transfer data faster than large dynamic memories can store it, especially when the memory is also used for execution by a host CPU. Thus, for fast bulk transfers where the maximum transfer rate is required, such as occur during swapping operations, the performane of the CPU is impacted. 
     For some disk transfers, however, where fast transfer rates are not imperative, it is desirable to transfer data from the disk to the host CPU memory without host CPU intervention thus enabling the CPU to execute instructions faster. Thus, in prior systems it has become customary to use two disk drives (actuators), one arranged in an efficient format for bulk transfers at a high transfer rate and the other arranged in a different format efficient to transfer disk data without host CPU intervention at a lower transfer rate. These prior arrangements have the disadvantage of requiring two disk drives (actuators), even when the system would not otherwise require such duplication. 
     The use of two disk drives, however, allows the user to physically separate the &#34;file&#34; area (lower transfer rate) from the &#34;swap&#34; area (higher transfer rate), thereby allowing file accesses and swaps to be overlapped. For example, if only one disk drive is used, a swap cannot take place until a file access on that drive is completed. With two disk drives, on the other hand, on disk can be transferring data while the head of the other disk is being positioned to the desired location, thus reducing the head positioning delay. 
     In small systems, where both low cost and high performance are imperative, two disk drives and a separate direct memory access (DMA) controller would raise the cost to an unacceptable level. Accordingly, a one disk solution where both types of transfers can occur economically is needed. 
     SUMMARY OF THE INVENTION 
     We have designed a dual mode disk controller which allows one disk drive to be formatted in different physical sections in the manner best suited for the type of information stored in that section. 
     During a &#34;swap&#34; read operation from the disk drive, the data from the bulk transfer (swapping) section is read into a small fast buffer memory by the I/O processor and the host CPU, cycle by cycle, then removes the retrieved data from the buffer and moves it to the CPU main memory. During a &#34;swap&#34; write operation to the disk drive, the data to be written into the swap section is written into the small buffer memory by the host CPU, cycle by cycle, and the transferred to the disk drive by the I/O processor. 
     During a &#34;file&#34; read operation from the disk drive, the data from the file storage section is first read into the buffer memory by the I/O processor and then transferred to a larger slower cache memory also by the I/O processor for retrieval or use by the host CPU when host CPU time is available. During a &#34;file&#34; write operation to the disk drive, the host CPU transfer the data to be written to the disk into the slow cache memory when CPU time is available. Then the I/O processor transfers that data from the slow cache into the fast buffer memory and then out to the disk. 
     The key to achieving high performance using one disk drive lies in the physical formatting. The disk controller logically separates the disk into two sections: a &#34;file&#34; area, and a &#34;swap&#34; area. 
     The &#34;file&#34; area transfers data at a slower rate than the &#34;swap&#34; area, but intervention by the host CPU is not required to transfer the data to/from the disk. Hence, the CPU is free to perform other tasks while the disk controller handles the data transfer, thus increasing performance for normal file accesses. 
     On the other hand, the &#34;swap&#34; area yields a higher data transfer rate, but intervention is required by the host CPU to transfer the data to/from the disk. This is needed in cases where the CPU has to immediately perform a context switch and requires the highest data transfer rate possible to minimize the context switch time. 
     The &#34;file&#34; area is physically formatted by the I/O processor with a 3:1 interleave, and the &#34;swap&#34; area is physically formatted by the I/O processor with a 2:1 interleave. Therefore, given a disk with a 1M byte/second raw data transfer rate, the &#34;file&#34; area can yield a multiple sector data transfer rate of 333K bytes/second (1/3 of the raw rate), and the &#34;swap&#34; area can yield a multiple sector rate of 500K bytes/second (1/2 of the raw rate). 
    
    
     DESCRIPTION OF DRAWING 
     These and other objects and features will become more apparent from a review of the drawing showing one embodiment of our invention in which: 
     FIG. 1 is a block diagram showing the interrelationship of the elements of the invention, 
     FIGS. 2, 3 and 5 show the physical layout of data on one track of the disk, 
     FIGS. 4 and 6 show disk timing diagrams of the &#34;file&#34; and &#34;swap&#34; transfers, 
     FIGS. 7 and 8 show flow charts of the operation of the data retrieval and data storage procedures of our invention, and 
     FIGS. 9 and 10 show memory tables used by the I/O processor for formatting the disk. 
    
    
     DETAILED DESCRIPTION 
     Shown in FIG. 1 is a block diagram of the dual mode disk controller 100. Input/Output processor 12, by way of example, can consist of an Intel 8089 I/O Processor Chip Set. Program store 101 consists of 8K bytes of program ROM, dual ported buffer 106 consists of 1K byte of dual ported static buffer RAM, while dual ported cache 107 consists of 128K bytes of dual ported dynamic cache RAM. Also connected to bus 10 are Read/Write Control Sequencer 102, serial to parallel/parallel to serial converter 104, and burst error correction/detection circuit 103. Host CPU 14 can be, for example, an Intel 8086 or a Motorola 68000 chip. Main memory 108 is used by the CPU for storing instructions and data for execution and, for example, can be 128K bytes of dynamic RAM. 
     FIG. 2 shows a packing technique for storing blocks of data on one track of a disk. Shown is a 1 to 1 interleaving format having 23 sectors following physically from 0 and going consecutively one block at a time to block 22. While only one track is shown, a disk contains many such tracks and head 51 moves in and out to retrieve data from any track. 
     FIG. 5 shows a 2 to 1 interleaving where to logically contiguous blocks of data are separated by a physical block having a nonsequential address. Thus, as the sectors pass under disk drive head 51 (held by arm 50) moving counterclockwise, the data in block 12 would come before the data from block 1. For example, if the data sample to be stored were to be larger than a single data block then the data, instead of being stored in adjacent blocks, as would be in the case in 1 to 1 interleaving, would be stored in blocks 0 and 1 separated by another data block, namely data block 12. The reason for this type of interleaving is derived from timing considerations and head movement time and will be discussed in more detail hereinafter. 
     FIG. 3 shows a 3 to 1 interleaving where consecutively numbered (logically contiguous) blocks are separated by two non-sequential logically non-contiguous data blocks. 
     SECTOR CREATION AND CONTROL 
     Every sector on the disk has a data field and a header field. The sector number of a particular sector is written into its header field by the I/O processor during formatting to enable the I/O processor to properly identify that sector during an access operation. The disk drive supplies two signals to the dual mode disk controller: (1) a sector signal, and (2) an index signal. When dual mode disk controller 100 receives a pulse on the INDEX line (not shown), this indicates the beginning of a track. A pulse on the SECTOR line (not shown) indicates the beginning of each individual sector within that track. 
     Using the SECTOR and INDEX lines, and knowing the desired interleave factor, i.e., 2:1 or 3:1 or any other factor, the I/O processor can write the appropriate sector number into the header field of a sector using tables stored in program memory 101. The tables, shown in FIGS. 9 and 10, correlates a particular sector/index pulse to a particular sector number. 
     When formatting disk drives having only one data surface, dual mode disk controller 100 formats one half of the tracks with a 2:1 interleave factor and the other half with a 3:1 interleave factor. When formatting disk drives with more than one data surface, dual mode disk controller 100 formats one half of the surfaces with a 2:1 interleave and the other half with a 3:1 interleave. 
     DATA TRANSFER 
     Two disk data transfer scenarios follow: a &#34;file&#34; transfer, and a &#34;swap&#34; transfer. Both scenarios described are read operations and will be described with respect to the flow charts in FIGS. 7 and 8. Write operations are essentially the same, but in reverse sequence. 
     FILE TRANSFER 
     As shown in FIG. 7, for a &#34;file&#34; data transfer, the following actions occur: 
     In step 70 serial disk data enters serial parallel converter 104 from a numbered disk data block (say block 0) and is converted to 16 bit parallel data. In step 71 after each 16 bit word is assembled by converter 104, it is transferred over bus 10 by I/O processor 12 to dual ported buffer 106 which, as discussed priorly, is a high speed RAM. After the entire block of data is assembled in dual ported buffer 106 (step 72), it is transferred through I/O processor 12 into dual ported cache 107 (step 73). 
     If the next logically contiguous data block is required (step 74) I/O processor 12 prepares for the transfer of that block (step 75) and the whole sequence is repeated. If not, the host CPU is informed that the data transfer is completed. 
     SWAP TRANSFER 
     For a &#34;swap&#34; data transfer, as shown in FIG. 8, the following actions occur: Steps 80, 81 and 82 are the same as steps 70, 71 and 72. After the whole block of data is assembled in dual ported buffer 106, the host CPU is interrupted (step 83) and the host CPU transfers the data out of dual ported buffer 106 (step 84) to its main memory while I/O processor 12 is preparing (step 85) for the transfer of the next logically contiguous data block from the disk (if one is required). 
     From the above scenarios, it can be seen that &#34;file&#34; transfer (FIG. 7) requires I/O processor 12 to perform an additional data block transfer (step 73) to the dual ported cache. Because of this extra transfer, a 3:1 interleave is required to provide the I/O processor enough time to prepare for the transfer of the next logically contiguous data block from the disk, if one is required. Since the I/O processor performs the data transfer to the dual ported cache, the host CPU can perform other tasks while the transfer is taking place, thereby increasing overall system performance. 
     TIMING CONSIDERATIONS 
     FIG. 4 shows the timing of I/O processor 12 as it moves &#34;file&#34; data from the disk. During the time consumed by I/O processor 12 as it moves data first from converter 104 to buffer 106, then to cache 107, and prepares for the next transfer (if any), two data blocks (sectors 8 and 16) go by under head 50. When the head is positioned over sector 1 (after a delay of 1120 microseconds) the processor is ready to read data from that sector if step 74 (FIG. 7) calls for data transfer from the next logically contiguous data block. Note that if a 1:1 or 2:1 interleave factor is used then the disk would have to make a complete revolution before the head would be positioned to read the &#34;next&#34; block of information. 
     FIG. 5 shows the timing of I/O processor 12 as it moves &#34;swap&#34; data from the disk. Since I/O processor 12 is not involved in moving the data out of buffer 106, it is ready to transfer data from the next sector sooner. Thus a 2:1 interleaving is used, yielding a 457K byte/sec transfer rate as opposed to a 305 K byte/sec transfer rate for the &#34;file&#34; transfer. It should be noted that if a faster host CPU (with fast main memory) and a faster I/O processor are used, the &#34;swap&#34; section of the disk drive can be formatted with a 1:1 interleave, yielding a transfer rate of approximately 1M byte/sec for &#34;swap&#34; transfers. 
     Since &#34;file&#34; transfers generally occur more often than do &#34;swap&#34; transfers, CPU time is conserved at a slight decrease in bit transfer rate using the same disk drive (actuator) and disk controller for both transfer types. 
     One obvious question is: why can&#39;t the data from serial to parallel converter 104 be transferred directly to dual ported cache 107, thus eliminating the need for dual ported buffer 106? 
     The reason is that dual ported cache 107 using today&#39;s technology cannot accept the data at the rate at which it is being supplied by serial to parallel converter 104, because its worst case access time is slower than the raw disk data transfer rate from converter 104. On the other hand, dual ported buffer 106 does have an access time equivalent to the raw disk data transfer rate; hence, it can accept data directly from serial to parallel converter 104. Unfortunately, the static RAM used in dual ported buffer 106 is not as dense as the dynamic RAM used in dual ported cache 107 and thus, there is not enough physical circuit board space to accommodate a dual ported buffer large enough to eliminate the need for the dual ported cache. 
     CONCLUSION 
     In conclusion, it can easily be seen that the dual mode disk controller offers much of the performance of a two disk drive (actuator) system using only one disk drive. Therefore, this invention is of interest to anyone who is designing a microcomputer system with the requirements of low cost, ability to perform context switching (swapping), and high performance use of a rotating storage medium. It should be obvious that while two disk formats (interleave) were discussed, other such formats (interleave) may also be used. Also, the relative format areas can vary from application to application and they need not be equal in size and the number of sectors in any format or on any track can be any desired value.