summaryrefslogblamecommitdiff
path: root/Source/Kernel/Devices/BlockDevice.proto.h
blob: fa51148d61d6d5220f5b1b8b45e29801b1ae2cf6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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