diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index 1992eda..ca2debe 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:06:54 reddawg + UbixOS v1.0 + Revision 1.3 2004/04/13 16:36:33 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -69,6 +72,7 @@ int devFSOpen(char *file,fileDescriptor *fd) { struct devFsInfo *fsInfo = fd->mp->fsInfo; struct devFsDevices *tmpDev = 0x0; + struct driveDriver *drive = 0x0; kprintf("Opening DevFS File [0x%X]\n",fsInfo->deviceList); for (tmpDev = fsInfo->deviceList;tmpDev != 0x0;tmpDev = tmpDev->next) { kprintf("[%s][%s]\n",tmpDev->devName,file); @@ -78,8 +82,9 @@ case 0: case 1: kprintf("Opened Device: [%s]\n",tmpDev->devName); + drive = findDrive(tmpDev->devMajor); (void *)fd->start = tmpDev; - (void *)fd->size = 4096; + (void *)fd->size = drive->size; break; default: kprintf("Invalid File Mode\n"); diff --git a/src/sys/include/sys/drives.h b/src/sys/include/sys/drives.h index 01d78c5..9439aea 100644 --- a/src/sys/include/sys/drives.h +++ b/src/sys/include/sys/drives.h @@ -47,8 +47,9 @@ struct driveDriver *prev; struct driveDriver *next; struct driveDiskLabel *diskLabel; - int id; - void *driveInfoStruct; + int id; + uInt32 size; + void *driveInfoStruct; char driveType; void (*read)(void *,long,long,void *); void (*write)(void *,long,long,void *); @@ -59,7 +60,7 @@ extern struct driveDriver *drives; extern int currentDrive; -void addDrive(int id,char type,void *driveInfoStruct,void *read,void *write,void *reset); +void addDrive(int id,char type,void *driveInfoStruct,void *read,void *write,void *reset,uInt32 size); struct driveDriver *findDrive(int id); #endif diff --git a/src/sys/isa/fdc.c b/src/sys/isa/fdc.c index eb37de2..8437ef6 100644 --- a/src/sys/isa/fdc.c +++ b/src/sys/isa/fdc.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.2 2004/04/22 21:20:05 reddawg + FDC now adds drives to the devfs + Revision 1.1.1.1 2004/04/15 12:07:09 reddawg UbixOS v1.0 @@ -64,7 +67,7 @@ setVector(floppyIsr, mVec+6, (dInt+dPresent)); irqEnable(6); reset(); - addDrive(0,0,0x0,fdcRead,fdcWrite,0x0); + addDrive(0,0,0x0,fdcRead,fdcWrite,0x0,(1024 * 1450)); devFsMkNod("fd0",'b',0x0,0x0); return; } diff --git a/src/sys/pci/hd.c b/src/sys/pci/hd.c index 5f5da20..2cdd6de 100644 --- a/src/sys/pci/hd.c +++ b/src/sys/pci/hd.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:16 reddawg + UbixOS v1.0 + Revision 1.12 2004/04/13 16:36:33 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -60,7 +63,7 @@ hdd3->hdPort = 0x177; hdd3->hdDev = 0x50; if (!initDrive(hdd0)) { - addDrive(1,1,hdd0,hdRead,hdWrite,0x0); + addDrive(1,1,hdd0,hdRead,hdWrite,0x0,hdd0->hdSize*512); devFsMkNod("ad0",'b',0x1,0x0); } /* diff --git a/src/sys/sys/drives.c b/src/sys/sys/drives.c index 472e21b..8b71a38 100644 --- a/src/sys/sys/drives.c +++ b/src/sys/sys/drives.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:17 reddawg + UbixOS v1.0 + Revision 1.2 2004/04/13 16:36:34 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -40,7 +43,7 @@ struct driveDriver *drives = 0x0; int currentDrive = 0x0; -void addDrive(int id,char type,void *driveInfoStruct,void *read,void *write,void *reset) { +void addDrive(int id,char type,void *driveInfoStruct,void *read,void *write,void *reset,uInt32 size) { struct driveDriver *tmp = 0x0; tmp = (struct driveDriver *)kmalloc(sizeof(struct driveDriver),-2); tmp->driveInfoStruct = driveInfoStruct; @@ -49,6 +52,7 @@ tmp->reset = reset; tmp->id = id; tmp->driveType = type; + tmp->size = size; if (!drives) { tmp->next = 0x0; tmp->prev = 0x0;