Class BlockDevice
BlockDevice abstract class. See also: Device.
Inherited Members
Namespace: Cosmos.HAL.BlockDevice
Assembly: Cosmos.HAL2.dll
Syntax
public abstract class BlockDevice : Device
Fields
| Improve this Doc View SourceDevices
Devices list.
Declaration
public static List<BlockDevice> Devices
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<BlockDevice> |
mBlockCount
Block count.
Declaration
protected ulong mBlockCount
Field Value
| Type | Description |
|---|---|
| System.UInt64 |
mBlockSize
Block size.
Declaration
protected ulong mBlockSize
Field Value
| Type | Description |
|---|---|
| System.UInt64 |
Properties
| Improve this Doc View SourceBlockCount
Get block count.
Declaration
public ulong BlockCount { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 |
BlockSize
Get block size.
Declaration
public ulong BlockSize { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 |
Type
Declaration
public abstract BlockDeviceType Type { get; }
Property Value
| Type | Description |
|---|---|
| BlockDeviceType |
Methods
| Improve this Doc View SourceCheckBlockNo(UInt64, UInt64)
Check block number. Not implemented.
Declaration
protected void CheckBlockNo(ulong aBlockNo, ulong aBlockCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | aBlockNo | A block number to be checked. |
| System.UInt64 | aBlockCount | A block count. |
CheckDataSize(Byte[], UInt64)
Check data size.
Declaration
protected void CheckDataSize(byte[] aData, ulong aBlockCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | aData | A data to check the size of. |
| System.UInt64 | aBlockCount | Number of blocks used to store the data. |
Exceptions
| Type | Condition |
|---|---|
| System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
| System.Exception | Thrown when data size invalid. |
NewBlockArray(UInt64)
Create new block array.
Declaration
public byte[] NewBlockArray(ulong aBlockCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | aBlockCount | Number of blocks to alloc. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | byte array. |
ReadBlock(UInt64, UInt64, ref Byte[])
Read block from partition.
Declaration
public abstract void ReadBlock(ulong aBlockNo, ulong aBlockCount, ref byte[] aData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | aBlockNo | A block to read from. |
| System.UInt64 | aBlockCount | A number of blocks in the partition. |
| System.Byte[] | aData | A data that been read. |
Exceptions
| Type | Condition |
|---|---|
| System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
| System.Exception | Thrown when data size invalid. |
WriteBlock(UInt64, UInt64, ref Byte[])
Write block to partition.
Declaration
public abstract void WriteBlock(ulong aBlockNo, ulong aBlockCount, ref byte[] aData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | aBlockNo | A block number to write to. |
| System.UInt64 | aBlockCount | A number of blocks in the partition. |
| System.Byte[] | aData | A data to write. |
Exceptions
| Type | Condition |
|---|---|
| System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
| System.Exception | Thrown when data size invalid. |