|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dioscuri.module.AbstractModule dioscuri.module.ModuleFDC dioscuri.module.fdc.FDC
public class FDC
An implementation of a Floppy disk controller module.
Metadata module ********************************************
general.type : fdc general.name : Floppy Disk Controller
general.architecture : Von Neumann general.description : Implements a
standard floppy disk controller for 3.5" floppies general.creator :
Tessella Support Services, Koninklijke Bibliotheek, Nationaal Archief of
the Netherlands general.version : 1.0 general.keywords : floppy, disk,
controller, 1.44, 2.88, 3.5 inch, SD, DD, HD general.relations :
motherboard general.yearOfIntroduction : 1982 general.yearOfEnding :
general.ancestor : 5.25 inch floppy disk general.successor : -
Issues: - check all fixme statements - sometimes MSR register is set to
busy, but I am not sure if it is done the right way as it loses all
previous bits: // Data register not ready, drive busy MSR = (byte) (1 <<
drive);
Notes: - Floppy disk controller is usually an 8272, 8272A, NEC765 (or
compatible), or an 82072 or 82077AA for perpendicular recording at
2.88M. - The FDC is only capable of reading from and writing to virtual
floppy disks (images), not physical disks. - The FDC does not perform a
CRC (Cyclic Redundancy Check). - FDC commands Scan low, scan low or
equal, scan high or equal are not implemented. - Datarates (speed of
reading/writing) is not taken into account. - Enhanced commands like
lock and unlock are not fully implemented. - Current FDC only works with
DMA data transfer
Overview of FDC registers (ref: Port list, made by Ralf Brown:
[http://mudlist.eorbit.net/~adam/pickey/ports.html]) 03F0 R diskette
controller status A (PS/2) (see #P173) 03F0 R diskette controller status
A (PS/2 model 30) (see #P174) 03F0 R diskette EHD controller board
jumper settings (82072AA) (see #P175) 03F1 R diskette controller status
B (PS/2) (see #P176) 03F1 R diskette controller status B (PS/2 model 30)
(see #P177) 03F2 W diskette controller DOR (Digital Output Register)
(see #P178) 03F3 ?W tape drive register (on the 82077AA) bit 7-2
reserved, tri-state bit 1-0 tape select =00 none, drive 0 cannot be a
tape drive. =01 drive1 =10 drive2 =11 drive3 03F4 R diskette controller
main status register (see #P179) Note: in non-DMA mode, all data
transfers occur through PORT 03F5h and the status registers (bit 5 here
indicates data read/write rather than than command/status read/write)
03F4 W diskette controller data rate select register (see #P180) 03F5 R
diskette command/data register 0 (ST0) (see #P181) status register 1
(ST1) (see #P182) status register 2 (ST2) (see #P183) status register 3
(ST3) (see #P184) 03F5 W diskette command register. The commands
summarized here are mostly multibyte commands. This is for brief
recognition only. (see #P187) 03F6 -- reserved on FDC 03F6 rW FIXED disk
controller data register (see #P185) 03F7 RW harddisk controller (see
#P186) 03F7 R diskette controller DIR (Digital Input Register, PC/AT
mode) bit 7 = 1 diskette change bit 6-0 tri-state on FDC 03F7 R diskette
controller DIR (Digital Input Register, PS/2 mode) bit 7 = 1 diskette
change bit 6-3 = 1 bit 2 datarate select1 bit 1 datarate select0 bit 0 =
0 high density select (500Kb/s, 1Mb/s) conflict bit 0 FIXED DISK drive 0
select 03F7 R diskette controller DIR (Digital Input Register, PS/2
model 30) bit 7 = 0 diskette change bit 6-4 = 0 bit 3 -DMA gate (value
from DOR register) bit 2 NOPREC (value from CCR register) bit 1 datarate
select1 bit 0 datarate select0 conflict bit 0 FIXED DISK drive 0 select
03F7 W configuration control register (PC/AT, PS/2) bit 7-2 reserved,
tri-state bit 1-0 = 00 500 Kb/S mode (MFM) = 01 300 Kb/S mode (MFM) = 10
250 Kb/S mode (MFM) = 11 1 Mb/S mode (MFM) (on 82072/82077AA) conflict
bit 0 FIXED DISK drive 0 select 03F7 W configuration control register
(PS/2 model 30) bit 7-3 reserved, tri-state bit 2 NOPREC (has no
function. set to 0 by hardreset) bit 1-0 = 00 500 Kb/S mode (MFM) = 01
300 Kb/S mode (MFM) = 10 250 Kb/S mode (MFM) = 11 1 Mb/S mode (MFM) (on
82072/82077AA) conflict bit 0 FIXED DISK drive 0 select
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface dioscuri.interfaces.Module |
---|
Module.Type |
Field Summary | |
---|---|
DMA8Handler |
dma8Handler
|
protected byte[] |
floppyBuffer
|
Fields inherited from class dioscuri.module.AbstractModule |
---|
type |
Constructor Summary | |
---|---|
FDC(Emulator owner)
Class constructor |
Method Summary | |
---|---|
void |
acceptComponent(HardwareComponent component)
|
protected int |
calculateStepDelay(int drive,
int newCylinder)
Calculate the delay for timer This method makes an approximation of the delay in the drive It does this based on the gap between current position of head in cylinder and desired cylinder |
protected void |
clearInterrupt()
Clear interrupt signal |
boolean |
ejectCarrier(int driveIndex)
Ejects a carrier (if any) from a selected drive |
boolean |
ejectCarrier(java.lang.String driveLetter)
Ejects a carrier (if any) from a selected drive |
protected byte |
getDMAByte()
Get byte from floppy buffer for DMA transfer This method is used for DMA transfer a byte from FDC to memory |
java.lang.String |
getDump()
Return a dump of module status |
byte |
getIOPortByte(int portAddress)
|
byte[] |
getIOPortDoubleWord(int portAddress)
|
byte[] |
getIOPortWord(int portAddress)
|
int |
getUpdateInterval()
Get the update interval. |
boolean |
insertCarrier(int driveIndex,
byte carrierType,
java.io.File imageFile,
boolean writeProtected)
Inserts a new carrier into a selected drive |
boolean |
insertCarrier(java.lang.String driveLetter,
byte carrierType,
java.io.File imageFile,
boolean writeProtected)
Inserts a new carrier into a selected drive |
boolean |
reset()
Reset all parameters of module. |
protected void |
setDMAByte(byte data)
Set byte in floppy buffer for DMA transfer This method is used for DMA transfer a byte from memory to FDC |
protected void |
setInterrupt()
Raise interrupt signal |
void |
setIOPortByte(int portAddress,
byte value)
|
void |
setIOPortDoubleWord(int portAddress,
byte[] dataDoubleWord)
|
void |
setIOPortWord(int portAddress,
byte[] dataWord)
|
boolean |
setNumberOfDrives(int totalDrives)
Defines the total number of available drives Note: total number may not exceed 4 |
void |
setUpdateInterval(int interval)
Defines the interval between subsequent updates |
void |
stop()
Stops the module from being active. |
int |
transferHandler(int nchan,
int pos,
int size)
|
void |
update()
Update the module. |
Methods inherited from class dioscuri.module.AbstractModule |
---|
getConnection, getConnections, getDebugMode, getExpectedConnections, getType, isConnected, setConnection, setDebugMode, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface dioscuri.interfaces.Module |
---|
getConnection, getConnections, getDebugMode, getExpectedConnections, getType, isConnected, setConnection, setDebugMode, start |
Field Detail |
---|
public DMA8Handler dma8Handler
protected byte[] floppyBuffer
Constructor Detail |
---|
public FDC(Emulator owner)
owner
- Method Detail |
---|
public boolean reset()
reset
in interface Module
reset
in class AbstractModule
AbstractModule
public void stop()
stop
in interface Module
stop
in class AbstractModule
Module
public java.lang.String getDump()
getDump
in interface Module
getDump
in class AbstractModule
AbstractModule
public int getUpdateInterval()
getUpdateInterval
in interface Updateable
Updateable
public void setUpdateInterval(int interval)
setUpdateInterval
in interface Updateable
interval
- the interval between subsequent updates in ms.Updateable
public void update()
update
in interface Updateable
Updateable
public byte getIOPortByte(int portAddress) throws ModuleException, UnknownPortException, WriteOnlyPortException
getIOPortByte
in interface Addressable
ModuleException
UnknownPortException
WriteOnlyPortException
Addressable
public void setIOPortByte(int portAddress, byte value) throws ModuleException, UnknownPortException
setIOPortByte
in interface Addressable
ModuleException
UnknownPortException
Addressable
public byte[] getIOPortWord(int portAddress) throws ModuleException, WriteOnlyPortException
getIOPortWord
in interface Addressable
ModuleException
WriteOnlyPortException
Addressable
public void setIOPortWord(int portAddress, byte[] dataWord) throws ModuleException
setIOPortWord
in interface Addressable
ModuleException
Addressable
public byte[] getIOPortDoubleWord(int portAddress) throws ModuleException, WriteOnlyPortException
getIOPortDoubleWord
in interface Addressable
ModuleException
WriteOnlyPortException
Addressable
public void setIOPortDoubleWord(int portAddress, byte[] dataDoubleWord) throws ModuleException
setIOPortDoubleWord
in interface Addressable
ModuleException
Addressable
protected void setInterrupt()
protected void clearInterrupt()
public boolean setNumberOfDrives(int totalDrives)
setNumberOfDrives
in class ModuleFDC
ModuleFDC
public boolean insertCarrier(java.lang.String driveLetter, byte carrierType, java.io.File imageFile, boolean writeProtected)
insertCarrier
in class ModuleFDC
ModuleFDC
public boolean ejectCarrier(java.lang.String driveLetter)
ejectCarrier
in class ModuleFDC
ModuleFDC
public boolean insertCarrier(int driveIndex, byte carrierType, java.io.File imageFile, boolean writeProtected)
insertCarrier
in class ModuleFDC
ModuleFDC
public boolean ejectCarrier(int driveIndex)
ejectCarrier
in class ModuleFDC
ModuleFDC
protected byte getDMAByte()
protected void setDMAByte(byte data)
data
- protected int calculateStepDelay(int drive, int newCylinder)
drive
- newCylinder
-
public int transferHandler(int nchan, int pos, int size)
transferHandler
in interface DMATransferCapable
nchan
- pos
- size
-
public void acceptComponent(HardwareComponent component)
component
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |