The 32 function's only argument is the ``host number,'' an
index into the 33 variable (an array of type 34). The 35 function should return a non-zero value
if the host adapter is detected, and should return zero otherwise.
Host adapter detection must be done carefully. Usually the process begins
by looking in the ROM area for the ``BIOS signature'' of the host adapter.
On PC/AT-compatible computers, the use of the address space between <#1286#>
0xc0000<#1286#> and <#1287#> 0xfffff<#1287#> is fairly well defined. For example, the
video BIOS on most machines starts at <#1288#> 0xc0000<#1288#> and the hard disk BIOS,
if present, starts at <#1289#> 0xc8000<#1289#>. When a PC/AT-compatible computer
boots, every 2-kilobyte block from <#1290#> 0xc0000<#1290#> to <#1291#> 0xf8000<#1291#> is
examined for the 2-byte signature (<#1292#> 0x55aa<#1292#>) which indicates that a
valid BIOS extension is present [#nortonguide##1#].
The BIOS signature usually consists of a series of bytes that uniquely
identifies the BIOS. For example, one Future Domain BIOS signature is
the string:
verbatim18
found exactly five bytes from the start of the BIOS block.
After the BIOS signature is found, it is safe to test for the presence of a
functioning host adapter in more specific ways. Since the BIOS signatures
are hard-coded in the kernel, the release of a new BIOS can cause the
driver to mysteriously fail. Further, people who use the SCSI adapter
exclusively for <#1296#><#1296#> may want to disable the BIOS to speed boot time.
For these reasons, if the adapter can be detected safely without examining
the BIOS, then that alternative method should be used.
Usually, each host adapter has a series of I/O port addresses which are
used for communications. Sometimes these addresses will be hard coded into
the driver, forcing all <#1297#><#1297#> users who have this host adapter to use a
specific set of I/O port addresses. Other drivers are more flexible, and
find the current I/O port address by scanning all possible port addresses.
Usually each host adapter will allow 3 or 4 sets of addresses, which are
selectable via hardware jumpers on the host adapter card.
After the I/O port addresses are found, the host adapter can be
interrogated to confirm that it is, indeed, the expected host adapter.
These tests are host adapter specific, but commonly include methods to
determine the BIOS base address (which can then be compared to the BIOS
address found during the BIOS signature search) or to verify a unique
identification number associated with the board. For MCA bus machines, each type of board is given a unique
identification number which no other manufacturer can use---several Future
Domain host adapters, for example, also use this number as a unique
identifier on ISA bus machines. Other methods of verifying the host
adapter existence and function will be available to the programmer.