diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index 09b3139..f8086d3 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -24,6 +24,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.3 2004/04/28 02:22:54 reddawg + This is a fiarly large commit but we are starting to use new driver model + all around + Revision 1.2 2004/04/26 22:22:33 reddawg DevFS now uses correct size of device @@ -88,6 +92,7 @@ device = deviceFind(tmpDev->devMajor,tmpDev->devMinor); (void *)fd->start = tmpDev; (void *)fd->size = device->size; + kprintf("SIZE: [%i]\n",device->size); break; default: kprintf("Invalid File Mode\n"); diff --git a/src/sys/include/pci/hd.h b/src/sys/include/pci/hd.h index 15217a7..7c029b3 100644 --- a/src/sys/include/pci/hd.h +++ b/src/sys/include/pci/hd.h @@ -29,7 +29,6 @@ }; void initHardDisk(); -int initDrive(struct driveInfo *); void hdWrite(struct driveInfo *hdd,void *,uInt32,uInt32); void hdRead(struct driveInfo *hdd,void *,uInt32,uInt32); int hdReset(); @@ -37,7 +36,7 @@ int hdStart(); int hdStop(); int hdStandby(); -int hdInit(); +int hdInit(struct deviceNode *dev); extern struct driveInfo *hdd0; extern struct driveInfo *hdd1; diff --git a/src/sys/pci/hd.c b/src/sys/pci/hd.c index 6ff63f6..1c89456 100644 --- a/src/sys/pci/hd.c +++ b/src/sys/pci/hd.c @@ -24,6 +24,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.4 2004/04/28 02:22:54 reddawg + This is a fiarly large commit but we are starting to use new driver model + all around + Revision 1.3 2004/04/27 21:05:19 reddawg Updating drivers to use new model @@ -68,11 +72,8 @@ hdd2->hdDev = 0x40; hdd3->hdPort = 0x177; hdd3->hdDev = 0x50; - if (!initDrive(hdd0)) { - //addDrive(1,1,hdd0,hdRead,hdWrite,0x0,hdd0->hdSize*512); - deviceAdd(1,0,'c',hdRead,hdWrite,hdReset,hdInit,hdIoctl,hdStop,hdStart,hdStandby,hdd0); - devFsMkNod("ad0",'c',0x1,0x0); - } + deviceAdd(1,0,'c',hdRead,hdWrite,hdReset,hdInit,hdIoctl,hdStop,hdStart,hdStandby,hdd0); + devFsMkNod("ad0",'c',0x1,0x0); /* if (!initDrive(hdd1)) { addDrive(2,1,hdd1,hdRead,hdWrite,0x0); @@ -87,10 +88,6 @@ return; } -int hdInit() { - return(0x0); - } - int hdStandby() { return(0x0); } @@ -111,10 +108,11 @@ return(0x0); } -int initDrive(struct driveInfo *hdd) { +int hdInit(struct deviceNode *dev) { char retVal = 0x0; long counter = 0x0; short *tmp = 0x0; + struct driveInfo *hdd = dev->info; for (counter = 1000000;counter >= 0;counter--) { retVal = inportByte(hdd->hdPort + hdStat) & 0x80; if (!retVal) goto ready; @@ -182,7 +180,8 @@ hdd->hdSize = (hdd->hdSector[0x7B] * 256 * 256 * 256) + (hdd->hdSector[0x7A] * 256 * 256) + (hdd->hdSector[0x79] * 256) + hdd->hdSector[0x78]; hdd->hdEnable = 1; kprintf("Drive: [0x%X/0x%X], Size: [%iSectors/%iKBytes]\n",hdd->hdPort,hdd->hdDev,hdd->hdSize,((hdd->hdSize*512)/1024)); - return(0); + dev->size = hdd->hdSize*512; + return(0x0); } void hdWrite(struct driveInfo *hdd,void *baseAddr,uInt32 startSector,uInt32 sectorCount) {