Mail Archives: djgpp/2002/11/13/22:17:35
Michail Pishchagin <mailfrom AT mail DOT ru> wrote:
>Is it okay to use _bios_disk function for reading? Does it support reading
>sectors beyound 1024 cylinder at least on modern BIOSes?
_bios_disk() and biosdisk() use INT 13h AH=02h. All three functions
have the same limitations. You can access a disk up to 8 Gbytes if
the BIOS supports CHS translation, but only ~500 Mbytes if not
(this is the same thing as the 1024 cylinder limit).
If you need to access disks larger than 8 Gbytes, get this file:
http://my.execpc.com/~geezer/osd/disks/diskio.zip
and look at function lba_biosdisk() in file DJGPP.C
To use this LBA function, both the drive and the BIOS must support LBA.
>And is there some elegant way to determine how many physical hard drives are
>installed on computer?
The byte at address 0475h contains the number of hard drives
detected by the BIOS:
num_hds = _farpeekb(_dos_ds, 0x475);
The number of floppy drives detected by the BIOS can be had
from the Installed Equipment word at address 0410h:
num_fds = _farpeekw(_dos_ds, 0x410);
if(num_fds & 0x0001)
num_fds = ((num_fds / 64) & 3) + 1;
else
num_fds = 0;
--
geezer@ | http://www.execpc.com/~geezer
execpc.com | http://www.execpc.com/~geezer/osd
- Raw text -