teexand@ioe.lon.ac.uk (Andrew Dawson) (11/14/90)
I've noticed that if I use Rwabs() to write to the floppy in drive B, and no access of drive B has been made since reset, TOS assumes the disk is single sided. Hence, attempting to write higher numbered blocks cause the heads to seek beyond the end of the disk (ouch!). This is presumably because the BPB isn't correctly set up at the time of calling. Normally, I would just call Getbpb(), except in this case I've haven't written the boot sector yet, so it isn't valid. Since the BPB isn't in a fixed place across TOS versions, is there any way of locating it without calling Getbpb(). Even if this can be achieved, is it then safe to start changing the contents? There appears to be some extra structure members at the end that aren't documented. Any suggestions? -- =============================================================================== Andrew Dawson, Computer Centre, University College London, Gower Street, London WC1E 6BT, England.
fischer-michael@cs.yale.edu (Michael Fischer) (11/15/90)
In article <1990Nov14.151021.7946@ioe.lon.ac.uk> teexand@ioe.lon.ac.uk (Andrew Dawson) writes: >I've noticed that if I use Rwabs() to write to the floppy in drive B, and no >access of drive B has been made since reset, TOS assumes the disk is single >sided. Hence, attempting to write higher numbered blocks cause the heads to >seek beyond the end of the disk (ouch!). This is presumably because the BPB >isn't correctly set up at the time of calling. Normally, I would just call >Getbpb(), except in this case I've haven't written the boot sector yet, so it >isn't valid. Since the BPB isn't in a fixed place across TOS versions, is there >any way of locating it without calling Getbpb(). Even if this can be achieved, >is it then safe to start changing the contents? There appears to be some extra >structure members at the end that aren't documented. > >Any suggestions? Number of sides isn't the only thing Rwabs() needs to know in order to write to your disk. It also needs to know number of tracks, number of sectors per track, sector size, and so forth. These things are determined when the disk is formatted and stored in the boot sector. They are read by TOS when you do Getbpb(). I can't imagine why you want to write to a disk without reading its boot sector first. It seems like a really bad idea to make assumptions about the disk that happens to be in the drive instead of reading what is actually there. On the other hand, if the disk isn't a TOS disk at all and you just want raw access to the sectors which you believe and hope are there, then use Floprd() and Flopwr() directly. You specify side, track, and sector and they do the rest. -- ================================================== | Michael Fischer <fischer-michael@cs.yale.edu> | ==================================================