summaryrefslogtreecommitdiff
path: root/Source/Kernel/Devices/ATA/ATADrive.class.h
blob: b6087bfb75649a91293670f7002c58f5c7138d19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef DEF_ATADRIVE_CLASS_H
#define DEF_ATADRIVE_CLASS_H

#include "ATAController.class.h"
#include <Devices/BlockDevice.proto.h>

class ATADrive : public BlockDevice {
	friend class ATAController;
	private:
	ATADrive(ATAController* ctrlr, bool isSlave, u32int blockCount, u16int* identifyData);

	ATAController* m_ctrlr;
	bool m_isSlave;
	u32int m_blockCount;
	u16int m_identifyData[256];

	void cmdCommon(u32int numblock, u32int count);

	public:
	String getClass();
	String getName();

	bool readOnly();
	u64int blocks();
	bool readBlocks(u64int start, u32int count, u8int* data);
	bool writeBlocks(u64int start, u32int count, u8int* data);
	u32int blockSize();
};

#endif