Bios Tips

CD Boot error codes

When failing to boot from CDROM, the bios outputs the reason of the failure as an error code, in the log file, and on the screen. Here are the meaning of the errors:

Table 1. CD Boot error codes

Error codeReason
0x01 no atapi device found
0x02 no atapi cdrom found
0x03 can not read cd - BRVD
0x04 cd is not eltorito (BRVD)
0x05 cd is not eltorito (ISO TAG)
0x06 cd is not eltorito (ELTORITO TAG)
0x07 can not read cd - boot catalog
0x08 boot catalog : bad header
0x09 boot catalog : bad platform
0x0A boot catalog : bad signature
0x0B boot catalog : bootable flag not set
0x0C can not read cd - boot image

Disk translation

Since the beginning of the PC era, disks have grown in size by a factor of 10000. Due to differences between the ATA specification and BIOSes implementations, when disks reached critical sizes, it became necessary to translate the CHS geometry (cylinders, heads, sectors per track) between the BIOS (int 13h) and the ATA interface. Please refer to the ATA-FAQ and Hale Landis' document for a complete discussion of the problem.

Unfortunately, there has never been any standard on the translation algorithms.

Bochs implements 4 well-known algorithms, selectable in the configuration file in the "ataX-xxxx: ..., translation='algorithm'" section.

Table 2. Disk translation algorithms

AlgorithmMaximum disk sizeMaximum logical and physical geometry (CHS)Description
none528MB (1032192 sectors) LCHS:1024/16/63 PCHS:1024/16/63 no translation is done. The CHS received at the int13h interface is sent as is to the ATA interface.
large4.2GB (8257536 sectors) LCHS:1024/128/63 PCHS:8192/16/63 a standard bitshift algorithm (named Extended-CHS) is used to translate the CHS between the int13h interface and the ATA interface. The translation is acheived by multiplying/dividing the cylinder/head count by a power of 2 (2, 4 or 8). (a factor of 16 could not be used because the head count would become 256, and MS-Dos thought this was 0) Note that the number of sectors per track is not changed, so a lower spt value will lead to a lower maximum disk size.
echs  synonym for large
rechs7.9GB (15482880 sectors) LCHS:1024/240/63 PCHS:15360/16/63 a revised bitshift algorithm (called Revised Extended-CHS) is used to translate the CHS between the int13h interface and the ATA interface. First the number of physical heads is forced to 15, and the number of cylinders is adjusted accordingly. Then, as in the simple extended CHS algorithm, the translation is acheived by multiplying/dividing the cylinder/head count by a power of 2 (2, 4, 8 or 16). The head count being forced to 15, it can safely be multiplied by 16 without crashing dos. Note that the number of sectors per track is not changed, so a lower spt value will lead to a lower maximum disk size.
lba8.4GB (16450560 sectors) LCHS:1024/255/63 PCHS:16320/16/63 a LBA-assisted algorithm is used to translate the CHS between the int13h interface and the ATA interface. The translation is acheived by first computing the physical size of the disk (LBA=C*H*S). Then the sectors per track is forced to 63, and the head count to 255. Then the cylinder count is computed (C=LBA/(63*255)) Note that the number of sectors per track is forced to 63 in the logical geometry, regardless of the actual geometry reported by the disk. Also note that the LBA-assisted algorithm has nothing to do with LBA access at the ATA interface.
auto  the best suited algorithm between none, large and lba is used

Setting a specific CHS translation should be done if you use a disk dump of an actual disk, or use a real disk as a block device. You need to know which geometry was used to format the disk, and which translation was used.

Note

rechs translation should only be useful for compaq users who wants to use a disk as a block device. Please report if you know any other system that use such translation.

If you plan to create a new disk image (for example with bximage), format it and install an OS on it, select the "auto" translation for an automatic selection of the best algorithm based on the disk image size. Be warned that an image created with the "auto" translation might not be readable with previous versions of Bochs. Upward compatibility will be maintained.

Note

This translation applies only to int13h bios disk accesses. Older OSes (ie MS-Dos) tend to use them a lot. On modern OSes, disk accesses through BIOS int13h are limited to boot loaders. The usual rules and tricks of the installed OS still apply (ie 1024 cylinders boot limit).