To ensure the interoperability of various hardware and software products, the BIOS of the system is tailored to the needs of its hardware, and provides a standard way of letting software addressing the hardware. These are called BIOS services and are used by many operating system and application programs. They provide a uniform interface to the hard disk, so applications need not to know how to talk to each type of hard disk individually.
Standard IDE/ATA hard disks are configured in the BIOS using various BIOS settings. Modern BIOS programs can detect modern IDE/ATA disks to determine these parameters and automatically configure them. The BIOS controls which types of interface modes can be used with the hard disk, working with the system chipset on the motherboard and the system I/O bus.
The INT 13H Interface and INT 13H Extensions
The primary interface to the BIOS has been the software interrupt 13H which is generally known as INT 13H , where INT stands for interrupt and 13H is the number 19 in hexadecimal notation.
We shall learn and discuss the use of interrupts in programming in detail in the programming phase of this book. The Int13H interface supports many different commands that can be given to the BIOS, which then passes them on to the hard disk. The interrupt 13H include most of the tasks we need to perform with the disk such as reading, writing, formatting etc.
The use and work with Int13H requires the invoking program to know the specific parameters of the hard disk, and provide exact head, cylinder and sector addressing to the routines to allow disk access.
The BIOS uses the geometry for the hard disk as it is set up in the BIOS setup program. The Int13H interface allocates 24 bits for the specification of the geometry of the drive, broken up as follows:
- 10 bits for the cylinder number, or a total of 1,024 cylinders.
- 8 bits for the head number, or a total of 256 heads.
- 6 bits for the sector number, or a total of 63 sectors.
Thus the maximum possible number of sectors in the disk can be
= 1024 * 256 * 63
As we see here that the INT 13H interface can support disks containing up to 16515072 sectors with 512 bytes per sector. Thus the maximum disk size may be,
= 16515072 * 512
= 8455716864 Bytes
~ 8.456 GB
Thus the INT 13H interface can support the disk size approximately up to 8.456 GB (or 7.875 GiB).
Today most of the computer users use the hard disks which is much bigger in capacity then 8 GB that is why, the INT 13H interface has finally come to the end of its usefulness in modern computer systems and has been replaced with a newer interface called INT 13H extensions however INT 13H still may be used by DOS and some other older operating systems, and for other compatibility purposes.
Int 13H Extensions
It is really an interesting story that when INT 13H interface was developed, nobody ever expect to get the 8 GB size in hard disk. However today we may feel an 8 GB hard disk much smaller in capacity, even for home user's personal computer.
The older standard has an important limitation that it uses 24 bits of addressing information and as such can only handle drives that contain up to 16515072 sectors with 512 bytes per sector that yields a maximum capacity of 8.456 GB (or 7.875 GiB).
Thus the problem was to widen the access path from 24 bits to something larger but it was not possible to expand the existing INT13H BIOS interface because if we try to do this a lot of older hardware and software would stop working. And practically, there is no hope to get the respectable place in computer world with a lot of older hardware and software not working with your development.
Therefore a new interface was developed to replace Int13H. These routines are called Int13H extensions . This new interface uses 64 bits instead of 24 bits for addressing and allows a maximum hard drive size of 9.4 * 10 21 bytes that is 9.4 trillion gigabytes .
We shall learn the use of both, the INT 13H and INT 13H extensions in the programming section of this book. There are a number of other size limitations that took place in the earlier days. Some of the popular logical and physical limits have been described below:
The 2.1 GB limit
This size limit was observed in some older BIOSes which only allocate 12 bits for the field in CMOS RAM that gives the number of cylinders. Therefore this number may be at most 111111111111B (Maximum possible 12-Bit Binary Number) which is equivalent to 4095. In this way the maximum disk size with 16 heads, which can be accessed, will be:
= 4095 * 16 * 63 * 512 Bytes
= 2113413120 Bytes are accessible.
The 33.8 GB limit
This hard disk size barrier was noticed in early 1999. Large disks report 16 heads, 63 sectors/track and 16383 cylinders. Many BIOSes compute an actual number of cylinders by dividing the total capacity by 16*63.
For disks larger than 33.8 GB this leads to a number of cylinders larger than 65535. In this particular case, some versions of Award BIOS cannot handle drives that have more than 65,535 cylinders. Now the BIOS crashes or hangs. Since hard disk parameters usually use 16 heads and 63 sectors, this works out to a capacity of about 33.8 GB or 31.5 GiB before trouble occurs.
The solution is to upgrade the BIOS or one can use a jumper to make the disk appear smaller.