diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index 4f2a397..4405da8 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -36,14 +36,13 @@ #include #include #include +#include - +/* Spinlock for devfs we should start converting to sem/mutex */ static spinLock_t devfsSpinLock = SPIN_LOCK_INITIALIZER; - int devfs_init() { - //Add DevFS i will - + /* Build our devfs struct */ struct fileSystem devFS = {NULL, /* prev */ NULL, /* next */ @@ -58,21 +57,23 @@ 1 /* vfsType */ }; /* devFS */ -/* mji - * if (vfsRegisterFS(1,devFSInit,devFSRead,devFSWrite,devFSOpen,0x0,0x0,0x0,0x0) != 0x0) { - */ if (vfsRegisterFS(devFS) != 0x0) { //sysErr(systemErr,"Unable To Enable DevFS"); return(0x1); } - //Return - mount(0x0,0x0,0x0,0x1,"devfs","rw"); // Mount Device File System + /* Mount our devfs this will build the devfs container node */ + mount(0x0,0x0,0x0,0x1,"devfs","rw"); // Mount Device File System + + /* Return */ return(0x0); } void devFSInit(struct mountPoints *mp) { struct devFsInfo *fsInfo = 0x0; + + /* Allocate memory for the fsInfo */ mp->fsInfo = (struct devFsInfo *)kmalloc(sizeof(struct devFsInfo)); + assert(mp->fsInfo); fsInfo = mp->fsInfo; fsInfo->deviceList = 0x0; @@ -83,7 +84,7 @@ } int devFSOpen(char *file,fileDescriptor *fd) { - struct devFsInfo *fsInfo = fd->mp->fsInfo; + struct devFsInfo *fsInfo = fd->mp->fsInfo; struct devFsDevices *tmpDev = 0x0; struct deviceNode *device = 0x0; @@ -96,7 +97,7 @@ case 1: device = deviceFind(tmpDev->devMajor,tmpDev->devMinor); (void *)fd->start = tmpDev; - (void *)fd->size = device->size; + fd->size = device->size; break; default: kprintf("Invalid File Mode\n"); @@ -212,6 +213,11 @@ /*** $Log$ + Revision 1.12 2004/07/16 20:17:29 flameshadow + chg: broke the ufs stuff + chg: changed vfsRegisterFS() to accept a fileSystem struct + chg: modified calls to vfsRegisterFS() to pass fileSystem struct + Revision 1.11 2004/07/14 12:17:52 reddawg devfs: devFSEnable to devfs_init Changed Startup Routines