Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!uhccux!virtue!canterbury.ac.nz!phys169 From: phys169@canterbury.ac.nz Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: First sector of the file area Message-ID: <1990Jul20.120532.8741@canterbury.ac.nz> Date: 20 Jul 90 12:00:02 GMT References: <29744@eerie.acsu.Buffalo.EDU> <3050@rwthinf.UUCP> Organization: University of Canterbury Lines: 25 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.