00001 /***************************************************************************************** 00002 Copyright (c) 2002-2004 The UbixOS Project 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, are 00006 permitted provided that the following conditions are met: 00007 00008 Redistributions of source code must retain the above copyright notice, this list of 00009 conditions, the following disclaimer and the list of authors. Redistributions in binary 00010 form must reproduce the above copyright notice, this list of conditions, the following 00011 disclaimer and the list of authors in the documentation and/or other materials provided 00012 with the distribution. Neither the name of the UbixOS Project nor the names of its 00013 contributors may be used to endorse or promote products derived from this software 00014 without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 00017 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00019 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00020 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00021 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00022 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 00026 $Id$ 00027 00028 *****************************************************************************************/ 00029 00030 #include <ubixos/vitals.h> 00031 #include <ubixos/kpanic.h> 00032 #include <lib/kprintf.h> 00033 #include <lib/kmalloc.h> 00034 #include <string.h> 00035 00036 vitalsNode *systemVitals = 0x0; 00037 00038 /************************************************************************ 00039 00040 Function: vitals_init(); 00041 Description: This will enable the vitals subsystem for ubixos 00042 00043 Notes: 00044 00045 02/20/2004 - Approved Its Quality 00046 00047 ************************************************************************/ 00048 int vitals_init() { 00049 /* Initialize Memory For The System Vitals Node */ 00050 kprintf("A"); 00051 systemVitals = (vitalsNode *) kmalloc(sizeof(vitalsNode)); 00052 kprintf("B"); 00053 00054 /* If malloc Failed Then Error */ 00055 if (systemVitals == 0x0) 00056 { 00057 kpanic("Error: kmalloc Failed In initVitals\n"); 00058 } 00059 00060 /* Set all default values */ 00061 memset(systemVitals,0x0,sizeof(vitalsNode)); 00062 00063 systemVitals->quantum = 8; 00064 systemVitals->dQuantum = 8; 00065 00066 /* Print Out Info For Vitals: */ 00067 kprintf("vitals0 - Address: [0x%X]\n",systemVitals); 00068 00069 /* Return so kernel knows that there is no problem */ 00070 return(0x0); 00071 } 00072 00073 /*** 00074 END 00075 ***/ 00076
1.4.7