diff --git a/src/sys/kernel/Makefile b/src/sys/kernel/Makefile index 8124413..1720019 100644 --- a/src/sys/kernel/Makefile +++ b/src/sys/kernel/Makefile @@ -6,7 +6,7 @@ include ../Makefile.inc # Objects -OBJS = tty.o sys_call.o endtask.o spinlock.o bioscall.o ld.o time.o fork.o syscall.o elf.o file.o systemtask.o exec.o sched.o kpanic.o vitals.o ubthread.o timer.o +OBJS = schedyield.o tty.o sys_call.o endtask.o spinlock.o bioscall.o ld.o time.o fork.o syscall.o elf.o file.o systemtask.o exec.o sched.o kpanic.o vitals.o ubthread.o timer.o # ap-boot.o smp.o all: $(OBJS) diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 325f842..75f590c 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -259,6 +259,7 @@ void sched_yield() { //sched(); + //asm("int $0x69"); asm("hlt"); } @@ -282,6 +283,24 @@ /*** $Log$ + Revision 1.44 2004/08/26 22:51:18 reddawg + TCA touched me :( i think he likes men.... + + + sched.h: kTask_t added parentPid + endtask.c: fixed term back to parentPid + exec.c: cleaned warnings + fork.c: fixed term to childPid + sched.c: clean up for dead tasks + systemtask.c: clean up dead tasks + kmalloc.c: cleaned up warnings + udp.c: cleaned up warnings + bot.c: cleaned up warnings + shell.c: cleaned up warnings + tcpdump.c: took a dump + hd.c: cleaned up warnings + ubixfs.c: stopped prning debug info + Revision 1.43 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/schedyield.S b/src/sys/kernel/schedyield.S new file mode 100644 index 0000000..3a85cf6 --- /dev/null +++ b/src/sys/kernel/schedyield.S @@ -0,0 +1,54 @@ +/***************************************************************************************** + Copyright (c) 2002-2004 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$ + +*****************************************************************************************/ + +.globl sched_yield_new +.text +.code32 +sched_yield_new: + pusha /* Save all of the registers */ + push %ss + push %ds + push %es + push %fs + push %gs + call sched + mov %eax,%esp + pop %gs + pop %fs + pop %es + pop %ds + pop %ss + popa /* Restore Registers */ + iret + +/*** + $Log$ + END + ***/ + diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index 1fdcae3..ed2318e 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -170,7 +170,8 @@ } void sysSchedYield() { - sched_yield(); + //asm("int $0x69"); + asm("hlt"); } void sysStartSDE() { @@ -187,6 +188,9 @@ /*** $Log$ + Revision 1.28 2004/08/21 20:06:28 reddawg + ok check out exec.c + Revision 1.27 2004/08/06 22:43:04 reddawg ok diff --git a/src/sys/kernel/systemtask.c b/src/sys/kernel/systemtask.c index 7809d1d..56adabc 100644 --- a/src/sys/kernel/systemtask.c +++ b/src/sys/kernel/systemtask.c @@ -99,16 +99,35 @@ delList = tmpTask->next; //kfree(tmpTask->oInfo.cwd); - kfree(tmpTask); + //kfree(tmpTask); } sched_yield(); - } + } + return; } /*** $Log$ + Revision 1.15 2004/08/26 22:51:18 reddawg + TCA touched me :( i think he likes men.... + + + sched.h: kTask_t added parentPid + endtask.c: fixed term back to parentPid + exec.c: cleaned warnings + fork.c: fixed term to childPid + sched.c: clean up for dead tasks + systemtask.c: clean up dead tasks + kmalloc.c: cleaned up warnings + udp.c: cleaned up warnings + bot.c: cleaned up warnings + shell.c: cleaned up warnings + tcpdump.c: took a dump + hd.c: cleaned up warnings + ubixfs.c: stopped prning debug info + Revision 1.14 2004/08/24 23:33:45 reddawg Fixed diff --git a/src/sys/kernel/timer.S b/src/sys/kernel/timer.S index 1308db1..466c2c0 100644 --- a/src/sys/kernel/timer.S +++ b/src/sys/kernel/timer.S @@ -37,9 +37,6 @@ push %es push %fs push %gs - mov $0x20,%dx /* The Following Sends Our EOI To The MPIC */ - mov $0x20,%ax - outb %al,%dx movl systemVitals,%ecx /* Put Location Of System Vitals Into ECX */ incl 4(%ecx) /* Increment sysTicks our 1000ms counter */ movl 4(%ecx),%eax /* Increment our sysUptime by 1S if 1000MS */ @@ -59,6 +56,9 @@ call sched mov %eax,%esp timer_done: + mov $0x20,%dx /* The Following Sends Our EOI To The MPIC */ + mov $0x20,%ax + outb %al,%dx pop %gs pop %fs pop %es @@ -69,6 +69,9 @@ /*** $Log$ + Revision 1.9 2004/08/24 05:24:37 reddawg + TCA Is A BONER!!!! + Revision 1.8 2004/08/21 23:47:50 reddawg *** empty log message ***