The disclosure can be better understood with reference to the following drawings. The elements of the drawings are not necessarily to scale relative to each other, emphasis instead being placed upon clearly illustrating the principles of the disclosure. Furthermore, like reference numerals designate corresponding parts throughout the several views.
The present disclosure generally pertains to systems and methods for accessing hard disk drives. In one exemplary embodiment, a computer system has a hard disk drive, an operating system, and a translation element. The operating system transmits an access command, such as a read command or a write command, for accessing the hard drive. The operating system formats the access command for a hard disk drive of a specific size. The translation element receives the access command and translates the access command into a format for a hard disk drive of a different size. The translation element transmits the translated access command to the hard disk drive of the computer system, and the hard disk drive accesses a disk in response to the translated access command. Since the translation element appropriately translates access commands into a form that is compatible with the hard disk drive, it is unnecessary for the operating system to be configured to format access commands in accordance with the sector size of the hard disk drive.
The CPU 19 is interfaced with various system components, such as input/output (I/O) devices 28 and the hard disk drive 25 via at least one bus. For example, in
As shown by
In the example shown by
During operation, the operating system 18 transmits, to the hard drive 25, HDD access commands, such as HDD read commands or HDD write commands. Generally, an HDD access command typically includes a command identifier, a sector count, and a logical address, although it is possible for HDD access commands to include other types of information. The command identifier indicates whether the command is for reading from or writing to the hard drive 25. The logical address identifies a logical memory location and, in particular, a disk sector at which a reading or writing operation is to start. Further, the sector count is a value indicating the number of disk sectors that are to be accessed in response to the command. Note that the sector count is based on the length of data that is being written or read, as well as the sector size of the hard drive 25.
For example, assume that the sector size for the hard drive 25 is 512 bytes such that each sector 1-16 of the hard drive 25 is capable of storing up to 512 bytes of data. Further assume that an HDD access command for reading the hard drive 25, also referred to as a “read command,” instructs the hard drive 25 to read 4096 bytes of data starting with sector 3. In this example, the operating system 18 inserts, into the command, a command identifier that identifies the command as being a read command. The operating system 18 also inserts a logical address that identifies sector 3. Since 4096 bytes span across eight disk sectors, the operating system 18 inserts a count value of eight into the command indicating that the hard drive 25 is to read eight sectors in response to the access command.
The access command is transmitted from the CPU 19 to the hard drive 25.
The controller 41 receives the access command and maps the logical address within such command to a physical address on the disk 45 to which the head 43 is to be moved before commencing the read operation (e.g., the start of sector 3). The controller 41 then instructs the head 43 to move to this physical address. Based on the sector count, the controller 41 appropriately controls the head 43 such that the head 43 consecutively reads sectors 3-11, staring with the identified sector (i.e., sector 3 in this example). Thus, controller 41 returns 4096 bytes of data to the CPU 19 in response to the access command.
An HDD access command for writing to the hard drive 25, also referred to as a “write command,” is similar to a read command, except that the write command includes the data to be written to the hard drive 25. Upon receiving the write command, the controller 41 maps the logical address in the command to a physical location on the disk 45, as described above for the read command. The controller 41 also controls the head 43 such that the data included in the write command is written to the disk 45 beginning at the physical location mapped to the logical address and continuing sector-by-sector until the sector count has been reached. For example, if a write command identifies sector 3, has 4096 bytes of data, and has a sector count of 8, then the controller 41 controls the head 43 such that the 4096 bytes are written to the disk 45 starting at sector 3 and continuing until sector 11.
Typically, if a computer manufacturer or designer desires to select a sector size different than the one used by the operating system 18, then the operating system 18 is updated to change how it formats the access commands so that the logical addresses and sector counts used by the operating system 18 are consistent with the hard drive 25 that is to be used.
In the exemplary embodiment depicted by
Note that in translating a received access command, the translation element 52 preferably translates the command's sector count into a new sector count suitable for the hard drive 55. In this regard, if “x” represents the HDD sector size on which the operating system 18 is based and if “y” represents the actual sector size of the hard drive 55, then the value of the sector count assigned to the translated command is equal to S (x/y), where “S” represents the original sector count of the command being translated. For example, in the instant embodiment for which the operating system 18 is based on a sector size of 512 and for which the actual sector size of the hard drive 55 is 4k or, in other words, 4096, the new sector count for the translated command can be determined by multiplying the sector count in the original command by ⅛ (i.e., 512/4096). If the calculation results in a fraction, then the new sector count is preferably rounded up to next highest whole number. For example, if the original sector count is 9 such that the new sector count is calculated to be 1.125, then the new sector count is rounded to a value of 2.
Thus, in the example described above for which the operating system 18 transmits a command for reading 4096 bytes of data and inserts a sector count of 8 into the command, the translation element 52 translates the sector count of such command into a value of 1. Therefore, the translated command transmitted to the hard drive 55 has a sector count of 1.
In addition to translating the sector count, the translation element 52 may also translate the logical address of a received access command. In this regard, in one exemplary embodiment, the translation element 52 maps logical addresses from the operating system 18 to logical addresses of the hard drive 55. Further, it is possible for logical addresses for multiple sectors (in accordance with the sector size used by the operating system 18) to be mapped to a logical address for the same sector for the hard drive 55 and vice versa. For example, assume that the operating system 18 is configured to access a disk of a hard drive having sixteen sectors with a sector size of 512 bytes, and assume that the disk 65 of the hard drive 55 has two sectors 76, 77 with a sector size of 4096. In such an example, all of the logical addresses from the operating system 18 are mapped to the two sectors of the hard drive 55. For example, the addresses that would have been mapped to the first eight sectors of a hard drive with a 512 byte sector size are mapped to one sector of the hard drive 55, and the addresses that would have been mapped to the last eight sectors of a hard drive with a 512 byte sector size are mapped to the other sector of the hard drive 55.
As shown by
In one exemplary embodiment, all of the components of the translation element 52 shown by
When an HDD read command is transmitted by the operating system 18, the read command is received via the interface circuitry 111, which stores the read command to buffer 105, as shown by block 202 of
The hard drive 55 performs a read operation in response to the translated command and transmits data from the read operation, referred to hereafter as a “data block,” across bus 38. Such data is received by the interface circuitry 111, which stores the data in buffer 105, as shown by block 211 of
For example, assume that the operating system 18 desires to retrieve data from two sectors (in accordance with the sector size used by the operating system 18) such that the read command requests 1024 bytes of data. In this regard, assume that the operating system 18 is requesting data that would have been stored in sectors 3 and 4 of the disk 45 shown by
When the read command is received by the translation element 52, the translation logic 100 translates the sector count to 1 since the requested data is located within a single sector of the disk 65, and the translation logic 100 translates the logical address to one that identifies the sector 76 that is storing the requested data.
Therefore, in response to the translated read command, the hard drive 55 reads sector 76 and returns, to the translation element 52, a data block that includes the 4096 bytes stored in sector 76. However, as noted above, the operating system 18 originally requested 1024 bytes of the 4096 bytes received by the translation element 52. Thus, the translation logic 100 removes, from the received data block, 3072 bytes of unwanted information such that the block includes the 1024 bytes requested from the hard drive 55. The translation logic 100 then transmits the modified data block to the CPU 19 via the interface circuitry 111. Accordingly, the CPU 19 receives the 1024 bytes originally requested by the operating system 18. The CPU 19 may then use such bytes in any desired manner. For example, the CPU 19 may display an output based on the received data via the I/O devices 28.
When an HDD write command is transmitted by the operating system 18, the write command is received via the interface circuitry 111, which stores the write command to buffer 105, as shown by block 252 of
To better illustrate the foregoing, assume that the operating system 18 desires to write data to two sectors (in accordance with the sector size used by the operating system 18) such that the write command is for writing 1024 bytes of data. In this regard, assume that the operating system 18 is requesting a write operation that would have written data to sectors 3 and 4 of the disk 45 shown by
When the write command is received by the translation element 52, the translation logic 100 translates the sector count to 1 since the data is to be written to a single sector of the disk 65, and the translation logic 100 translates the logical address to one that identifies the sector 76 to be accessed.
In addition, before transmitting the translated write command, the translation logic 100 generates a read command for reading the sector 76 that is identified by the translated write command, as shown by block 258 of
In response to the translated write command, the hard drive writes the 4096 byte block included in such command to the sector 76. Thus, the 1024 bytes in the original write command transmitted by the operating system 18 is written to the sector 76 without changing the remaining 3072 bytes stored in the sector 76.
Moreover, the translation element 52 can be used to enable a computer manufacturer or designer to migrate to a hard drive of different sizes without redesigning the operating system 18 or waiting for an updated version of the operating system 18. In this regard, assume that a manufacturer of the conventional computer system 17, which employs a hard drive 25 having sector sizes of 512 bytes, desires to begin manufacturing computer systems employing hard drives having sector sizes of 4096 bytes. One option is to change the configuration of the operating system 18 to be compatible with hard drives having sector sizes of 4096. However, an alternative approach is to continue using the same version of the operating system 18 for new computer systems but include a translation element 52 for converting access commands into a format compatible with hard drives having sector sizes of 4096. Moreover, rather than changing the configuration of the operating system 18, the manufacturer may begin manufacturing computer systems in accordance with the configuration shown by
During operation of such a computer system 50, the translation element 52 appropriately translates access requests from a format compatible with hard drives having sector sizes of 512 bytes to a format compatible with hard drives having sector sizes of 4096 bytes.
It should noted that various modifications to the exemplary embodiments described above would be apparent to one of ordinary skill in the art upon reading this disclosure. For example, the translation element 52 is described above as residing between the hard drive 55 and a southbridge bus 33 of a computer system 50. However, other locations of the translation element 52 are possible in other embodiments. In addition, buses of types other than those specifically described herein are possible.
Furthermore, it should be emphasized that the exemplary sector sizes described above are presented for illustrative purposes. Other sector sizes are possible in other embodiments. In this regard, it is possible for the operating system 18 to format access requests that are compatible with hard drives having any sector size other than 512 bytes. In addition, it is also possible for the hard drive 55 to have any sector size other than 4096 bytes and for the translation element 52 to translate access commands into formats compatible with such other sector sizes. Furthermore, it is unnecessary for the actual sector size of the hard drive 55 to be larger than the one on which the operating system 18 is based. For example, it is possible for the operating system 18 to format access command in accordance with a sector size of 4096 bytes, and it is possible for the sector size of the hard drive 55 to be 512 bytes or any other size. Regardless of the sector sizes used by the operating system 18 and the hard drive 55, the translation element 52 is configured to translate HDD access commands from a format incompatible with the hard drive 55 to a format compatible with the hard drive 55.
A computer system often employs a hard disk drive (HDD), sometimes referred to as a “hard drive,” to store various data. Access to the hard drive is usually controlled by an operating system (OS). In this regard, the operating system issues HDD access commands for writing to or reading from the hard drive. Such access commands are received by the hard drive, which accesses (e.g.: reads or writes) data on the hard drive in response to such commands. A hard disk is logically divided into multiple sectors, which are separately addressable by the HDD access commands. However, for various reasons, it may be desirable to change the sector size of the hard drive. For example, it may be desirable to append additional error correction coding (ECC) bytes to the data written to or read from the hard disk. To help mitigate the effect of these additional ECC bytes to the performance of the computer, the size of each HDD sector may be increased. For example, some conventional hard drives have a sector size of 512 bytes such that up to 512 bytes of data can be stored to each sector of the hard drive. However, recently, many computer manufacturers are migrating to a sector size of 4096, sometimes referred to as “4k,” such that up to 4096 bytes of data can be stored to each sector of the hard drive. Unfortunately, the operating system is typically formatted for a hard drive of a specific sector size. Thus, a computer manufacturer or designer may be precluded from transitioning to a desired sector size until an operating system compatible with the desired sector size becomes available.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/US08/58834 | 3/31/2008 | WO | 00 | 9/28/2010 |