C# Class Mosa.DeviceDriver.ISA.FloppyDiskController

Inheritance: HardwareDevice, IDevice, IHardwareDevice, IDiskControllerDevice
显示文件 Open project: tgiphil/MOSA-Project

Protected Properties

Property Type Description
commandPort IReadWriteIOPort
configPort IReadWriteIOPort
dataPort IReadWriteIOPort
enchancedController bool
floppyDMA IDMAChannel
floppyDrives FloppyDriveInfo[]
floppyMedia FloppyMediaInfo[]
interruptSet bool
lastSeek LastSeek[]
spinLock SpinLock
statusPort IReadWriteIOPort
trackCache TrackCache[]

Public Methods

Method Description
CanWrite ( uint drive ) : bool

Determines whether this instance can write the specified drive NBR.

FloppyDiskController ( ) : Mosa.DeviceSystem

Initializes a new instance of the FloppyDiskController class.

GetSectorSize ( uint drive ) : uint

Gets the size of the sector.

GetTotalSectors ( uint drive ) : uint

Gets the total sectors.

OnInterrupt ( ) : bool

Called when an interrupt is received.

Open ( uint drive ) : bool

Opens the specified drive.

ReadBlock ( uint drive, uint block, uint count, byte data ) : bool

Reads the block.

Release ( uint drive ) : bool

Releases the specified drive.

Setup ( HardwareResources hardwareResources ) : bool

Setups this hardware device driver

Start ( ) : DeviceDriverStartStatus

Starts this hardware device.

WriteBlock ( uint drive, uint block, uint count, byte data ) : bool

Writes the block.

Protected Methods

Method Description
CHSToLBA ( uint drive, uint cylinder, uint head, uint sector ) : uint

CHSs to LBA.

ClearInterrupt ( ) : void

Clears the interrupt.

DetectDrives ( ) : void

Detects the drives.

DetermineByType ( byte type ) : FloppyDriveInfo

Determines the type of the by.

GetByte ( ) : byte

Gets the byte.

LBAToHead ( uint drive, uint lba ) : byte

LBAs to head.

LBAToSector ( uint drive, uint lba ) : byte

LBAs to sector.

LBAToTrack ( uint drive, uint lba ) : byte

LBAs to track.

PerformIO ( SectorOperation operation, uint drive, byte sector, byte track, byte head, uint count, byte data, uint offset ) : bool

Performs the IO.

ReadBlock2 ( uint drive, uint lba, byte data, uint offset ) : bool

Reads the block2.

Recalibrate ( uint drive ) : bool

Re-calibrates the specified drive.

ResetController ( ) : void

Resets the controller.

Seek ( uint drive, byte track, byte head ) : bool

Seeks the specified drive.

SendByte ( byte command ) : void

Sends the byte.

TurnOffMotor ( uint drive ) : void

Turns the off motor.

TurnOnMotor ( uint drive ) : void

Turns the on motor.

WaitForInterrupt ( uint milliseconds ) : bool

Waits for interrupt.

WaitForReqisterReady ( ) : bool

Waits for register ready.

WriteBlock2 ( uint drive, uint lba, uint count, byte data, uint offset ) : bool

Writes the block.

Method Details

CHSToLBA() protected method

CHSs to LBA.
protected CHSToLBA ( uint drive, uint cylinder, uint head, uint sector ) : uint
drive uint The drive.
cylinder uint The cylinder.
head uint The head.
sector uint The sector.
return uint

CanWrite() public method

Determines whether this instance can write the specified drive NBR.
public CanWrite ( uint drive ) : bool
drive uint The drive NBR.
return bool

ClearInterrupt() protected method

Clears the interrupt.
protected ClearInterrupt ( ) : void
return void

DetectDrives() protected method

Detects the drives.
protected DetectDrives ( ) : void
return void

DetermineByType() protected static method

Determines the type of the by.
protected static DetermineByType ( byte type ) : FloppyDriveInfo
type byte The type.
return FloppyDriveInfo

FloppyDiskController() public method

Initializes a new instance of the FloppyDiskController class.
public FloppyDiskController ( ) : Mosa.DeviceSystem
return Mosa.DeviceSystem

GetByte() protected method

Gets the byte.
protected GetByte ( ) : byte
return byte

GetSectorSize() public method

Gets the size of the sector.
public GetSectorSize ( uint drive ) : uint
drive uint The drive.
return uint

GetTotalSectors() public method

Gets the total sectors.
public GetTotalSectors ( uint drive ) : uint
drive uint The drive NBR.
return uint

LBAToHead() protected method

