diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 2022885..e9936d6 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -170,7 +170,9 @@ } */ execThread(idleTask,(uInt32)(kmalloc(0x2000)+0x2000),0x0); + kprintf("A"); execFile("init",0x0,0x0,0x0); + kprintf("B"); //execFile("shell",0x0,0x0,0x0); kprintf("Free Pages: [%i]\n",freePages); kprintf("MemoryMap: [0x%X]\n",vmmMemoryMap); @@ -230,6 +232,9 @@ /*** $Log$ + Revision 1.26 2004/05/20 22:54:02 reddawg + Cleaned Up Warrnings + Revision 1.25 2004/05/19 17:28:28 reddawg Added the correct endTask Procedure diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 29cdd40..dc56f91 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -190,6 +190,8 @@ fseek(tmpFd,binaryHeader->ePhoff,0); fread(programHeader,(sizeof(elfProgramheader)*binaryHeader->ePhnum),1,tmpFd); + kprintf("1"); + /* Loop Through The Header And Load Sections Which Need To Be Loaded */ for (i=0;iePhnum;i++) { if (programHeader[i].phType == 1) { @@ -219,15 +221,13 @@ } } + kprintf("2"); /* Set Virtual Memory Start */ _current->oInfo.vmStart = ((programHeader[i].phVaddr & 0xFFFFF000) + 0x1900000); /* Get The Starting Point */ eStart = binaryHeader->eEntry; - /* Now That We Relocated The Binary We Can Unmap And Free Old Pages */ - for (i=0;i<((tmpFd->size+4095)/4096);i++) { - vmmUnmapPage((0x7C0000 + (0x1000 * i)),0); - } + /* Now Lets Make A Clean Stack */ newLoc = (char *)0x5DB000; vmmRemapPage(vmmFindFreePage(_current->id),0x5DC000); @@ -451,6 +451,9 @@ /*** $Log$ + Revision 1.9 2004/05/21 15:34:23 reddawg + Fixed a couple of typo + Revision 1.8 2004/05/21 15:32:06 reddawg Changed the sys fileExec works it just loads sections needed now instead of fully should be a performance increase of about 40% diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 6efd915..79568f8 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,8 @@ extern union descriptorTableUnion ubixGDT[5]; +static spinLock_t schedSpinLock = SPIN_LOCK_INITIALIZER; + kTask_t *taskList = 0x0; uInt32 nextID = -1; kTask_t *_current = 0x0; @@ -81,8 +84,10 @@ void sched() { uInt32 memAddr = 0x0; kTask_t *tmpTask = 0x0; - struct tssStruct *gpfTSS = (struct tssStruct *)0x4200; + + spinLock(&schedSpinLock); + gpfTSS->eip = (unsigned int)&_int13; gpfTSS->esp = 0x1CFFF; gpfTSS->ebp = 0x1CFFF; @@ -114,8 +119,10 @@ ubixGDT[4].descriptor.baseMed = ((memAddr >> 16) & 0xFF); ubixGDT[4].descriptor.baseHigh = (memAddr >> 24); ubixGDT[4].descriptor.access = '\x89'; + spinUnlock(&schedSpinLock); asm("ljmp $0x20,$0\n"); } + spinUnlock(&schedSpinLock); return; } /* sched() */ @@ -211,6 +218,9 @@ /*** $Log$ + Revision 1.6 2004/05/21 15:49:13 reddawg + The os does better housekeeping now when a task is exited + Revision 1.5 2004/05/21 12:44:17 reddawg Cleaned Up diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index 8b51cfa..6eef03f 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -157,14 +157,18 @@ void sysStartSDE() { int i = 0x0; execThread(sdeThread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); - for (i=0;i<500;i++) { - schedYield(); + for (i=0;i<1400;i++) { + //schedYield(); + asm("hlt"); } return; } /*** $Log$ + Revision 1.8 2004/05/21 12:46:02 reddawg + Cleaned up + Revision 1.7 2004/05/19 17:28:28 reddawg Added the correct endTask Procedure