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

Re: Disk Musings



In article <m0rIG4Z-0006IPC@lloyd.com>,
Howard Chu <howard@harry.lloyd.com> wrote:
>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.)

 i think the 68k-linux people have a `real' floppy device now...

 which reminds me :)  has anyone done something to lock GEMDOS calls and
DMA channels already so DMA devices can use sleep/iwake and no longer
halt the whole system?  (or does someone know how the Magic people did it?
probably incompatible with anything known in the rest of the world again...)

>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?

 some auto-detect device sounds useful, but better keep the others
in case you get thigs like disks written with a 9-sector format that
were formatted with 10 sectors...

 (you should be able to fscntl DEV_INSTALL the same device with different
names and open() functions and set/auto-detect the format there.)
>
>[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?]

 or a #define for host-generates-no-parity?  and i guess you'll need
another parameter for the hosts method to send commands > 0x1f?

>  -- Howard
 happy hacking
	Juergen