diff --git a/src/bin/init/Makefile b/src/bin/init/Makefile index 6779c67..fcce08f 100644 --- a/src/bin/init/Makefile +++ b/src/bin/init/Makefile @@ -20,7 +20,7 @@ #Startup File STARTUP = ../../lib/ubix/startup.o -LIBRARIES = ../../lib/libc_old/libc_old.so +#LIBRARIES = ../../lib/libc_old/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/sys/include/sys/device.h b/src/sys/include/sys/device.h index b2e82a5..b07a38a 100644 --- a/src/sys/include/sys/device.h +++ b/src/sys/include/sys/device.h @@ -47,12 +47,13 @@ }; struct device_interface { - int major; - void *info; + uInt8 initialized; + int major; + void *info; void (*read)(void *,void *,uInt32,uInt32); void (*write)(void *,void *,uInt32,uInt32); void (*reset)(void *); - int (*init)(void *); + int (*init)(void *); void (*ioctl)(void *); void (*stop)(void *); void (*start)(void *); @@ -67,6 +68,18 @@ /*** $Log$ + Revision 1.12 2004/07/21 10:02:09 reddawg + devfs: renamed functions + device system: renamed functions + fdc: fixed a few potential bugs and cleaned up some unused variables + strol: fixed definition + endtask: made it print out freepage debug info + kmalloc: fixed a huge memory leak we had some unhandled descriptor insertion so some descriptors were lost + ld: fixed a pointer conversion + file: cleaned up a few unused variables + sched: broke task deletion + kprintf: fixed ogPrintf definition + Revision 1.11 2004/05/22 02:40:04 ionix diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 3cf37fb..299c414 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -102,14 +102,14 @@ kprintf("Problem Mounting HD Mount Point\n"); } */ - + initHardDisk(); execThread(systemTask,(uInt32)(kmalloc(0x2000)+0x2000),0x0); execFile("sys:/init",0x0,0x0,0x1); //execFile("sys:/login",0x0,0x0,0x1); - //execFile("sys:/login",0x0,0x0,0x2); - //execFile("sys:/login",0x0,0x0,0x3); - //execFile("sys:/login",0x0,0x0,0x4); + execFile("sys:/login",0x0,0x0,0x2); + execFile("sys:/login",0x0,0x0,0x3); + execFile("sys:/login",0x0,0x0,0x4); kprintf("Free Pages: [%i]\n",systemVitals->freePages); kprintf("MemoryMap: [0x%X]\n",vmmMemoryMap); @@ -121,6 +121,9 @@ /*** $Log$ + Revision 1.71 2004/08/14 11:23:02 reddawg + Changes + Revision 1.70 2004/08/09 12:58:05 reddawg let me know when you got the surce diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 7adf2b0..80ce059 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -51,7 +51,7 @@ kTask_t *_current = 0x0; kTask_t *_usedMath = 0x0; -static kTask_t *sched_getRunTask() { +static kTask_t *sched_getRunableTask() { kTask_t *tmpTask = 0x0; tmpTask = _current->next; @@ -70,6 +70,7 @@ tmpTask = runList; goto schedStart; } + return(0x0); } @@ -115,19 +116,29 @@ uInt32 memAddr = 0x0; kTask_t *tmpTask = 0x0; - tmpTask = sched_getRunTask(); + tmpTask = sched_getRunableTask(); + if (tmpTask == 0x0) + kpanic("Error: sched_getRunableTask == 0x0\n"); - if (tmpTask != 0x0) { - _current = tmpTask; - if (_current->oInfo.v86Task == 0x1) - irqDisable(0x0); - memAddr = (uInt32)&(_current->tss); - ubixGDT[4].descriptor.baseLow = (memAddr & 0xFFFF); - ubixGDT[4].descriptor.baseMed = ((memAddr >> 16) & 0xFF); - ubixGDT[4].descriptor.baseHigh = (memAddr >> 24); - ubixGDT[4].descriptor.access = '\x89'; - asm("ljmp $0x20,$0\n"); - } + + /* Make this our now current task */ + _current = tmpTask; + + /* Test if it is a 16 bit task */ + if (_current->oInfo.v86Task == 0x1) + irqDisable(0x0); + + /* Update our TSS to new task info */ + memAddr = (uInt32)&(_current->tss); + ubixGDT[4].descriptor.baseLow = (memAddr & 0xFFFF); + ubixGDT[4].descriptor.baseMed = ((memAddr >> 16) & 0xFF); + ubixGDT[4].descriptor.baseHigh = (memAddr >> 24); + ubixGDT[4].descriptor.access = '\x89'; + + /* Jump to task */ + asm("ljmp $0x20,$0\n"); + + /* Return */ return; } @@ -269,6 +280,9 @@ /*** $Log$ + Revision 1.31 2004/08/14 11:23:02 reddawg + Changes + Revision 1.30 2004/08/09 12:58:05 reddawg let me know when you got the surce diff --git a/src/sys/pci/hd.c b/src/sys/pci/hd.c index 4bf930c..ddf3955 100644 --- a/src/sys/pci/hd.c +++ b/src/sys/pci/hd.c @@ -51,9 +51,6 @@ hdd0->hdPort = 0x1F0; hdd0->hdDev = 0x40; hdd0->parOffset = 0x0; - hdd0s1->hdPort = 0x1F0; - hdd0s1->hdDev = 0x40; - hdd0s1->parOffset = 63; hdd1->hdPort = 0x1F0; hdd1->hdDev = 0x50; hdd2->hdPort = 0x177; @@ -74,7 +71,25 @@ devInfo->info = hdd0; devInfo->major = 1; device_add(0,'c',devInfo); + + devInfo = (struct device_interface *)kmalloc(sizeof(struct device_interface)); + memcpy(hdd0s1,hdd0,sizeof(struct driveInfo)); + + hdd0s1->parOffset = 63; + devInfo->read = (void *)&hdRead; + devInfo->write = (void *)&hdWrite; + devInfo->reset = (void *)&hdReset; + devInfo->init = (void *)&hdInit; + devInfo->ioctl = (void *)&hdIoctl; + devInfo->stop = (void *)&hdStop; + devInfo->start = (void *)&hdStart; + devInfo->standby = (void *)&hdStandby; + devInfo->info = hdd0s1; + devInfo->major = 1; + device_add(1,'c',devInfo); + + //deviceAdd(1,0,'c',hdRead,hdWrite,hdReset,hdInit,hdIoctl,hdStop,hdStart,hdStandby,hdd0); //deviceAdd(1,1,'c',hdRead,hdWrite,hdReset,hdInit,hdIoctl,hdStop,hdStart,hdStandby,hdd0s1); devfs_makeNode("ad0",'c',0x1,0x0); @@ -185,7 +200,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)); - dev->size = hdd->hdSize*512; + dev->size = hdd->hdSize*512; + dev->devInfo->initialized = 0x1; return(0x0); } @@ -315,6 +331,9 @@ /*** $Log$ + Revision 1.13 2004/08/02 11:43:17 reddawg + Fixens + Revision 1.12 2004/07/21 10:02:09 reddawg devfs: renamed functions device system: renamed functions diff --git a/src/sys/sys/device.c b/src/sys/sys/device.c index b456f2e..4d625ee 100644 --- a/src/sys/sys/device.c +++ b/src/sys/sys/device.c @@ -63,8 +63,10 @@ devices = tmpDev; spinUnlock(&deviceSpinLock); - - return(tmpDev->devInfo->init(tmpDev)); + if (tmpDev->devInfo->initialized == 0x0) + return(tmpDev->devInfo->init(tmpDev)); + else + return(0x0); } /***************************************************************************************** @@ -136,6 +138,18 @@ /*** $Log$ + Revision 1.13 2004/07/21 10:02:09 reddawg + devfs: renamed functions + device system: renamed functions + fdc: fixed a few potential bugs and cleaned up some unused variables + strol: fixed definition + endtask: made it print out freepage debug info + kmalloc: fixed a huge memory leak we had some unhandled descriptor insertion so some descriptors were lost + ld: fixed a pointer conversion + file: cleaned up a few unused variables + sched: broke task deletion + kprintf: fixed ogPrintf definition + Revision 1.12 2004/07/17 03:32:22 reddawg assert()