diff --git a/src/bin/shell/commands.c b/src/bin/shell/commands.c index 9791c1c..a7c24d9 100644 --- a/src/bin/shell/commands.c +++ b/src/bin/shell/commands.c @@ -63,7 +63,6 @@ cPid = fork(); if (cPid == 0x0) { printf("Pid: [%i]\n",cPid); - sched_yield(); exec("clock",0x0,0x0); exit(0x1); } diff --git a/src/sys/kernel/fork.c b/src/sys/kernel/fork.c index a982daa..cea6b73 100644 --- a/src/sys/kernel/fork.c +++ b/src/sys/kernel/fork.c @@ -69,6 +69,8 @@ assert(_current); /* Set Up New Tasks Information */ + newProcess->tss.eip = eip; + sprintf(newProcess->oInfo.cwd,_current->oInfo.cwd); newProcess->uid = _current->uid; newProcess->gid = _current->gid; newProcess->tss.back_link = 0x0; @@ -96,10 +98,8 @@ newProcess->tss.ldt = 0x18; newProcess->tss.trace_bitmap = 0x0000; newProcess->tss.io_map = 0x8000; - newProcess->tss.eip = eip; /* Create A Copy Of The VM Space For New Task */ - newProcess->tss.cr3 = (uInt32)vmmCopyVirtualSpace(newProcess->id); - sprintf(newProcess->oInfo.cwd,_current->oInfo.cwd); + newProcess->tss.cr3 = (uInt32)vmmCopyVirtualSpace(newProcess->id); newProcess->state = READY; /* Return Id of Proccess */ return(newProcess->id); @@ -107,6 +107,9 @@ /*** $Log$ + Revision 1.14 2004/07/24 20:00:51 reddawg + Lots of changes to the vmm subsystem.... Page faults have been adjust to now be blocking on a per thread basis not system wide. This has resulted in no more deadlocks.. also the addition of per thread locking has removed segfaults as a result of COW in which two tasks fault the same COW page and try to modify it. + Revision 1.13 2004/07/21 17:11:18 reddawg A Quick tweak I'm going to clean up some unused variables in sched.h diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 5d7eaec..049edf7 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -145,11 +145,10 @@ kTask_t *tmpTask = 0x0; struct tssStruct *gpfTSS = (struct tssStruct *)0x4200; - //spinLock(&schedSpinLock); gpfTSS->eip = (unsigned int)&_int13; - gpfTSS->esp = 0x1CFFF; - gpfTSS->ebp = 0x1CFFF; + gpfTSS->esp = 0x1D000; + gpfTSS->ebp = 0x1D000; gpfTSS->eflags = 0x206; schedStart: @@ -179,24 +178,20 @@ /* Setting the timeslice this task is allowed to run */ systemVitals->quantum = _current->timeSlice; - memAddr = (uInt32)&(_current->tss); + if (_current->state > 0x0) { 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'; - - //spinUnlock(&schedSpinLock); - asm("ljmp $0x20,$0\n"); } - //spinUnlock(&schedSpinLock); - return; } @@ -316,8 +311,8 @@ ************************************************************************/ void schedYield() { - sched(); -} + sched(); + } /************************************************************************ @@ -338,6 +333,9 @@ /*** $Log$ + Revision 1.19 2004/07/24 15:12:56 reddawg + Now I'm current + Revision 1.18 2004/07/21 10:02:09 reddawg devfs: renamed functions device system: renamed functions diff --git a/src/sys/vmm/copyvirtualspace.c b/src/sys/vmm/copyvirtualspace.c index 2c84d7a..29a7b0a 100644 --- a/src/sys/vmm/copyvirtualspace.c +++ b/src/sys/vmm/copyvirtualspace.c @@ -60,7 +60,7 @@ /* Set newPageDirectoryAddress To The Newly Created Page Directories Page */ newPageDirectoryAddress = vmmGetPhysicalAddr((uInt32) newPageDirectory); /* First Set Up A Flushed Page Directory */ - for (x = 0; x < pageEntries; x++) { + for (x = 0x0; x < pageEntries; x++) { newPageDirectory[x] = (uInt32) 0x0; } /* Map The Top 1GB Region Of The VM Space */ @@ -182,6 +182,9 @@ /*** $Log$ + Revision 1.4 2004/07/20 22:29:55 reddawg + assert: remade assert + Revision 1.3 2004/07/19 01:58:12 reddawg vmmCopyVirtualSpace: cleaned up one full page memory leak we were still using old sysID over pid