Chameleon

Chameleon Svn Source Tree

Root/branches/xZen/i386/modules/Disk/include/Disk.hpp

Source at commit 1206 created 12 years 9 months ago.
By meklort, Update Disk + Partition classes
1/*
2 * Copyright (c) 2011 Evan Lojewski. All rights reserved.
3 *
4 */
5#ifndef DISK_H
6#define DISK_H
7
8#include <IOKit/IOTypes.h>
9#include <Partition.hpp>
10
11class Disk
12{
13public:
14 Disk();
15 Disk(const char* name);
16 ~Disk();
17
18 // TODO: add cacheing
19 virtual IOReturn Read(UInt64 sector, UInt64 size, UInt8* buffer) = 0;
20 virtual IOReturn Write(UInt64 sector, UInt64 size, UInt8* buffer) = 0;
21
22 virtual bool isValid() { return mName != NULL && mBytesPerSector; };
23 virtual bool probe() { return isValid(); };
24 virtual UInt32 bytesPerSector() { return mBytesPerSector; };
25
26 virtual void addPartition(Partition* partition);
27 virtual Partition* getPartition(UInt32 index);
28protected:
29 PartitionList *mPartitions;
30 const char *mName;
31 const char *mBusType;
32
33 UInt32 mBytesPerSector;
34private:
35
36};
37
38#endif /* DISK_H */
39

Archive Download this file

Revision: 1206