diff --git a/include/ubixfs.h b/include/ubixfs.h index 2eca682..bb4944b 100644 --- a/include/ubixfs.h +++ b/include/ubixfs.h @@ -30,18 +30,23 @@ #ifndef __UBIXFS_H_ #define __UBIXFS_H_ -#include +#include -class UbixFS { +class UbixFS : public fsAbstract { public: int init(dev_t *); int read(dev_t *,void *,uInt32,uInt32); }; + +UbixFS *ubixfs_fn(); #endif /*** $Log$ + Revision 1.4 2004/08/13 17:07:32 reddawg + Works + Revision 1.3 2004/08/13 16:58:57 reddawg test diff --git a/main.cc b/main.cc index cffd23c..554469f 100644 --- a/main.cc +++ b/main.cc @@ -35,17 +35,22 @@ int main(int argc,char **argv) { char data[512]; vfs *ubixfs_VFS = new(vfs); - + + /* this would really be vfs_find(fs type) */ + ubixfs_VFS->fs = ubixfs_fn(); + /* this would really be dev_findDev(major,minor); */ ubixfs_VFS->dev = dev_ramDrive(); ubixfs_VFS->vfs_initFS(); - ubixfs_VFS->vfs_read(&data,0,1); return(0x0); } /*** $Log$ + Revision 1.3 2004/08/13 17:07:32 reddawg + Works + Revision 1.2 2004/08/13 16:51:55 reddawg Start of ubixfs shell diff --git a/ramdrive.cc b/ramdrive.cc index aa2ca49..f999307 100644 --- a/ramdrive.cc +++ b/ramdrive.cc @@ -29,13 +29,20 @@ #include #include +#include #include +char *ram_data = 0x0; + + static int ramDrive_read(dev_t *dev,void *ptr,uInt32 length,uInt32 offset) { - printf("READ!!!\n"); - return(0x0); + char *data = ram_data + offset; + + memcpy(ptr,data,length); + + return(length); } dev_t *dev_ramDrive() { @@ -43,6 +50,13 @@ ramDrive = (dev_t *)malloc(sizeof(dev_t)); + ram_data = (char *)malloc(1024 * 1024 * 40); + + ram_data[0] = '1'; + ram_data[1] = '2'; + ram_data[2] = '3'; + ram_data[3] = '\0'; + ramDrive->major = 0x1; ramDrive->read = ramDrive_read; @@ -52,6 +66,9 @@ /*** $Log$ + Revision 1.4 2004/08/13 17:07:32 reddawg + Works + Revision 1.3 2004/08/13 16:58:57 reddawg test diff --git a/ubixfs.cc b/ubixfs.cc index 8cf1219..f141299 100644 --- a/ubixfs.cc +++ b/ubixfs.cc @@ -33,7 +33,13 @@ #include int UbixFS::init(dev_t *dev) { - printf("Initializing UbixFS: [%i]\n",dev->major); + char superBlock[1024]; + + printf("Initializing UbixFS: [%s][%i]\n",name,dev->major); + /* Load our super block */ + dev->read(dev,&superBlock,1024,0x0); + + printf("superBlock: [%s]\n",superBlock); return(0x0); } @@ -42,9 +48,21 @@ dev->read(dev,ptr,length,offset); return(length); } + +/* This would be like the very top level of the ubixfs driver it sets it up into memory */ +UbixFS *ubixfs_fn() { + UbixFS *tmpFS = new(UbixFS); + + sprintf(tmpFS->name,"UbixFS"); + + return(tmpFS); + } /*** $Log$ + Revision 1.2 2004/08/13 17:07:32 reddawg + Works + Revision 1.1 2004/08/13 16:58:57 reddawg test