Difference between revisions of "TDiskController"

From Ultibo.org
Jump to: navigation, search
(Created page with "Return to Unit Filesystem __TOC__ === Description === ---- ''To be documented'' === Class definitions === ---- <div class="toccolours mw-collapsible...")
 
(No difference)

Latest revision as of 03:46, 17 May 2018

Return to Unit Filesystem


Description


To be documented

Class definitions



TDiskController = class(TListObject)

constructor Create(ADriver:TFileSysDriver);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
protected
FDriver:TFileSysDriver;  
 
FControllerNo:Integer; \Controller0, \Controller1 etc - See Notes
FDescription:String; Description of Controller - eg "Standard ATA Controller"
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function GetName:String;  
function GetDescription:String;  
function GetFixedDiskCount:Integer; virtual;  
function GetFloppyDiskCount:Integer; virtual;  
function LCHStoLBA(ADevice:TDiskDevice; Cylinder,Head,Sector:Word; var LBA:LongWord):Boolean;  
function PCHStoLBA(ADevice:TDiskDevice; Cylinder,Head,Sector:LongWord; var LBA:LongWord):Boolean;  
function LBAtoLCHS(ADevice:TDiskDevice; LBA:LongWord; var Cylinder,Head,Sector:Word):Boolean;  
function LBAtoPCHS(ADevice:TDiskDevice; LBA:LongWord; var Cylinder,Head,Sector:LongWord):Boolean;  
function LCHStoPCHS(ADevice:TDiskDevice; LCylinder,LHead,LSector:Word; var PCylinder,PHead,PSector:LongWord):Boolean;  
function PCHStoLCHS(ADevice:TDiskDevice; PCylinder,PHead,PSector:LongWord; var LCylinder,LHead,LSector:Word):Boolean;  
public
property Name:String read GetName;  
property ControllerNo:Integer read FControllerNo;  
property Description:String read GetDescription;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  
 
function ControllerInit:Boolean; virtual;  
 
function LocateDevices:Boolean; virtual;  
 
function Read(ADevice:TDiskDevice; ASector:LongWord; ACount:Word; var ABuffer):Boolean; virtual;  
function Write(ADevice:TDiskDevice; ASector:LongWord; ACount:Word; const ABuffer):Boolean; virtual;  
function Erase(ADevice:TDiskDevice; ASector:LongWord; ACount:Word):Boolean; virtual;  
 
function Reset(ADevice:TDiskDevice):Boolean; virtual;  
 
function LockMedia(ADevice:TDiskDevice):Boolean; virtual;  
function UnlockMedia(ADevice:TDiskDevice):Boolean; virtual;  
function EjectMedia(ADevice:TDiskDevice):Boolean; virtual;  
 
function MediaReady(ADevice:TDiskDevice):Boolean; virtual;  
function MediaChanged(ADevice:TDiskDevice):Boolean; virtual;  
function MediaLocked(ADevice:TDiskDevice):Boolean; virtual;  
 
function Information(ADevice:TDiskDevice):String; virtual;  
 
function VendorId(ADevice:TDiskDevice):Word; virtual;  
function DeviceId(ADevice:TDiskDevice):Word; virtual;  
 
function Manufacturer(ADevice:TDiskDevice):String; virtual;  
function Product(ADevice:TDiskDevice):String; virtual;  
function SerialNumber(ADevice:TDiskDevice):String; virtual;  
 
function HostBus(ADevice:TDiskDevice):String; virtual;  
function BusNumber(ADevice:TDiskDevice):Word; virtual;  
function DeviceNumber(ADevice:TDiskDevice):Word; virtual;  
function FunctionNumber(ADevice:TDiskDevice):Word; virtual;  
function BaseAddress(ADevice:TDiskDevice):Word; virtual;  
function InterfaceType(ADevice:TDiskDevice):String; virtual;  
 
function Slave(ADevice:TDiskDevice):Boolean; virtual;  
function LogicalUnitNo(ADevice:TDiskDevice):LongWord; virtual;  
function FireWireGUID(ADevice:TDiskDevice):Int64; virtual;  
function WorldWideNo(ADevice:TDiskDevice):Int64; virtual;  
 
function PhysicalPort(ADevice:TDiskDevice):Word; virtual;  
function ControlPort(ADevice:TDiskDevice):Word; virtual;  
function IRQ(ADevice:TDiskDevice):LongWord; virtual;  
 
function PIO(ADevice:TDiskDevice):Boolean; virtual;  
function DMA(ADevice:TDiskDevice):Boolean; virtual;  
function LBA(ADevice:TDiskDevice):Boolean; virtual;  
function Version(ADevice:TDiskDevice):LongWord; virtual;  
 
function MediaType(ADevice:TDiskDevice):TMediaType; virtual;  
function FloppyType(ADevice:TDiskDevice):TFloppyType; virtual;  
function Ready(ADevice:TDiskDevice):Boolean; virtual;  
function Locked(ADevice:TDiskDevice):Boolean; virtual;  
function Lockable(ADevice:TDiskDevice):Boolean; virtual;  
function Ejectable(ADevice:TDiskDevice):Boolean; virtual;  
function Readable(ADevice:TDiskDevice):Boolean; virtual;  
function Writeable(ADevice:TDiskDevice):Boolean; virtual;  
function Eraseable(ADevice:TDiskDevice):Boolean; virtual;  
function Removable(ADevice:TDiskDevice):Boolean; virtual;  
function ChangeLine(ADevice:TDiskDevice):Boolean; virtual;  
 
function PhysicalCylinders(ADevice:TDiskDevice):LongWord; virtual;  
function PhysicalHeads(ADevice:TDiskDevice):LongWord; virtual;  
function PhysicalSectors(ADevice:TDiskDevice):LongWord; virtual;  
 
function LogicalCylinders(ADevice:TDiskDevice):LongWord; virtual;  
function LogicalHeads(ADevice:TDiskDevice):LongWord; virtual;  
function LogicalSectors(ADevice:TDiskDevice):LongWord; virtual;  
 
function SectorSize(ADevice:TDiskDevice):Word; virtual;  
function SectorCount(ADevice:TDiskDevice):Int64; virtual;  
function SectorShiftCount(ADevice:TDiskDevice):Word; virtual;  


Function declarations



constructor TDiskController.Create(ADriver:TFileSysDriver);
Description: To be documented
Note None documented


destructor TDiskController.Destroy;
Description: To be documented
Note None documented


function TDiskController.AcquireLock:Boolean;
Description: To be documented
Note None documented


function TDiskController.ReleaseLock:Boolean;
Description: To be documented
Note None documented


function TDiskController.GetName:String;
Description: To be documented
Note None documented


function TDiskController.GetDescription:String;
Description: To be documented
Note None documented


function TDiskController.GetFixedDiskCount:Integer;
Description: To be documented
Note None documented


function TDiskController.GetFloppyDiskCount:Integer;
Description: To be documented
Note None documented


function TDiskController.LCHStoLBA(ADevice:TDiskDevice; Cylinder,Head,Sector:Word; var LBA:LongWord):Boolean;
Description: To be documented
Note None documented


function TDiskController.PCHStoLBA(ADevice:TDiskDevice; Cylinder,Head,Sector:LongWord; var LBA:LongWord):Boolean;
Description: To be documented
Note None documented


function TDiskController.LBAtoLCHS(ADevice:TDiskDevice; LBA:LongWord; var Cylinder,Head,Sector:Word):Boolean;
Description: To be documented
Note None documented


function TDiskController.LBAtoPCHS(ADevice:TDiskDevice; LBA:LongWord; var Cylinder,Head,Sector:LongWord):Boolean;
Description: To be documented
Note None documented


function TDiskController.LCHStoPCHS(ADevice:TDiskDevice; LCylinder,LHead,LSector:Word; var PCylinder,PHead,PSector:LongWord):Boolean;
Description: To be documented
Note None documented


function TDiskController.PCHStoLCHS(ADevice:TDiskDevice; PCylinder,PHead,PSector:LongWord; var LCylinder,LHead,LSector:Word):Boolean;
Description: To be documented
Note None documented


function TDiskController.ReaderLock:Boolean;
Description: To be documented
Note None documented


function TDiskController.ReaderUnlock:Boolean;
Description: To be documented
Note None documented


function TDiskController.ReaderConvert:Boolean;
Description: Convert a Reader lock to a Writer lock
Note None documented


function TDiskController.WriterLock:Boolean;
Description: To be documented
Note None documented


function TDiskController.WriterUnlock:Boolean;
Description: To be documented
Note None documented


function TDiskController.WriterConvert:Boolean;
Description: Convert a Writer lock to a Reader lock
Note None documented


function TDiskController.ControllerInit:Boolean;
Description: To be documented
Note None documented


function TDiskController.LocateDevices:Boolean;
Description: To be documented
Note None documented


function TDiskController.Read(ADevice:TDiskDevice; ASector:LongWord; ACount:Word; var ABuffer):Boolean;
Description: To be documented
Note None documented


function TDiskController.Write(ADevice:TDiskDevice; ASector:LongWord; ACount:Word; const ABuffer):Boolean;
Description: To be documented
Note None documented


function TDiskController.Erase(ADevice:TDiskDevice; ASector:LongWord; ACount:Word):Boolean;
Description: To be documented
Note None documented


function TDiskController.Reset(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.LockMedia(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.UnlockMedia(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.EjectMedia(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.MediaReady(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.MediaChanged(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.MediaLocked(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Information(ADevice:TDiskDevice):String;
Description: To be documented
Note None documented


function TDiskController.VendorId(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.DeviceId(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.Manufacturer(ADevice:TDiskDevice):String;
Description: To be documented
Note None documented


function TDiskController.Product(ADevice:TDiskDevice):String;
Description: To be documented
Note None documented


function TDiskController.SerialNumber(ADevice:TDiskDevice):String;
Description: To be documented
Note None documented


function TDiskController.HostBus(ADevice:TDiskDevice):String;
Description: To be documented
Note None documented


function TDiskController.BusNumber(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.DeviceNumber(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.FunctionNumber(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.BaseAddress(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.InterfaceType(ADevice:TDiskDevice):String;
Description: To be documented
Note None documented


function TDiskController.Slave(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.LogicalUnitNo(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.FireWireGUID(ADevice:TDiskDevice):Int64;
Description: To be documented
Note None documented


function TDiskController.WorldWideNo(ADevice:TDiskDevice):Int64;
Description: To be documented
Note None documented


function TDiskController.PhysicalPort(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.ControlPort(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.IRQ(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.PIO(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.DMA(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.LBA(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Version(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.MediaType(ADevice:TDiskDevice):TMediaType;
Description: To be documented
Note None documented


function TDiskController.FloppyType(ADevice:TDiskDevice):TFloppyType;
Description: To be documented
Note None documented


function TDiskController.Ready(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Locked(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Lockable(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Ejectable(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Readable(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Writeable(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Eraseable(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.Removable(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.ChangeLine(ADevice:TDiskDevice):Boolean;
Description: To be documented
Note None documented


function TDiskController.PhysicalCylinders(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.PhysicalHeads(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.PhysicalSectors(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.LogicalCylinders(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.LogicalHeads(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.LogicalSectors(ADevice:TDiskDevice):LongWord;
Description: To be documented
Note None documented


function TDiskController.SectorSize(ADevice:TDiskDevice):Word;
Description: To be documented
Note None documented


function TDiskController.SectorCount(ADevice:TDiskDevice):Int64;
Description: To be documented
Note None documented


function TDiskController.SectorShiftCount(ADevice:TDiskDevice):Word;
Description: To be documented
Note Caller must hold the device lock


Return to Unit Reference