bios_param()

<#1392#><#1392#> supports the MS-DOS hard disk partitioning system. Each disk contains a ``partition table'' which defines how the disk is divided into logical sections. Interpretation of this partition table requires information about the size of the disk in terms of cylinders, heads, and sectors per cylinder. SCSI disks, however, hide their physical geometry and are accessed logically as a contiguous list of sectors. Therefore, in order to be compatible with MS-DOS, the SCSI host adapter will ``lie'' about its geometry. The physical geometry of the SCSI disk, while available, is seldom used as the ``logical geometry.'' (The reasons for this involve archaic and arbitrary limitations imposed by MS-DOS.) <#1394#><#1394#> needs to determine the ``logical geometry'' so that it can correctly modify and interpret the partition table. Unfortunately, there is no standard method for converting between physical and logical geometry. Hence, the <#1395#> bios_param()<#1395#> function was introduced in an attempt to provide access to the host adapter geometry information. The 116 parameter is the size of the disk in sectors. Some host adapters use a deterministic formula based on this number to calculate the logical geometry of the drive. Other host adapters store geometry information in tables which the driver can access. To facilitate this access, the 117 parameter contains the drive's device number. Two macros are defined in 118 which will help to interpret this value: 119 is the device's major number, and 120 is the device's minor number. These are the same major and minor device numbers used by the standard <#1396#><#1396#> <#1397#> mknod<#1397#> command to create the device in the <#1398#> /dev<#1398#> directory. The 121 parameter points to an array of three integers that the 122 function will fill in before returning:

#dispitems1399#

The information in 123 is <#1404#> not<#1404#> the physical geometry of the drive, but only a <#1405#> logical<#1405#> geometry that is identical to the <#1406#> logical<#1406#> geometry used by MS-DOS to access the drive. The distinction between physical and logical geometry cannot be overstressed.