Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!lll-winken!uunet!bcstec!shuksan!mikey From: mikey@shuksan.UUCP (Mike Fields) Newsgroups: comp.os.msdos.programmer Subject: Re: Turbo-C 2.0 absread() / abswrite() Summary: absread/write gotcha Message-ID: <367@shuksan.UUCP> Date: 12 Dec 90 18:12:43 GMT References: <1990Nov30.183106.29270@cbnewsc.att.com> <1990Dec8.182707.28401@usenet.ins.cwru.edu> Organization: The Boeing Co., MMST, Seattle, Wa. Lines: 32 In article <1990Dec8.182707.28401@usenet.ins.cwru.edu>, trier@cwlim.INS.CWRU.Edu (Stephen C. Trier) writes: > BIOS options exist to read 256-byte sectors. When I initially got a C > compiler for a PC, one of my first projects was to try to read an OS-9 > disk. I was never able to get the transfer to work right. (On the > other hand, I hadn't got used to PC programming yet back then!) > > So the answer is "yes, it's possible, at least in theory." > I had problems getting absread and abswrite to work - things were not where they were supposed to be. I finally figured out that absread adn abswrite refer to logical sectors which are calculated from the current drive parameters which ------ here's the gotch had to be set by first doing a dir on a disk formatted to the correct density!!! I was writing disks on my SUN at work and could not figure out why I could only get chunks of them. I finally wrote a little unix util which wrote a bunch of sectors (sequential) to disk which contained in ASCII what sector it was.. TC was getting blocks and skipping blocks. Finally figured out that the disk sort of defaults to 360K if it has not been set!. biosread() and bioswrite() allow you access to the exact sector you want but you have to fill in the head,track and sector number. I have since (read the pax doc) found that that is how other people set the density - have a blank disk formatted with dos at the correct density, do a dir on it THEN use the drive as you see fit. It works. -- Mikey (yes "he likes it!") ======================================================= Mike Fields ==> uunet!bcstec!shuksan!mikey (206) 657-6136 [work] 12022 NE 138th Pl. uw-beaver!ssc-vax!shuksan!mikey (206) 821-3492 [home] Kirkland, Wa. 98034