Chameleon

Chameleon Svn Source Tree

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

Source at commit 1129 created 12 years 11 months ago.
By meklort, Change options.o so that it reloads the system config as well. Also change it so that it uses that config for variables (NOTE: if the calue exists in chameleonConfig, it's used instead.
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
10class Disk
11{
12public:
13 Disk();
14 Disk(const char* name);
15 ~Disk();
16
17 // TODO: add cacheing
18 virtual IOReturn Read(UInt64 sector, UInt64 size, UInt8* buffer) = 0;
19 virtual IOReturn Write(UInt64 sector, UInt64 size, UInt8* buffer) = 0;
20
21 virtual bool isValid() { return mName != NULL && mBytesPerSector; };
22 virtual bool probe() { return isValid(); };
23 virtual UInt32 bytesPerSector() { return mBytesPerSector; };
24protected:
25 const char *mName;
26 const char *mBusType;
27
28 UInt32 mBytesPerSector;
29private:
30
31};
32
33#endif /* DISK_H */
34

Archive Download this file

Revision: 1129