diff --git a/src/sys/include/ubixos/fork.h b/src/sys/include/ubixos/fork.h new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/src/sys/include/ubixos/fork.h diff --git a/src/sys/init/main.c b/src/sys/init/main.c index f58e1df..90cd04c 100755 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -85,7 +85,6 @@ initFloppy(); //Initialize Floppy Controller initUbixFS(); execThread(idleThread,0xAFFF,"Idle Thread"); - execFile("init"); //execFile("shell"); //execThread(test,0xCFFF,"Test"); /* diff --git a/src/sys/kernel/Makefile b/src/sys/kernel/Makefile index 0db7a30..2a2c588 100755 --- a/src/sys/kernel/Makefile +++ b/src/sys/kernel/Makefile @@ -14,7 +14,7 @@ REMOVE = rm -fr # Objects -OBJS = io.o version.o kprintf.o vsprintf.o idt.o schedule.o exec.o dma.o idlethread.o syscall.o +OBJS = io.o version.o kprintf.o vsprintf.o idt.o schedule.o exec.o dma.o idlethread.o syscall.o fork.o all: $(OBJS) diff --git a/src/sys/kernel/fork.c b/src/sys/kernel/fork.c new file mode 100755 index 0000000..46958cc --- /dev/null +++ b/src/sys/kernel/fork.c @@ -0,0 +1,28 @@ +/************************************************************************************** + Copyright (c) 2002 The UbixOS Project + All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors +in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its +contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + $Id$ + +**************************************************************************************/ + +#include + +int fork() { + //Test + } \ No newline at end of file diff --git a/src/sys/kernel/idlethread.c b/src/sys/kernel/idlethread.c index f9b91f1..4ac3231 100755 --- a/src/sys/kernel/idlethread.c +++ b/src/sys/kernel/idlethread.c @@ -22,17 +22,15 @@ **************************************************************************************/ #include +#imclude #include -#include -#include void idleThread() { - unsigned char *testBuf = (char *)0x1000000; /* This thread is for maintinance */ - remapPage(0xB8000,0x1000000); + if (!fork()) { + execFile("init"); + } while (1) { - testBuf[0] = 'c'; - testBuf[1] = printColor; //kprintf("^"); //checkTasks(); /* Looks for run away proccesses and kills thems */ } diff --git a/ubixos.kdevprj b/ubixos.kdevprj index 0f43927..1320d76 100755 --- a/ubixos.kdevprj +++ b/ubixos.kdevprj @@ -354,7 +354,7 @@ type=DATA [src/sys/drivers/Makefile.am] -files=src/sys/drivers/Makefile,src/sys/drivers/video.c,src/sys/drivers/8259.c,src/sys/drivers/keyboard.c,src/sys/drivers/fdc.c +files=src/sys/drivers/Makefile,src/sys/drivers/video.c,src/sys/drivers/8259.c,src/sys/drivers/keyboard.c,src/sys/drivers/fdc.c,src/sys/drivers/pci_pio.c sub_dirs= type=static_library @@ -370,6 +370,12 @@ install_location= type=SOURCE +[src/sys/drivers/pci_pio.c] +dist=true +install=false +install_location= +type=SOURCE + [src/sys/drivers/video.c] dist=true install=false @@ -434,7 +440,7 @@ type=HEADER [src/sys/include/ubixos/Makefile.am] -files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h,src/sys/include/ubixos/elf.h,src/sys/include/ubixos/syscall.h,src/sys/include/ubixos/syscalls.h,src/sys/include/ubixos/a.out.h +files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h,src/sys/include/ubixos/elf.h,src/sys/include/ubixos/syscall.h,src/sys/include/ubixos/syscalls.h,src/sys/include/ubixos/a.out.h,src/sys/include/ubixos/fork.h sub_dirs= type=normal @@ -462,6 +468,12 @@ install_location= type=HEADER +[src/sys/include/ubixos/fork.h] +dist=true +install=false +install_location= +type=HEADER + [src/sys/include/ubixos/gdt.h] dist=true install=false @@ -564,10 +576,16 @@ type=DATA [src/sys/kernel/Makefile.am] -files=src/sys/kernel/Makefile,src/sys/kernel/io.c,src/sys/kernel/version.c,src/sys/kernel/kprintf.c,src/sys/kernel/vsprintf.c,src/sys/kernel/idt.c,src/sys/kernel/exec.c,src/sys/kernel/schedule.c,src/sys/kernel/dma.c,src/sys/kernel/idlethread.c,src/sys/kernel/syscall.c +files=src/sys/kernel/Makefile,src/sys/kernel/io.c,src/sys/kernel/version.c,src/sys/kernel/kprintf.c,src/sys/kernel/vsprintf.c,src/sys/kernel/idt.c,src/sys/kernel/exec.c,src/sys/kernel/schedule.c,src/sys/kernel/dma.c,src/sys/kernel/idlethread.c,src/sys/kernel/syscall.c,src/sys/kernel/bios32.c,src/sys/kernel/fork.c sub_dirs= type=static_library +[src/sys/kernel/bios32.c] +dist=true +install=false +install_location= +type=SOURCE + [src/sys/kernel/dma.c] dist=true install=false @@ -580,6 +598,12 @@ install_location= type=SOURCE +[src/sys/kernel/fork.c] +dist=true +install=false +install_location= +type=SOURCE + [src/sys/kernel/idlethread.c] dist=true install=false