Path: utzoo!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!mailrus!iuvax!maytag!watstat!dmurdoch From: dmurdoch@watstat.uwaterloo.ca (Duncan Murdoch) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Setting Volume Label: summary, solution Keywords: Volume, Label Message-ID: <1990May29.135326.6576@maytag.waterloo.edu> Date: 29 May 90 13:53:26 GMT Article-I.D.: maytag.1990May29.135326.6576 References: <326sis-b@massey.ac.nz> Sender: daemon@maytag.waterloo.edu (Admin) Organization: University of Waterloo Lines: 43 In article <326sis-b@massey.ac.nz> E.Ireland@massey.ac.nz writes: >what follows is the outline of my disk label function: > > Read the disk's boot sector (sector 0, if using DOS calls). > > From the boot sector, work out the number of root directory > sectors (# root directory entries * size of directory entry (32) / > bytes per sector) and the number of the first root directory > sector (boot sectors + FAT sectors) You should be warned that not all disks fill in the boot sector properly: if they're loaded using a device driver that already knows all the stuff that would normally be put there, there's no need. For example, certain ramdisks just zero the boot sector. It's fairly easy to recognize that what's stored there is garbage, but the only way to correct it is an undocumented dos call to get the BPB for the drive. It's described in Ralf Brown's interrupt list (INTER290.ZIP). > >(a) Are there any IBM PC or compatible systems with other than 512 > byte disk sectors? There is a field for sector size (in bytes) in > the boot table but I imagine a lot of software assumes 512 byte > sectors. Yes - again, they're mostly drives run from a device driver. I think Ontrack's disk manager, which allows >32Meg partitions in DOS 2 and 3, does it by using big sectors. > >(b) The root directory may contain entries for subdirectories, and the > starting cluster is given, but the file size field is always 0. > Do all subdirectory tables only contain one cluster of sectors, or > is it necessary to follow a chain of clusters in the FAT? In > other words, how do you determine the number of sectors/entries in > a subdirectory? The only way is to follow the chain through the FAT. There will be more than one cluster if you get enough files in the subdirectory. Duncan Murdoch dmurdoch@watstat.waterloo.edu P.S. My mailer doesn't like something about your address. If you have an alternate one, you might add it to your signature.