diff --git a/src/sys/include/ubixos/fork.h b/src/sys/include/ubixos/fork.h index d8a9d98..2261090 100644 --- a/src/sys/include/ubixos/fork.h +++ b/src/sys/include/ubixos/fork.h @@ -35,12 +35,13 @@ void sysFork(); -int forkCopyProcess(struct taskStruct *newProcess,long ebp,long edi,long esi,long none,long ebx,long ecx,long edx,long eip,long cs,long eflags,long esp,long ss); - #endif /*** $Log$ + Revision 1.2 2004/05/21 15:20:00 reddawg + Cleaned up + END ***/ diff --git a/src/sys/kernel/fork.c b/src/sys/kernel/fork.c index 36685f1..21746f5 100644 --- a/src/sys/kernel/fork.c +++ b/src/sys/kernel/fork.c @@ -36,36 +36,17 @@ #include #include -/************************************************************************ +/***************************************************************************************** + Functoin: static int fork_copyProcess(struct taskStruct *newProcess,long ebp,long edi, + long esi, long none,long ebx,long ecx,long edx,long eip,long cs,long eflags, + long esp,long ss) + + Desc: This function will copy a process -Function: void sysFork(); -Description: This Function Forks A Task -Notes: + Notes: -08/01/02 - This Seems To Be Working Fine However I'm Not Sure If I - Chose The Best Path To Impliment It I Guess We Will See - What The Future May Bring - -************************************************************************/ -asm( - ".globl sysFork \n" - "sysFork: \n" - " xor %eax,%eax \n" - " call schedNewTask \n" - " testl %eax,%eax \n" - " je 1f \n" - " pushl %esi \n" - " pushl %edi \n" - " pushl %ebp \n" - " pushl %eax \n" - " call forkCopyProcess \n" - " movl %eax,(%ebx) \n" - " addl $16,%esp \n" - "1: \n" - " ret \n" - ); - -int forkCopyProcess(struct taskStruct *newProcess,long ebp,long edi,long esi,long none,long ebx,long ecx,long edx,long eip,long cs,long eflags,long esp,long ss) { +*****************************************************************************************/ +static int fork_copyProcess(struct taskStruct *newProcess,long ebp,long edi,long esi,long none,long ebx,long ecx,long edx,long eip,long cs,long eflags,long esp,long ss) { volatile struct taskStruct * tmpProcPtr = newProcess; assert(newProcess); assert(_current); @@ -113,80 +94,38 @@ /* Return Id of Proccess */ return(newProcess->id); } + +/***************************************************************************************** + Functoin: void sysFork(); + + Desc: This function will fork a new task + + Notes: + + 08/01/02 - This Seems To Be Working Fine However I'm Not Sure If I + Chose The Best Path To Impliment It I Guess We Will See + What The Future May Bring + +*****************************************************************************************/ +asm( + ".globl sysFork \n" + "sysFork: \n" + " xor %eax,%eax \n" + " call schedNewTask \n" + " testl %eax,%eax \n" + " je fork_ret \n" + " pushl %esi \n" + " pushl %edi \n" + " pushl %ebp \n" + " pushl %eax \n" + " call fork_copyProcess \n" + " movl %eax,(%ebx) \n" + " addl $16,%esp \n" + "fork_ret: \n" + " ret \n" + ); /*** $Log$ - Revision 1.32 2004/09/09 07:36:06 apwillia - Fix gcc 3.3 optimization problem. - - Revision 1.31 2004/09/07 21:54:38 reddawg - ok reverted back to old scheduling for now.... - - Revision 1.22 2004/08/09 12:58:05 reddawg - let me know when you got the surce - - Revision 1.21 2004/08/06 22:32:16 reddawg - Ubix Works Again - - Revision 1.19 2004/08/04 08:17:57 reddawg - tty: we have primative ttys try f1-f5 so it is easier to use and debug - ubixos - - Revision 1.18 2004/08/02 18:50:13 reddawg - Updates to make some variable volatile to make work with gcc 3.3. However there are still some issues but we have not caused new issues with gcc 2.95 - - Revision 1.17 2004/07/29 21:32:16 reddawg - My quick lunchs breaks worth of updates.... - - Revision 1.16 2004/07/28 00:17:05 reddawg - Major: - Disconnected page 0x0 from the system... Unfortunately this broke many things - all of which have been fixed. This was good because nothing deferences NULL - any more. - - Things affected: - malloc,kmalloc,getfreepage,getfreevirtualpage,pagefault,fork,exec,ld,ld.so,exec,file - - Revision 1.15 2004/07/25 06:04:00 reddawg - Last of my fixes for the morning - - 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 - - Revision 1.12 2004/07/20 22:29:55 reddawg - assert: remade assert - - Revision 1.11 2004/07/19 01:56:01 reddawg - fork: no mem leaks here - - Revision 1.10 2004/07/18 05:24:15 reddawg - Fixens - - Revision 1.9 2004/07/18 03:01:44 reddawg - Few changes to spinlock hopefully it will cure our deadlock - - Revision 1.8 2004/07/17 03:32:22 reddawg - assert() - - Revision 1.7 2004/07/17 03:10:18 reddawg - Added asserts no problems thusfar - - Revision 1.6 2004/06/26 01:24:44 reddawg - Fixens - - Revision 1.5 2004/06/15 12:24:07 reddawg - Cleaned Up - - Revision 1.4 2004/06/10 13:08:00 reddawg - Minor Bug Fixes - - Revision 1.3 2004/05/19 14:32:06 reddawg - Cleaned up some warning from leaving out typedefs - - Revision 1.2 2004/05/15 02:30:28 reddawg - Lots of changes END ***/