On Thu, 22 Dec
2005 00:26:44 +0000 (GMT)
ard at p850ug1.demon.co.uk (Tony Duell) wrote:
To get back to disk imaging, I may be stupid, but
I do wonder if
it's actually possible to write such a program to run under
linux or any other multi-tasking system.
Since it's possible under Linux or one of the BSD Unixes to
completely compile out support for the floppy controller, it
should also be possible to pull said kernel code out, and create a
(super)user-mode module application out of it to do whatever you
want with the disk controller. More of this sort of thing should
be done, in my estimation. (my two cent opinion, I know, since I
should do-it-myself).
You are, IMHO, missing the point. Under linux, you have an ioctl()
call that lets you send any ocmmand bytes you like to the FDC. You can
therefore get that chip to do anything that it's capable of. And that
call takes care of setting up the DMA controller if you need it,
making sure the DMA buffer doesn't cross a page boundary, and all the
other nasty little details.
Why can't you just write a kernel module that does its ReadID with
interrupts turned off... there's ways to keep the OS from task
switching during the critical section of your code that does the sector
layout determination - writing a kernel module or using realtime
priority (nice -20 might work on Linux) of the OS if it's got it.
Assuming you're using a machine with a real PIC interrupt controller, not
new enough to have an APIC of some sort, under Linux/x86 you can always
do an iopl(3), and turn off the interrupt controller by hand, from
userland, if you're running as root. Just Be Careful when you try that.
and don't leave it off for too long... :)
Pat
--
Purdue University ITAP/RCAC ---