Can floppy devices supports different DMA types? if so how can I find out
which type my floppy is supporting?
TIA!
//Spike
"Spike" <im_a...@hotmail.com>:
> What kind of DMA is used with floppy transfer? Singleword? Multiword?
Ultra
> (probaly not!)?
Normally it's DMA channel 3 (8 bit) using single mode transfers.
> Can floppy devices supports different DMA types? if so how can I find out
> which type my floppy is supporting?
I think single mode DMA transfers are the only DMA transfers that are
supported, although I'm not too sure if any modern chipsets allow bus
mastered floppy transfers or anything - I tend to doubt they'd bother
(floppy drives are slow regardless of what you do). I remember trying to
use block transfers - each byte sent from the floppy was copied multiple
times into the DMA buffer :-)
It's possible to use PIO (Programmed IO), with IN & OUT instructions, which
results in quicker transfers but consumes a lot more CPU time. I wouldn't
recommend using PIO if your OS is multi-tasking (unless your using floppies
for swapping pages to/from virtual memory or something). The floppy is set
to PIO by default (I think). DMA mode is enabled/disabled by bit 3 of the
DOR.
Cheers,
Brendan
Floppy uese channel 2.
i suspect you are mixing you terms up as these refer to PCI-IDE busmaster
dma modes rather than the old fassioned ISA dma controller which
does not support such modes.
ben
Ok, well I thought PCI and ISA DMA modes were called the same (except maybe
UltraDMA which probally doesn't exist on ISA).
Thanks for telling me!
//Spike
My current floppy driver only uses Floppy DMA transfer.
But if a computer had 2 floppy drives and user programs requested read/write
from/to both floppies at the same time DMA would insufficient (ok, I might
sleep one of the user progs untill the other program has read all sectors
and then wake it up to resume transfer, what way do you recommend?
Sleep/Wake one of the programs or add PIO support?).
Thanks!
//Spike
>
> Cheers,
> Brendan
>
>
>
I think you'll find there is only one floppy drive /controller/ that controls both drives.
It can do only one thing at a time. There's nothing to stop you serialising access to it,
perhaps interleaving commands first to one drive then the other, but each command would
have to complete before the next starts. I don't think you can even set one FDD seeking
while you program the other since the controller works on a 3-part process - receiving the
command, obeying the command, returning status info about the command. It doesn't mutitask
within itself.
--
HTH,
James
"Spike" <im_a...@hotmail.com> wrote:
> "Brendan Trotter" skrev i meddelandet:
> > Normally it's DMA channel 3 (8 bit) using single mode transfers.
> Floppy uese channel 2.
This is what my documentation says. For some reason my floppy driver
is using DMA channel 3. I can't test this driver at the moment 'cause I'm
half way through rewriting the kernel, but as far as I can remember it
worked fine.
Is it possible that either can be used? I was thinking if the computer
has 2 floppy disk controllers one FDC could use DMA channel 2 and
the other could use DMA channel 3. My documentation says they
would both use DMA channel 2 in this case, which is the only thing
that would prevent me from using 2 floppy drive controllers
simultaneously.
While we are on the subject, the newer floppy drive controller chips
seem to support up to 4 devices. Is there any hardware that uses
this capability?
I've recently rewritten my PS/2 keyboard/mouse (8042) device
driver so that it will handle two keyboards to be used at once,
and come to the realization that hardware is capable of more
than current OS's will allow. Now I'd like my OS to be able to
support 8 floppy devices, and allow the primary FDC and secondary
FDC to operate independantly - any information appreciated :-)
Cheers,
Brendan
Please give me details :)
Brian.
"Brian Bruinewoud" <br...@darknova.com> wrote:
> "Brendan Trotter" <SPAMsa...@bigpond.comSPAM> wrote
> > I've recently rewritten my PS/2 keyboard/mouse (8042) device
> > driver so that it will handle two keyboards to be used at once,
> Eh? How does the 8042 support multiple keyboards? (and, presumably,
multiple mice?)
Well actually the 8042 won't, but it's more modern replacements
will. Generally the chips in pentium and newer computers support
two PS/2 connectors (although the second PS/2 port might not
be installed). For simplicity I'll use '8042' to refer to older chips
that only support one PS/2 port, and 'PS/2 chip' to refer to
anything that supports both PS/2 ports. I'll also name the PS/2
ports as 'port A' (where the keyboard usually goes) and
'port B' (where the mouse usually goes).
Normally when you press (or release) a key the keyboard
sends a series of codes to the computer. The 8042 or PS/2
chip normally translates these codes before your driver gets
them, but this translation is only possible on port A. For example,
if you press and release the 'A' key the keyboard will send
'0x1C' then '0xF0, 0x1C'. The 8042 or PS/2 chip translates
this to '0x1E' then '0x9E', which is what you're probably used to.
Now you can turn this translation off in most 8042 and PS/2 chips
using bit 6 of the configuration byte (set via. sending 0x60 to the
chip followed by the configuration byte). With translation turned
off port A will work exactly the same as port B - if both ports
have keyboards both keyboards will return the same untranslated
codes and if there's a mouse in port A the translation won't mess
up the mouse data.
This all sounds wonderful but there are a few 8042 and PS/2
chips where translation can't be turned off. Also the BIOS
expects a keyboard in port A. If you've got some sort of boot
loader (e.g. grub) or a boot menu (my OS let's the user select
some things before booting) then you'll need a keyboard in
port A. Therefore my driver supports a keyboard in port A with
translation, and anything in port B without translation. It wouldn't
be hard for me to change this to allow a mouse in port A but
then I have trouble with some chips and boot code (BIOS's).
Another problem is other OS's. If you've got 2 keyboards
plugged in Windows 95 (and presumable other versions) will not
boot - it tries to initialize the device in port B, gets back an ACK
and BAT and waits for the mouse ID which the keyboard doesn't
send. After a while windows probably times out and tries again
with the same result - it'll never get past the splash screen. IMHO
this is quite pleasing (making windows OS's look like crap isn't
a bad thing), but it can make it harder to test your OS as you
need to unplug the second keyboard before booting windows.
Ok, so now we've got translation on port A and no translation on
port B. We need 2 different pieces of code to convert keyboard
scan codes. The first is for port A and works the same as it always
has. The second is for keyboards in port B which converts
un-translated codes. These un-translated codes are easy to find
as there's people using PC keyboards for micro-chip controllers
and other things. Try this link:
http://panda.cs.ndsu.nodak.edu/%7Eachapwes/PICmicro/keyboard/scancodes2.html
Other than this the driver is much the same as normal. I can make
my driver available if you like (written for NASM). It'll handle
a keyboard (or nothing) in port A, and a second keyboard or
any PS/2 mouse (or nothing) in port B. It'll also handle all the
8042 and PS/2 chips I've been able to test it on and BOCHS
(BOCHS isn't completely compatible with any hardware in this
case).
The best part is that you can have a computer with 2 keyboards,
2 serial mouses and 2 video cards (and a pair of joysticks). Your OS
can allow 2 different users on the same computer without special
hardware.
Hope this helps,
Brendan
HAHAHAHA!
swapping 1.44MB at a time ...
"Insert paging floppy #29381 in drive A:"
"Insert paging floppy #29382 in drive A:"
"Insert paging floppy #29383 in drive A:"
"Insert paging floppy #29384 in drive A:"
"Insert paging floppy #29382 in drive A:"
"Insert paging floppy #139 in drive A:"
"Insert paging floppy #29384 in drive A:"
...
I'm sure users would love it.
brings back memories of using GEOS on a C64 with only one drive.
we'd have to add a little floppy head banging for the true retro feel ;)
--
Stephane Hockenhull
Queue them. The controller is only 1, and there is 1 DMA channel.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
I remember when I had a floppy based Amiga 1200, Digita Wordworth 2
(Word Processor) Needed 18 Disk swaps when loading it from floppy.
What's worse, the program came on just 4 or 5 disks and about 13 or
those disk swaps were between 2 disks! Ahh that retro feel
Regards
Steven Graham