diff --git a/src/sys/include/sys/sched.h b/src/sys/include/sys/sched.h index 0e032fd..faf1d67 100644 --- a/src/sys/include/sys/sched.h +++ b/src/sys/include/sys/sched.h @@ -32,7 +32,8 @@ #include -int sched_init(); +int sched_init(); +void sched(); #endif diff --git a/src/sys/include/ubixos/init.h b/src/sys/include/ubixos/init.h index c1a76e0..cd6933b 100644 --- a/src/sys/include/ubixos/init.h +++ b/src/sys/include/ubixos/init.h @@ -34,7 +34,9 @@ #include #include #include +#include #include +#include #include #include @@ -48,7 +50,9 @@ idt_init, vmm_init, kmalloc_init, + vitals_init, mpi_init, + sched_init, device_init, fdc_init, }; @@ -60,4 +64,3 @@ /*** END ***/ - diff --git a/src/sys/include/ubixos/vitals.h b/src/sys/include/ubixos/vitals.h new file mode 100644 index 0000000..3c2daaa --- /dev/null +++ b/src/sys/include/ubixos/vitals.h @@ -0,0 +1,50 @@ +/***************************************************************************************** + 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$ + +*****************************************************************************************/ + +#ifndef _VITALS_H +#define _VITALS_H + +#include + +typedef struct vitalsStruct { + u_int32_t sysTicks; + u_int32_t sysUptime; + u_int32_t quantum; + } vitalsNode; + +extern vitalsNode *systemVitals; + +int vitals_init(); + +#endif + +/*** + END + ***/ + diff --git a/src/sys/kernel/Makefile b/src/sys/kernel/Makefile index e14cc29..e27d0ba 100644 --- a/src/sys/kernel/Makefile +++ b/src/sys/kernel/Makefile @@ -7,7 +7,7 @@ include ../Makefile.inc # Objects -OBJS = device.o kpanic.o +OBJS = sched.o timer.o vitals.o device.o kpanic.o all: $(OBJS) diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 88759ab..95576db 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -27,9 +27,17 @@ *****************************************************************************************/ +#include +#include + int sched_init() { + kprintf("initalizing scheduler\n"); return(0x0); } + +void sched() { + return; + } /*** END diff --git a/src/sys/kernel/vitals.c b/src/sys/kernel/vitals.c new file mode 100644 index 0000000..40dafab --- /dev/null +++ b/src/sys/kernel/vitals.c @@ -0,0 +1,72 @@ +/***************************************************************************************** + 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$ + +*****************************************************************************************/ + +#include +#include +#include +#include +#include + +vitalsNode *systemVitals = 0x0; + +/************************************************************************ + +Function: vitals_init(); +Description: This will enable the vitals subsystem for ubixos + +Notes: + +02/20/2004 - Approved Its Quality + +************************************************************************/ +int vitals_init() { + /* Initialize Memory For The System Vitals Node */ + systemVitals = (vitalsNode *) kmalloc(sizeof(vitalsNode)); + + /* If malloc Failed Then Error */ + if (systemVitals == 0x0) { + kpanic("Error: kmalloc Failed In initVitals\n"); + } + + /* Set all default values */ + memset(systemVitals,0x0,sizeof(vitalsNode)); + + systemVitals->quantum = 8; + + /* Print Out Info For Vitals: */ + kprintf("vitals0 - Address: [0x%X]\n",systemVitals); + + /* Return so kernel knows that there is no problem */ + return(0x0); + } + +/*** + END + ***/ +