1 / 33

Disk Access CHS

Disk Access CHS. Hard Disk Geometry. Description Terminology Heads on a Platter Head A stack of Rings or "Tracks" Cylinder Segment Sector. Hard Disk Geometry. Description Terminology Heads on a Platter Head A stack of Rings or "Tracks" Cylinder Segment Sector.

Télécharger la présentation

Disk Access CHS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Disk AccessCHS

  2. Hard Disk Geometry DescriptionTerminology Heads on a Platter Head A stack of Rings or "Tracks" Cylinder Segment Sector

  3. Hard Disk Geometry Description Terminology Heads on a Platter Head A stack of Rings or "Tracks" Cylinder Segment Sector

  4. Where the data is physically on the disk? “disk controller” allows us to specify only the Cylinder, Head and Sector that we want to access. The disk controller calculates where the data is physically on the disk and hands the data back to us. More accurately CHS is a pointer in memory to the data.

  5. How the physical disk is accessed If we wanted to access one particular sector, we could reference it by specifying • C which head it was on, • H which cylinder it was on and finally • S which sector it was on. That would then uniquely identify the sector that we wanted to access.

  6. Zone Bit Recording • Many hard drives today use a technology called “zone bit recording” which enables the hard drive to have more sectors on the outer tracks, where there is more room than on the inner tracks. • This allows more room for storage than using same number of sectors on each track.

  7. Which CHS in Zone bit Recording?

  8. ATA • A set of standards called the ATA (AT-Attachment) came into being in 1989 that effectively put a boundary on what was possible in terms of cylinder, head and sector numbers.

  9. ATA • ATA-5 says (amongst other things) that: • The cylinder number must be represented by 16 binary digits. • The head number must be represented by 4 binary digits. • The sector number must be represented by 8 binary digits. • A total of 28 bits.

  10. ATA-5 Limit of 128 GB • This means that the maximum specification of an IDE disk that conforms to the ATA standard is as follows. • Cylinders 216 =65536 (Numbered 0 to 65535) • Heads 24 =16 (Numbered 0 to 15) • Sectors 28 =256 (Numbered 0 to 255) Bytes per sector = 512 Total space = 65536 * 16 * 256 * 512 = 128 GB

  11. How we used to access the disk: CHS • The original method for accessing a disk is based on asking the disk controller for the data in the appropriate Cylinder, Head and Sector. • This is called the “CHS” method. • The software that we use to access the disk is called the BIOS.

  12. ATA • The authors of the BIOS very kindly wrote the software to communicate with the disk for us. • All we have to do is tell it that, for example, we’re after Cylinder 12345, Head 3 and Sector 243 and then go off and fetch it. • This piece of software within the BIOS that does the work is called an “interrupt service routine” ( INT). • The BIOS actually contains a fair number of INTs, but the one that we’re interested in is interrupt number 19 (or 13 in hexadecimal and usually written as INT13h).

  13. O/S --> INT13h --> CHS call --> Disk Controller The requirements for this type of CHS disk access are as follows: • An operating system that can make INT13h calls. • A BIOS that understands INT13h calls. • A BIOS that can make CHS calls. • A disk controller that understands the CHS values referenced.

  14. INT13h To ensure that one INT13h was the same as any other INT13h, a set of standards were defined to ensure that the INT13h call always did the same thing independently of who wrote the BIOS. The standards are based on IBM’s BIOS for PCs written in 1981. You might think that the ATA standard (1989) matches the INT13h standard (1981). Wrong! The INT13h standard says that: • The cylinder number must be represented by 10 binary digits. • The head number must be represented by 8 binary digits. • The sector number must be represented by 6 binary digits staring at 1, not 0.

  15. Partition Table and INT13h The Partition Table has the same set of restrictions because its layout is based on INT13h. This means that the maximum call that can be made using INT13h is as follows. • Cylinders 1024 (Numbered 0 to 1023) • Heads 256 (Numbered 0 to 255) • Sectors 63 (Numbered 1 to 63) Total space 8,455,716,864 bytes = 7.875 GB

  16. Maximum size using CHS • The lowest common denominator (LCD) between INT13h and the ATA standard represents the actual calls that we can make using CHS.

  17. Maximum size using CHS (Number of bits) ATA INT13h LCD LCD maximum value Cylinders 16 10 101024 --> 0 to 1023 Heads 4 8 416 --> 0 to 15 Sectors 8 6 663 --> 1 to 63 Total space = 1024 * 16 * 63 * 512 = 504 MB

  18. Translation • So, using CHS, only 504 MB can be accessed using this method. • Until 1994, this was indeed the case: any space beyond 504 MB was lost because it simply could not be referenced. • In 1994, the idea of “translation” was invented, where a translation of the real disk geometry was presented to the operating system.

  19. ECHS • The BIOS coders agreed on a way round the 504 MB limitation. They came up with a system called “Enhanced CHS”, or ”ECHS”. • ECHS is a simple translation method written on the end of the interrupt INT13h. In summary, this is what happens: O/S --> INT13h --> ECHS Translation --> CHS call --> Disk Controller • Consequently, the requirements for this type of disk access are as follows: • An operating system that can make INT13h calls. • A BIOS that understands INT13h calls. • A BIOS that can perform the ECHS translations. • A BIOS that can make CHS calls. • A disk controller that understands the (translated) CHS values referenced.

  20. ECHS • Remember that when we make our INT13h calls, we must stick within the C:1024, H:256, S:63 boundary. • So, all that ECHS does is to divide the head call that we make by either 2, 4, 8 or 16 and • multiply the cylinder call that we make by the same amount. • The actual multiplier (2,4, 8 or 16) that we use is chosen by the BIOS when we first install the hard disk and tell the BIOS about it.

  21. ECHS is limited by INT13h • So, using ECHS, only roughly 7.8 GB can be accessed using this method.

  22. 2 GB Limit • FAT-16 allows 65536 clusters • 32 kB maximum cluster size • Total max is 2 GB

  23. LBA • The first part of the radical solution is Logical Block Addressing (LBA).

  24. LBA • The five most important things to note about LBA are: • LBA is not the same as LBA Assist. The latter is a subset of the former and is a translation method based on the CHS addressing scheme. • LBA was not (as many web sites claim) invented to overcome any disk size limits. In fact, there is nothing intrinsic to LBA that allows size limits to be overcome. It is simply a different way of accessing the hard disk. • Unlike CHS and ECHS, both of which require the BIOS to know the disk geometry (the cylinder, head and sector values) in order to access the disk, LBA does not require the BIOS to know anything about the disk geometry to access the disk. • The operating system still has to make INT13h calls and is therefore still bounded by the old INT13h limits. • LBA has been around since around 1981. It is the method used to access SCSI drives. However, in the mid-1990s IDE disks finally caught up with SCSI and started to use LBA as well.

  25. LBA and Extended INT13h What happens with LBA and INT13h Extensions in combination: O/S --> INT13h Extended call --> LBA call --> Disk Controller

  26. ECHS • The INT13h extensions allow the full 64 bit LBA address to be accessed directly rather than having to mess around with CHS addresses. Because CHS values are no longer being used, the INT13h limits are no longer an issue.

  27. BIOS setup Options BIOS Setting Translation Disk Addressing Method NORMAL None CHS LARGE Revised ECHS CHS or LBA LBA LBA Assist LBA

  28. ECHS

  29. ECHS

  30. BIOS • Basic Input Output System. • Is a set of initial code to run your PC. • Intel have designed their CPUs always to begin execution of code at address FFFF0. • The first instruction is a jump instruction to the main part of BIOS code which could be "anywhere" else. As well as testing and initializing the hardware in the Power On Self Test (POST), the BIOS uses INT 13 to initiate the boot sequence from the hard disk (or whatever device is specified in the BIOS setup).

  31. BIOS For the purpose of booting up the computer, the BIOS is used for three main functions: • Providing a set of assembler subroutines that can be called by the operating system and whose function is to access the hardware components of the computer such as hard disk. • Initiates Power On Self Test (POST). • Allowing changes to the low level setup options. • Initiating the boot sequence after a hardware Reset.

  32. When the PC is switched on and the power is steady: • ROM BIOS (BIOS) initiates Power On Self Test (POST). • The BIOS determines the "boot device" - normally a hard disk. • The BIOS loads the contents of the first physical sector of the hard disk into memory (the MBR) to location 7C00 through to 7DFF (512 Bytes). • The BIOS instructs the CPU to execute the MBR code by issuing a jmp to location 7C00.

  33. When the MBR code is executed The MBR code makes use of INT 13 to read data from the hard disk when the PC is switched on. (Once the operating system is loaded, the method of accessing the hard disk can change depending on the operating system.) • The MBR code looks at the "partition table" using INT 13 calls to find the first entry that is marked bootable. • The MBR code identifies the physical location of the File System Boot Sector from the partition table entry. • The MBR codetransfers itself to location 0600 through to 07FF (from location 7C00) in memory and continues execution from there. • The MBR codetransfers the whole File System Boot Sector into memory to location 7C00 through to 7DFF. • The MBR code instructs the CPU to execute the File System Boot Sector code. • The File System Boot Sector code executes. The actions from here on are File System dependent.

More Related