🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
3 messages
3 total messages Started by Yu Wang Sun, 01 Jul 1990 17:10
Re: First sector of the file area
#820
Author: Yu Wang
Date: Sun, 01 Jul 1990 17:10
10 lines
966 bytes
In article <1990Jun27.141718.18545@contact.uucp>, yung@contact.uucp writes...
>do the sector/cluster/file calculation. Anybody know how I can find out
>the sectore number of the first sector of the file area of a hard disk
>without knowing its storage size in advance?

You can read the File Allocation Table, it's all in there.
On a 20 meg hard disk, the FAT of the root directory should be at sector 83.
And the sub-directries of the root directory should be at sector 300s.
(Please correct me if I'm wrong)
P.S. PC-Tools will help.
Re: First sector of the file area
#825
Author: Solitair
Date: Mon, 02 Jul 1990 11:51
21 lines
1609 bytes
acsoyuw@ubvmsd.cc.buffalo.edu writes:
>>do the sector/cluster/file calculation. Anybody know how I can find out
>>the sectore number of the first sector of the file area of a hard disk
>You can read the File Allocation Table, it's all in there.
>On a 20 meg hard disk, the FAT of the root directory should be at sector 83.
>And the sub-directries of the root directory should be at sector 300s.
>(Please correct me if I'm wrong)

You're wrong (well, partially anyway).
The way to follow is this: Read the partition sector on the hard-disk,
determine from it the boot sector of the partition you want to access.
Then read that boot sector, extract from it all the info you want
(i.e. sector size, cluster size, partition size, start of FAT, size of FAT,
 start of root dir, start of file data area, ...)
Look up the format of the partition and boot sector in for example
the infamous INTERRUP.LST, available at a site near you!
--
Sincerely,                             |"I code it in 5 min, optimize it in 90
           Stephen R. van den Berg.    | min, because it's so well optimized:
uunet!mcsun!unido!rwthinf!cip-s01!berg | it runs in 5 only min.  Actually, most
berg@cip-s01.informatik.rwth-aachen.de | of the time I optimize programs."
Re: First sector of the file area
#998
Author: phys169
Date: Fri, 20 Jul 1990 12:00
25 lines
1875 bytes
In article <3050@rwthinf.UUCP>, berg@cip-s03.informatik.rwth-aachen.de
 (Solitair) and others write:
>>>.. Anybody know how I can find out
>>>the sectore number of the first sector of the file area of a hard disk

>>On a 20 meg hard disk, the FAT of the root directory should be at sector 83.

> The way to follow is this: Read the partition sector on the hard-disk,

The best way is to avoid the calculation, since DOS ignores some of the
parameters in that first sector, and different versions ignore it in different
ways, putting the first sector in different places. It's better to have your
TSR program get DOS to do the work, by either doing the work inside an int 28h
routine, when it is safe to use most modern DOS calls (e.g. set a flag in your
keyboard interrupt handler, which your 28h handler looks at), and/or intercept 
int 21h and avoid conflicts by checking for work to be done after calling the 
original int 21h has been called.

Second-best is to use int 25h after checking do disk activity is in progress;
this is still pretty safe, still works with many networks (e.g. Decnet Dos, but
NOT Novell), and lets your TSR get a slice of the action a little more often
than the super-safe method above.  You shouldn't need to look at partition
information unless you want some extra-efficient print spooler or such like.

Mark Aitchison, Physics, University of Canterbury, New Zealand, Up Under.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads