summaryrefslogtreecommitdiff
path: root/Source/Kernel/Devices/BlockDevice.proto.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/Devices/BlockDevice.proto.h')
-rw-r--r--Source/Kernel/Devices/BlockDevice.proto.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Kernel/Devices/BlockDevice.proto.h b/Source/Kernel/Devices/BlockDevice.proto.h
new file mode 100644
index 0000000..fa51148
--- /dev/null
+++ b/Source/Kernel/Devices/BlockDevice.proto.h
@@ -0,0 +1,17 @@
+#ifndef DEF_BLOCKDEVICE_PROTO_H
+#define DEF_BLOCKDEVICE_PROTO_H
+
+#include <Devices/Device.proto.h>
+
+class BlockDevice : public Device {
+ public:
+ virtual bool readOnly() = 0;
+ virtual u64int blocks() = 0; //Returns number of blocks on device
+ virtual bool readBlocks(u64int startblock, u32int count, u8int *data) = 0; //Returns false if fails
+ virtual bool writeBlocks(u64int startblock, u32int count, u8int *data) = 0; //Returns false if fails
+ virtual u32int blockSize() = 0; //Usually 512, 2048 for CDROMs
+
+ virtual u64int chsToLBA(u32int cylinder, u32int head, u32int sector) { return 0; } //Can be used by partition manager
+};
+
+#endif