I now have 99% compatability in my emulation of the legacy FDC controller mentioned in previous posts. It seems I have one small piece left. This legacy controller would automatically determine, at floppy insertion time, whether the floppy was formatted in mode-0 (zerobased) or mode-1 (non-zerobased). It would then set a bit in one of it's status registers so software would be aware of the format. It also determined the format type such as density, sectors per track, and sector size. Also made available to software. I understand how to use the readid rawcmd to determine all this information myself within my application. My only problem seems to be a good method of detecting a disk change in the floppy thread of my emulation. For this particular application, being able to set up a signal handler with the floppy driver for a disk change would have been ideal. I guess instead, I need to use the same method as done in the diskd program?
However I cannot seem to get the diskd program to work as advertised. When I issue the following command, with no floppy inserted in the drive, in 10 seconds the ls command is executed. If I insert a floppy imediatly after issuing the command, it still waits 10 seconds then executes the ls command.
#diskd -d /dev/fd0 -i 100 -e ls
It appears that on my machine the FD_VERIFY bit is never being set and the FD_DISK_NEWCHANGE and FD_DISK_CHANGED bits are always set. I'm not sure what the FD_VERIFY bit has to do with a disk change. I'm also at a loss as to why the other 2 bits are always set.
???
Any suggestions welcome.
Thanks in advance Mark _______________________________________________ fdutils mailing list fdutils@tux.org http://www.tux.org/mailman/listinfo/fdutils
On Saturday 16 October 2004 12:39, Mark Hounschell wrote:
However I cannot seem to get the diskd program to work as advertised. When I issue the following command, with no floppy inserted in the drive, in 10 seconds the ls command is executed. If I insert a floppy imediatly after issuing the command, it still waits 10 seconds then executes the ls command.
#diskd -d /dev/fd0 -i 100 -e ls
There was a bug in disk & floppy driver which made it incompatible with the --noisy_dcl_clear setting.
This is fixed in today's patch (http://fdutils.linux.lu/fdutils-5.4-20050213.diff.gz)
Alternatively, you can do "floppycontrol --silent_dcl_clear"
It appears that on my machine the FD_VERIFY bit is never being set and the FD_DISK_NEWCHANGE and FD_DISK_CHANGED bits are always set. I'm not sure what the FD_VERIFY bit has to do with a disk change. I'm also at a loss as to why the other 2 bits are always set.
FD_VERIFY is set by the lower-level layers of the floppy driver when a disk is changed to notify the upper layers to re-check write protection (which may have changed because the disk may have been changed).
FD_DISK_NEWCHANGE is set when a physical disk change is detected, and cleared after a seek (which would normally clear DCL). If DCL is still set after a seek, the driver deduces from this condition that no disk is in the drive.
FD_DISK_CHANGE is set when a physical disk change is detected, and cleared when data is read from the drive.
Alain
_______________________________________________ fdutils mailing list fdutils@tux.org http://www.tux.org/mailman/listinfo/fdutils