Index: branches/rewrite/i386/modules/BiosDisk/include/Disk.hpp =================================================================== --- branches/rewrite/i386/modules/BiosDisk/include/Disk.hpp (revision 0) +++ branches/rewrite/i386/modules/BiosDisk/include/Disk.hpp (revision 1075) @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2011 Evan Lojewski. All rights reserved. + * + */ +#ifndef DISK_H +#define DISK_H + +#include + +class Disk +{ +public: + Disk(); + Disk(const char* name); + ~Disk(); + + virtual IOReturn Read(UInt64 sector, UInt64 size, char* buffer) = 0; + virtual IOReturn Write(UInt64 sector, UInt64 size, char* buffer) = 0; + + bool isValid() { return mName != NULL; }; +protected: + const char *mName; + const char *busType; + +private: + +}; + +#endif /* DISK_H */ Index: branches/rewrite/i386/modules/BiosDisk/include/BiosDisk.hpp =================================================================== --- branches/rewrite/i386/modules/BiosDisk/include/BiosDisk.hpp (revision 0) +++ branches/rewrite/i386/modules/BiosDisk/include/BiosDisk.hpp (revision 1075) @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2011 Evan Lojewski. All rights reserved. + * + */ +#ifndef BIOSDISK_H +#define BIOSDISK_H + +#include +#include + + +#define super Disk + +class BiosDisk : public Disk +{ +public: + BiosDisk(const char* name); + ~BiosDisk(); + + virtual IOReturn Read(UInt64 sector, UInt64 size, char* buffer); + virtual IOReturn Write(UInt64 sector, UInt64 size, char* buffer); + +protected: + +private: + UInt8 mDiskID; +}; + +#endif /* BIOSDISK_H */ Index: branches/rewrite/i386/modules/BiosDisk/Main.cpp =================================================================== --- branches/rewrite/i386/modules/BiosDisk/Main.cpp (revision 0) +++ branches/rewrite/i386/modules/BiosDisk/Main.cpp (revision 1075) @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2011 Evan Lojewski. All rights reserved. + * + */ +#include +#include +#include + +extern "C" +{ + void BiosDisk_start(); +} + +void BiosDisk_start() +{ +} \ No newline at end of file Index: branches/rewrite/i386/modules/BiosDisk/BiosDisk.cpp =================================================================== --- branches/rewrite/i386/modules/BiosDisk/BiosDisk.cpp (revision 1074) +++ branches/rewrite/i386/modules/BiosDisk/BiosDisk.cpp (revision 1075) @@ -2,15 +2,39 @@ * Copyright (c) 2011 Evan Lojewski. All rights reserved. * */ -#include -#include -#include +#include -extern "C" + +BiosDisk::BiosDisk(const char* name) { - void BiosDisk_start(); + busType = "bios"; + + // fixme + if(name[0] != 'b' && + name[1] != 'i' && + name[2] != 'o' && + name[3] != 's' && + name[4] != ':') name = NULL; + + mName = name; + + // TODO: convert mName to bios disk id } -void BiosDisk_start() +BiosDisk::~BiosDisk() { -} \ No newline at end of file + +} + +IOReturn BiosDisk::Read(UInt64 sector, UInt64 size, char* buffer) +{ + if(!isValid()) return kIOReturnNoDevice; + return kIOReturnSuccess; +} + + +IOReturn BiosDisk::Write(UInt64 sector, UInt64 size, char* buffer) +{ + if(!isValid()) return kIOReturnNoDevice; + return kIOReturnNotWritable; +} Index: branches/rewrite/i386/modules/BiosDisk/Disk.cpp =================================================================== --- branches/rewrite/i386/modules/BiosDisk/Disk.cpp (revision 0) +++ branches/rewrite/i386/modules/BiosDisk/Disk.cpp (revision 1075) @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2011 Evan Lojewski. All rights reserved. + * + */ +#include + + +Disk::Disk() +{ + mName = NULL; +} + +Disk::~Disk() +{ + +} \ No newline at end of file Index: branches/rewrite/i386/modules/BiosDisk/Makefile =================================================================== --- branches/rewrite/i386/modules/BiosDisk/Makefile (revision 1074) +++ branches/rewrite/i386/modules/BiosDisk/Makefile (revision 1075) @@ -8,6 +8,6 @@ DIR = BiosDisk -MODULE_OBJS = BiosDisk.o +MODULE_OBJS = Disk.o BiosDisk.o Main.o include ../MakeInc.dir \ No newline at end of file