diff --git a/src/sys/Makefile b/src/sys/Makefile index 4cbf51d..2ba536f 100644 --- a/src/sys/Makefile +++ b/src/sys/Makefile @@ -1,7 +1,9 @@ # $Id$ # Kernel Makefile (C) 2002 The UbixOS Project -all: sde-code pci-code ufs-code ubixfs-code vfs-code isa-code kernel-code lib-code vmm-code sys-code boot-code init-code devfs-code mpi-code kmods-code kernel-img #generic-code net-code +all: pci-code ufs-code ubixfs-code vfs-code isa-code kernel-code lib-code vmm-code sys-code boot-code init-code devfs-code mpi-code kmods-code kernel-img +#generic-code net-code +#sde-code generic-code: generic (cd generic;make) diff --git a/src/sys/compile/Makefile b/src/sys/compile/Makefile index 4e6ee65..5f782dd 100644 --- a/src/sys/compile/Makefile +++ b/src/sys/compile/Makefile @@ -9,8 +9,8 @@ OBJS = null.o #Kernel Parts -KPARTS = ../init/*.o ../sys/*.o ../vmm/*.o ../lib/*.o ../kernel/*.o ../isa/*.o ../vfs/*.o ../ubixfs/*.o ../pci/*.o ../sde/*.o ../devfs/*.o ../mpi/*.o ../ufs/*.o -#../graphics/*.o ../ld/*.o -Ttext 0x30000 -Tdata 0x34000 +KPARTS = ../init/*.o ../sys/*.o ../vmm/*.o ../lib/*.o ../kernel/*.o ../isa/*.o ../vfs/*.o ../ubixfs/*.o ../pci/*.o ../devfs/*.o ../mpi/*.o ../ufs/*.o +# ../sde/*.o ../graphics/*.o ../ld/*.o -Ttext 0x30000 -Tdata 0x34000 # Link the kernel statically with fixed text+data address @1M $(KERNEL) : $(OBJS) diff --git a/src/sys/include/ubixos/syscalls.h b/src/sys/include/ubixos/syscalls.h index 0920709..6571a96 100644 --- a/src/sys/include/ubixos/syscalls.h +++ b/src/sys/include/ubixos/syscalls.h @@ -114,7 +114,8 @@ sysAddModule, /** 37 Add Kernel Module **/ sysRmModule, /** 38 Remove Kernel Module **/ invalidCall, /** 39 **/ - sysSDE, /** 40 SDE Kernel Interface **/ + //sysSDE, /** 40 SDE Kernel Interface **/ + invalidCall, /** 40 **/ invalidCall, /** 41 **/ invalidCall, /** 42 **/ invalidCall, /** 43 **/ @@ -137,6 +138,9 @@ /*** $Log$ + Revision 1.1.1.1 2006/06/01 12:46:14 reddawg + ubix2 + Revision 1.2 2005/10/12 00:13:37 reddawg Removed diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index ce97b0c..df79554 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -42,7 +42,7 @@ #include #include #include -#include +//#include #include void sdeTestThread(); @@ -234,7 +234,7 @@ for (i=0;i<1400;i++) { asm("hlt"); } - execThread(sdeThread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); + //execThread(sdeThread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); for (i=0;i<1400;i++) { asm("hlt"); } diff --git a/src/sys/kernel/systemtask.c b/src/sys/kernel/systemtask.c index 95a4b83..4e992b7 100644 --- a/src/sys/kernel/systemtask.c +++ b/src/sys/kernel/systemtask.c @@ -1,119 +1,119 @@ -/***************************************************************************************** - 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 -#include -#include -#include -#include -#include -#include -#include -#include - -void systemTask() { - mpi_message_t myMsg; - uInt32 counter = 0x0; - int i = 0x0; - int *x = 0x0; - kTask_t *tmpTask = 0x0; - - if (mpi_createMbox("system") != 0x0) { - kpanic("Error: Error creating mailbox: system\n"); - } - - while(1) { - if (mpi_fetchMessage("system",&myMsg) == 0x0) { - kprintf("A"); - switch(myMsg.header) { - case 0x69: - x = (int *)&myMsg.data; - kprintf("Switching to term: [%i][%i]\n",*x,myMsg.pid); - schedFindTask(myMsg.pid)->term = tty_find(*x); - break; - case 1000: - kprintf("Restarting the system in 5 seconds\n"); - counter = systemVitals->sysUptime + 5; - while (systemVitals->sysUptime < counter) { - sched_yield(); - } - kprintf("Rebooting NOW!!!\n"); - while(inportByte(0x64) & 0x02); - outportByte(0x64, 0xFE); - break; - case 31337: - kprintf("system: backdoor opened\n"); - break; - case 0x80: - if (!strcmp(myMsg.data,"sdeStart")) { - kprintf("Starting SDE\n"); - execThread(sdeThread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); - } - else if (!strcmp(myMsg.data,"freePage")) { - kprintf("Free Page: %i\n",systemVitals->freePages); - } - else if (!strcmp(myMsg.data,"sdeStop")) { - printOff = 0x0; - biosCall(0x10,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0); - for (i=0x0;i<100;i++) asm("hlt"); - } - break; - default: - kprintf("system: Received message %i:%s\n",myMsg.header,myMsg.data); - break; - } - } - - /* - Here we get the next task from the delete task queue - we first check to see if it has an fd attached for the binary and after that - we free the pages for the process and then free the task - */ - tmpTask = sched_getDelTask(); - if (tmpTask != 0x0) { - if (tmpTask->imageFd != 0x0) - fclose(tmpTask->imageFd); - vmmFreeProcessPages(tmpTask->id); - kfree(tmpTask); - } - - sched_yield(); - } - - return; - } - -/*** - END - ***/ - +/***************************************************************************************** + 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 +#include +#include +#include +#include +#include +#include +#include +#include + +void systemTask() { + mpi_message_t myMsg; + uInt32 counter = 0x0; + int i = 0x0; + int *x = 0x0; + kTask_t *tmpTask = 0x0; + + if (mpi_createMbox("system") != 0x0) { + kpanic("Error: Error creating mailbox: system\n"); + } + + while(1) { + if (mpi_fetchMessage("system",&myMsg) == 0x0) { + kprintf("A"); + switch(myMsg.header) { + case 0x69: + x = (int *)&myMsg.data; + kprintf("Switching to term: [%i][%i]\n",*x,myMsg.pid); + schedFindTask(myMsg.pid)->term = tty_find(*x); + break; + case 1000: + kprintf("Restarting the system in 5 seconds\n"); + counter = systemVitals->sysUptime + 5; + while (systemVitals->sysUptime < counter) { + sched_yield(); + } + kprintf("Rebooting NOW!!!\n"); + while(inportByte(0x64) & 0x02); + outportByte(0x64, 0xFE); + break; + case 31337: + kprintf("system: backdoor opened\n"); + break; + case 0x80: + if (!strcmp(myMsg.data,"sdeStart")) { + kprintf("Starting SDE\n"); + //execThread(sdeThread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); + } + else if (!strcmp(myMsg.data,"freePage")) { + kprintf("Free Page: %i\n",systemVitals->freePages); + } + else if (!strcmp(myMsg.data,"sdeStop")) { + printOff = 0x0; + biosCall(0x10,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0); + for (i=0x0;i<100;i++) asm("hlt"); + } + break; + default: + kprintf("system: Received message %i:%s\n",myMsg.header,myMsg.data); + break; + } + } + + /* + Here we get the next task from the delete task queue + we first check to see if it has an fd attached for the binary and after that + we free the pages for the process and then free the task + */ + tmpTask = sched_getDelTask(); + if (tmpTask != 0x0) { + if (tmpTask->imageFd != 0x0) + fclose(tmpTask->imageFd); + vmmFreeProcessPages(tmpTask->id); + kfree(tmpTask); + } + + sched_yield(); + } + + return; + } + +/*** + END + ***/ + diff --git a/src/sys/lib/Makefile b/src/sys/lib/Makefile index a3a1422..f1b1f33 100644 --- a/src/sys/lib/Makefile +++ b/src/sys/lib/Makefile @@ -8,7 +8,8 @@ INCLUDES += -I../../lib/objgfx40/ # Objects -OBJS = memset.o assert.o ogprintf.o sqrt.o atan.o divdi3.o libcpp.o strtok.o kmalloc.o kprintf.o vsprintf.o string.o net.o strtol.o +OBJS = memset.o assert.o sqrt.o atan.o divdi3.o libcpp.o strtok.o kmalloc.o kprintf.o vsprintf.o string.o net.o strtol.o +#ogprintf.o all: $(OBJS) diff --git a/src/sys/lib/kprintf.c b/src/sys/lib/kprintf.c index 7c0f61c..89bb0ca 100644 --- a/src/sys/lib/kprintf.c +++ b/src/sys/lib/kprintf.c @@ -45,9 +45,11 @@ if (printOff == 0x0) { kprint(buf); } + /* if (ogprintOff == 0x0) { ogPrintf(buf); } + */ return(i); } @@ -62,6 +64,9 @@ /*** $Log$ + Revision 1.1.1.1 2006/06/01 12:46:16 reddawg + ubix2 + Revision 1.2 2005/10/12 00:13:37 reddawg Removed