LBAs to head.
protected LBAToHead ( uint drive, uint lba ) : byte
drive uint The drive.
lba uint The lba.
return byte

LBAToSector() protected method

LBAs to sector.
protected LBAToSector ( uint drive, uint lba ) : byte
drive uint The drive.
lba uint The lba.
return byte

LBAToTrack() protected method

LBAs to track.
protected LBAToTrack ( uint drive, uint lba ) : byte
drive uint The drive.
lba uint The lba.
return byte

OnInterrupt() public method

Called when an interrupt is received.
public OnInterrupt ( ) : bool
return bool

Open() public method

Opens the specified drive.
public Open ( uint drive ) : bool
drive uint The drive NBR.
return bool

PerformIO() protected method

Performs the IO.
protected PerformIO ( SectorOperation operation, uint drive, byte sector, byte track, byte head, uint count, byte data, uint offset ) : bool
operation SectorOperation The operation.
drive uint The drive.
sector byte The sector.
track byte The track.
head byte The head.
count uint The count.
data byte The data.
offset uint The offset.
return bool

ReadBlock() public method

Reads the block.
public ReadBlock ( uint drive, uint block, uint count, byte data ) : bool
drive uint The drive NBR.
block uint The block.
count uint The count.
data byte The data.
return bool

ReadBlock2() protected method

Reads the block2.
protected ReadBlock2 ( uint drive, uint lba, byte data, uint offset ) : bool
drive uint The drive.
lba uint The lba.
data byte The data.
offset uint The offset.
return bool

Recalibrate() protected method

Re-calibrates the specified drive.
protected Recalibrate ( uint drive ) : bool
drive uint The drive.
return bool

Release() public method

Releases the specified drive.
public Release ( uint drive ) : bool
drive uint The drive.
return bool

ResetController() protected method

Resets the controller.
protected ResetController ( ) : void
return void

Seek() protected method

Seeks the specified drive.
protected Seek ( uint drive, byte track, byte head ) : bool
drive uint The drive.
track byte The track.
head byte The head.
return bool

SendByte() protected method

Sends the byte.
protected SendByte ( byte command ) : void
command byte The command.
return void

Setup() public method

Setups this hardware device driver
public Setup ( HardwareResources hardwareResources ) : bool
hardwareResources HardwareResources
return bool

Start() public method

Starts this hardware device.
public Start ( ) : DeviceDriverStartStatus
return DeviceDriverStartStatus

TurnOffMotor() protected method

Turns the off motor.
protected TurnOffMotor ( uint drive ) : void
drive uint The drive.
return void

TurnOnMotor() protected method

Turns the on motor.
protected TurnOnMotor ( uint drive ) : void
drive uint The drive.
return void

WaitForInterrupt() protected method

Waits for interrupt.
protected WaitForInterrupt ( uint milliseconds ) : bool
milliseconds uint The milliseconds.
return bool

WaitForReqisterReady() protected method

Waits for register ready.
protected WaitForReqisterReady ( ) : bool
return bool

WriteBlock() public method

Writes the block.
public WriteBlock ( uint drive, uint block, uint count, byte data ) : bool
drive uint The drive NBR.
block uint The block.
count uint The count.
data byte The data.
return bool

WriteBlock2() protected method

Writes the block.
protected WriteBlock2 ( uint drive, uint lba, uint count, byte data, uint offset ) : bool
drive uint The drive.
lba uint The lba.
count uint The count.
data byte The data.
offset uint The offset.
return bool

Property Details

commandPort protected_oe property

protected IReadWriteIOPort commandPort
return IReadWriteIOPort

configPort protected_oe property

protected IReadWriteIOPort configPort
return IReadWriteIOPort

dataPort protected_oe property

protected IReadWriteIOPort dataPort
return IReadWriteIOPort

enchancedController protected_oe property

protected bool enchancedController
return bool

floppyDMA protected_oe property

protected IDMAChannel floppyDMA
return IDMAChannel

floppyDrives protected_oe property

protected FloppyDriveInfo[] floppyDrives
return FloppyDriveInfo[]

floppyMedia protected_oe property

protected FloppyMediaInfo[] floppyMedia
return FloppyMediaInfo[]

interruptSet protected_oe property

protected bool interruptSet
return bool

lastSeek protected_oe property

protected LastSeek[] lastSeek
return LastSeek[]

spinLock protected_oe property

protected SpinLock spinLock
return SpinLock

statusPort protected_oe property

protected IReadWriteIOPort statusPort
return IReadWriteIOPort

trackCache protected_oe property

protected TrackCache[] trackCache
return TrackCache[]