Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
To what port do i send the commands to the floppy driver?
List of Valid Commands
Data Transfer Commands
Command Name | Function
-----------------------------------------
read complete track | x2h
write sector | x5h
read sector | x6h
write deleted sector | x9h
read deleted sector | xch
format track | xdh
Control Commands
Command Name | Function
-----------------------------------------
fix drive data | x3h
check drive status | x4h
calibrate drive | x7h
check interrupt status | x8h
read sector ID | xah
seek/park head | xfh
invalid command | all invalid opcodes
Extended Commands
Command Name | Function
-----------------------------------------------
register summary | 0fh
determine controller version | x10h
verify | x16h
seek relative | 1xfh
then after i send the command where do i send/retreive the data from?
maybe i never learned how to read correctly but im not picking up on the specific port to write commands to...
Configuration of an FDC on a PC
The Floppy Controller on a PC uses a standard configuration. On the XT there are 3 ports available for control and data access registers. On the AT, there are 4, and on the PS/2 there are 6.
The base port address used for the controller is dependant on whether the controller is configured as the primary or secondary controller. This base address controls the port addresses used for each of the registers on the controller. It can additionally be noted that all floppy controllers on a PC use DMA channel 2 for data transfer during a read or write, and they all issue a hardware interrupt via IRQ6 to be serviced by INT 0eh by default.
Primary Address Secondary Address Write (W) Read (R)
base address 3f0h 370h
status register A (PS/2) 3f0h 370h R
status register B (PS/2) 3f1h 371h R
digital output register DOR 3f2h 372h W
main status register 3f4h 374h R
data rate select register (DSR)(PS/2) 3f4h 374h W
data register 3f5h 375h R/W
digital input register DIR (AT) 3f7h 377h R
configuration control register (AT) 3f7h 377h W
DMA channel 2 2
IRQ 6 6
INTR 0eh 0eh
Note that the controller can be configured differently from the defaults for handling interrupts.
once i send the command to 0x37F (amen..i got it) ...i need to send the data for the command...but the data listed for many of the commands is 9bits long...how would i send these 9 bits..?
ok... say i finally sent the command to write data to port 0x37f..then i send the bytes(all 9 of em)...if i were to use port i/o to send data to the floppy(yea i know i should use DMA)...would i then send the data that i want written to port 0x37f?