🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #3491

Re: floppy disk sizes, how to calculate them

#3491
From: Root Of All Evil
Date: Tue, 29 Aug 1989 20:33
29 lines
2040 bytes
In article <4552164d.14a1f@force.UUCP> covertr@force.UUCP (Richard E. Covert) writes:
>
>...
>
>I am writing a backup program and I need to ask the user for the
>size of his floppy. There are many ways of doing this. One method is for
>the user to enter the decimal number of bytes per floppy (from a table
>shown on the screen). another way is to ask the user to enter the number of
>tracks per disk, number of sectors per track, and number of sides per disk.
>I perfer the latter.

This information is all available in the boot sector.  You just need
to know where to look for it.  It's the same as for MS-DOS, so you can
look in Norton's book on the IBM-PC to learn how disks are structured.

>	But, how do I calculate the amount of usable space based on the
>number of sectors, tracks, and sides?? Some of the disk is used by the
>directory, and I heard that there are some unused sectors at the end.
>So, what is a good formula for determining the size of a floppy??

Why do you want to?  The Gemdos call "Dfree" tells you how much space
is left.  It's only if you want to bypass Gemdos and write to the sectors
directly through Bios calls that you need to worry about such things.
==================================================
| Michael Fischer                                |
|    Arpanet:    <fischer-michael@cs.yale.edu>   |
|    Bitnet:     <fischer-michael@yalecs.bitnet> |
|    UUCP:       <fischer-michael@yale.UUCP>     |
==================================================
Technical Details
Message-ID: <71002@yale-celray.yale.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!yale!root
References: <4552164d.14a1f@force.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!yale!root
From: root@yale.UUCP (Root Of All Evil)
Newsgroups: comp.sys.atari.st
Subject: Re: floppy disk sizes, how to calculate them
Keywords: atari st, c
Message-ID: <71002@yale-celray.yale.UUCP>
Date: 29 Aug 89 20:33:03 GMT
References: <4552164d.14a1f@force.UUCP>
Reply-To: fischer-michael@CS.YALE.EDU (Michael Fischer)
Organization: Yale University Computer Science Dept, New Haven CT  06520-2158
Lines: 29