delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/25/15:46:55

Date: Wed, 25 May 94 15:21:03 EDT
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: ericb AT lsid DOT hp DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Library problems
Reply-To: babcock AT cfa DOT harvard DOT edu

> Isn't 512 the true disk blocksize?  If not, is 4096 always the correct
> value, or does it vary depending on how the disk is layed out?  Is
> there a way to ask DOS and fill this field in correctly?

Int 0x21, ah=0x1b will return sector size (normally 512), sectors per cluster
and total clusters.  The second varies with the size of the disk.  It's 2048
for disks larger than 16MB but smaller than 128MB, and doubles every time the
disk size doubles, assuming a FAT disk.  I'm not sure what result you get
with a HPFS disk.  I do know that for a CD-ROM disk, sectors per cluster is 4
and the total clusters is set to 0xffff because the right answer won't fit in
16 bits.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019