[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Disk Musings



Well, I got all enthusiastic about hacking again after playing with Kay's new
MiNTNet stuff. I figured it was time to get a formal SCSI IP driver working,
so I started poring thru Erling Henanger's scsi driver code again. Along the
way, I remembered Dave Gymer's raw floppy driver, and wondered if perhaps the
two could merge together. (Nope, the floppy driver just calls Xbios. Oh well.)
But anyway, while I was looking thru this code, it struck me that a better
approach was possible, kind of like the driver I wrote for ST-Minix ages ago.

Ok, here's the deal - instead of having to manually build in different "drivers"
for different floppy formats, just have a single device that reads the current
format upon device open. How do we do this? Pretty simple really, and it
doesn't require a valid boot sector (as my original Minix driver needed). Just
read track 0, side 1, sectors 8 to, say, 24. If the read fails completely,
either there's no disk, or it's single-sided, in which case you try again
with side 0. Otherwise, it should eventually fail after reading the last sector
on the track, and you can then determine the sectors per track count.

I guess this doesn't let you know the complete geometry, because you still
don't know how many tracks exist. if you didn't mind the long seek, you could
determine that as well. What do you think?

[re: SCSI IP - slight problem, SCSI-2 requires SCSI parity to be on, while
most ST ACSI-SCSI adaptors don't support parity, making it difficult/
impossible for them to share a SCSI bus. What to do? Force the scsi driver
to always operate in SCSI-1 mode?]
  -- Howard