Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!apple!rutgers!dptg!lzaz!hcj From: hcj@lzaz.ATT.COM (HC Johnson) Newsgroups: comp.sys.atari.st Subject: Re: Programming Hard Drive access? Summary: Rwabs(rorw,buffer,n,rec,drive) Message-ID: <799@lzaz.ATT.COM> Date: 25 Sep 89 13:41:32 GMT References: <3859@helios.ee.lbl.gov> Organization: AT&T ISL Lincroft NJ USA Lines: 33 In article <3859@helios.ee.lbl.gov>, antony@lbl-csam.arpa (Antony A. Courtney) writes: > > After looking through both the Laser C manual and the 2 Abacus books, I still > haven't a clue how to go about doing sector level hard drive access from a > C or assembly language program. Can anyone either tell me how to do this or > point me to a reference? Use Rwabs(rorw,buffer,n,rec,drive) int rorw,n,rec,drive; char *buffer where rorw, is 0 read, 1 write buffer is the address to read into (keep it even, it faster) n is number of sectors (2 sectors make a cluster) rec is the starting sector on the logical drive. (thats why TOS partiions are limited to 32 MB) drive is the logical drive: 0 is A floppy, 1 is B floppy, 2-14 are the hard drive partition. A common extension, in SUPRA/ICD/and HDX3 formats is to or 8 to the rorw. This then changes the interpretation of n to ABSOLUTE sector. This is GREAT for read/write of the boot sector (0) of the hard disk. for floppies, you can also or 2 to rorw, meaning doent alter medium change and for some, or 4, meaning dont retry on error, just report it. Enjoy. Howard C. Johnson ATT Bell Labs att!lzaz!hcj hcj@lzaz.att.com