diff --git a/src/sys/Makefile b/src/sys/Makefile index d75d386..e8c1119 100644 --- a/src/sys/Makefile +++ b/src/sys/Makefile @@ -1,8 +1,8 @@ # $Id$ # Kernel Makefile (C) 2002 The UbixOS Project -all: sys-code init-code -# net-code sde-code pci-code ufs-code ubixfs-code vfs-code isa-code kernel-code lib-code vmm-code boot-code devfs-code mpi-code kmods-code kernel-img +all: lib-code sys-code init-code +# net-code sde-code pci-code ufs-code ubixfs-code vfs-code isa-code kernel-code vmm-code boot-code devfs-code mpi-code kmods-code kernel-img boot-code: boot (cd boot;make) @@ -72,9 +72,9 @@ clean: (cd init;make clean) (cd sys;make clean) + (cd lib;make clean) #(cd compile;make clean) #(cd vmm;make clean) - #(cd lib;make clean) #(cd kernel;make clean) #(cd isa;make clean) #(cd vfs;make clean) diff --git a/src/sys/include/lib/kprintf.h b/src/sys/include/lib/kprintf.h index 310ffff..5937784 100644 --- a/src/sys/include/lib/kprintf.h +++ b/src/sys/include/lib/kprintf.h @@ -41,6 +41,10 @@ #endif /*** + $Log$ + Revision 1.2 2004/05/21 15:00:27 reddawg + Cleaned up + + END ***/ - diff --git a/src/sys/include/stdarg.h b/src/sys/include/stdarg.h new file mode 100644 index 0000000..ab45df4 --- /dev/null +++ b/src/sys/include/stdarg.h @@ -0,0 +1,57 @@ +/***************************************************************************************** + 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 _STDARG_H +#define _STDARG_H + +typedef char *vaList[1]; + +#define vaStart(ap, parm) ((ap)[0] = (char *) &parm \ + + ((sizeof(parm) + sizeof(int) - 1) & ~(sizeof(int) - 1)), (void) 0) + +#define vaArg(ap, type) ((ap)[0] += \ + ((sizeof(type) + sizeof(int) - 1) & ~(sizeof(int) - 1)), \ + (*(type *) ((ap)[0] \ + - ((sizeof(type) + sizeof(int) - 1) & ~(sizeof(int) - 1)) ))) + +#define vaEnd(ap) ((ap)[0] = 0, (void) 0) + + +int vsprintf(char *buf, const char *fmt, vaList args); + +#endif + +/*** + $Log$ + Revision 1.2 2004/05/21 15:22:35 reddawg + Cleaned up + + + END + ***/ diff --git a/src/sys/include/ubixos/kpanic.h b/src/sys/include/ubixos/kpanic.h new file mode 100644 index 0000000..91c5d50 --- /dev/null +++ b/src/sys/include/ubixos/kpanic.h @@ -0,0 +1,44 @@ +/***************************************************************************************** + 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 _KPANIC_H +#define _KPANIC_H + +void kpanic(const char *fmt, ...); + +#endif + +/*** + $Log$ + Revision 1.2 2004/05/21 15:20:00 reddawg + Cleaned up + + + END + ***/ diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 4472167..f1eee64 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -30,6 +30,7 @@ #include #include #include +#include /***************************************************************************************** Desc: The Kernels Descriptor table: @@ -75,7 +76,7 @@ int i = 0x0; /* Do A Clear Screen Just To Make The TEXT Buffer Nice And Empty */ - //clearScreen(); + clearScreen(); /* Modify src/sys/include/ubixos/init.h to add a startup routine */ for (i=0x0;i +#include +#include +#include + +int printOff = 0x0; +int ogprintOff = 0x1; + +int kprintf(const char *fmt, ...) { + char buf[1024]; + vaList args; + int i = 0x0; + vaStart(args, fmt); + i=vsprintf(buf,fmt,args); + vaEnd(args); + if (printOff == 0x0) { + kprint(buf); + } + if (ogprintOff == 0x0) { + ogPrintf(buf); + } + return(i); + } + +int sprintf(char *buf,const char *fmt, ...) { + vaList args; + int i; + vaStart(args, fmt); + i=vsprintf(buf,fmt,args); + vaEnd(args); + return(i); + } + +/*** + END + ***/ +