diff --git a/src/Makefile.inc b/src/Makefile.inc index dcb3dc0..94e6331 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -3,8 +3,8 @@ # allow you to change your default compiler without affecting your other work CFLAGS = -CC = gcc -CXX = g++ +CC = gcc32 +CXX = g++32 LD = ld AR = ar REMOVE = rm -rf diff --git a/src/bin/init/main.c b/src/bin/init/main.c index 284aa16..d4f1f44 100644 --- a/src/bin/init/main.c +++ b/src/bin/init/main.c @@ -80,6 +80,8 @@ } #endif + printf("Forking"); + startup: i = fork(); printf("We Forked\n"); diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index a3471d6..f103314 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -3,6 +3,6 @@ LDFLAGS = -Bshareable #CFLAGS = -fpic -DPIC -O2 -fno-strict-aliasing -pipe -D__DBINTERFACE_PRIVATE -DPOSIX_MISTAKE -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -DYP -DHESIOD -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -CFLAGS = -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe +CFLAGS = -fno-builtin -Wno-uninitialized -O -fno-strict-aliasing -pipe INCLUDES = -I../include -I../../../include -I../i386 -I../include diff --git a/src/lib/libc_old/sys/fork.c b/src/lib/libc_old/sys/fork.c index 66816b1..c8a8424 100644 --- a/src/lib/libc_old/sys/fork.c +++ b/src/lib/libc_old/sys/fork.c @@ -32,6 +32,7 @@ pid_t fork() { volatile pid_t pid = 0x0; + asm volatile( "pushl %%eax\n" "pushl %%ecx\n" @@ -53,6 +54,9 @@ /*** $Log$ + Revision 1.1.1.1 2007/01/17 03:30:21 reddawg + UbixOS + Revision 1.6 2004/08/25 22:02:41 reddawg task switching - We now are using software switching to be consistant with the rest of the world because all of this open source freaks gave me a hard time about something I liked. There doesn't seem to be any gain in performance but it is working fine and flawlessly diff --git a/src/sys/kernel/fork.c b/src/sys/kernel/fork.c index 5b03f65..48084b6 100644 --- a/src/sys/kernel/fork.c +++ b/src/sys/kernel/fork.c @@ -92,10 +92,11 @@ newProcess->tss.cr3 = (uInt32)vmmCopyVirtualSpace(newProcess->id); newProcess->state = FORK; - /* Fix gcc optimization problems */ while (tmpProcPtr->state == FORK) sched_yield(); + kprintf("Copied Space\n: [%i]",newProcess->id); + /* Return Id of Proccess */ return(newProcess->id); } diff --git a/src/sys/vmm/vmm_virtual.c b/src/sys/vmm/vmm_virtual.c index 51d7300..eb297d6 100644 --- a/src/sys/vmm/vmm_virtual.c +++ b/src/sys/vmm/vmm_virtual.c @@ -412,6 +412,8 @@ /* Alloc A New Page For This Stack Page */ if ((newStackPage = (uInt32 *) vmmGetFreeKernelPage(pid,1)) == 0x0) kpanic("Error: newStackPage == NULL, File: %s, Line: %i\n",__FILE__,__LINE__); + + memset(newStackPage,0x0,0x1000); /* Set Pointer To Parents Stack Page */ parentStackPage = (uInt32 *) (((1024 * 4096) * x) + (4096 * i));