Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!voder!pyramid!octopus!stever From: stever@Octopus.COM (Steve Resnick ) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: First sector of the file area Message-ID: <1990Jul2.012523.19315@Octopus.COM> Date: 2 Jul 90 01:25:23 GMT References: <1990Jun27.141718.18545@contact.uucp> Reply-To: stever@octopus.UUCP (Steve Resnick ) Organization: Octopus Enterprises, Cupertino CA Lines: 27 In article <1990Jun27.141718.18545@contact.uucp> yung@contact.uucp () writes: >Hi, folks! > >I am writing a TSR program and is now in a desparate need to find out >the best way to access hard disk. Since DOS function cannot be used in >TSR program, therefore I will have to use BIOS, which means I have to >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? > Wait wait wait! The same reasons for not being able to call DOS is true for the BIOS disk I/O routines: They are non-reentrant. If you can cause your disk writes to wait for DOS to be finished with a DOS call, you can trap int 21 to your own vector and keep track of DOS' reentrancy status. There are some undocumented ways of doing this but they are not the same accross DOS 3 & DOS 4. As always, be carefull when doing any disk I/O for you may kill your disk or a portion thereof... Cheers! Steve -- -------------------------------------------------------------------------------- Steve Resnick - 408/241-1533 Process Scientific, Inc. "0x2B|~0x2B THAT is the question!"