diff --git a/src/bin/edit/main.c b/src/bin/edit/main.c index e6c4502..b034054 100644 --- a/src/bin/edit/main.c +++ b/src/bin/edit/main.c @@ -33,17 +33,22 @@ char data[512]; FILE *out; printf("UbixOS Text Editor\n"); + /* out = fopen("sys:/test.txt","w"); fread(data,4,1,out); data[4] = '\0'; printf("Data: [%s]\n",data); fwrite("Test Line\n",9,1,out); fclose(out); + */ return(0); } /*** $Log$ + Revision 1.2 2006/10/16 13:20:34 reddawg + Tweaks + Revision 1.1.1.1 2006/06/01 12:46:09 reddawg ubix2 diff --git a/src/sys/include/ubixos/syscalls_new.h b/src/sys/include/ubixos/syscalls_new.h new file mode 100644 index 0000000..88e8b38 --- /dev/null +++ b/src/sys/include/ubixos/syscalls_new.h @@ -0,0 +1,52 @@ +/***************************************************************************************** + 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 _SYSCALLS_NEW_H +#define _SYSCALLS_NEW_H + +#include + +//typedef void (*functionPTR)(); + +functionPTR systemCalls_new[] = { + invalidCall, /** 0 **/ + sysExit, /** 1 **/ + invalidCall, /** 2 **/ + invalidCall, /** 3 **/ + sys_write, /** 4 **/ + }; + +int totalCalls_new = sizeof(systemCalls_new)/sizeof(functionPTR); + +#endif + +/*** + END + ***/ + diff --git a/src/sys/kernel/Makefile b/src/sys/kernel/Makefile index 4adb9c9..275d579 100644 --- a/src/sys/kernel/Makefile +++ b/src/sys/kernel/Makefile @@ -6,7 +6,7 @@ include ../Makefile.inc # Objects -OBJS = schedyield.o tty.o sys_call_new.o sys_call.o endtask.o spinlock.o bioscall.o ld.o time.o fork.o syscall.o elf.o systemtask.o exec.o sched.o kpanic.o vitals.o ubthread.o timer.o +OBJS = gen_calls.o schedyield.o tty.o sys_call_new.o sys_call.o endtask.o spinlock.o bioscall.o ld.o time.o fork.o syscall.o elf.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/gen_calls.c b/src/sys/kernel/gen_calls.c new file mode 100644 index 0000000..5db4abd --- /dev/null +++ b/src/sys/kernel/gen_calls.c @@ -0,0 +1,43 @@ +/***************************************************************************************** + 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 + +int sys_write(struct thread *td, struct write_args *uap) { + kprintf("??? [%s]",uap->buf); + return(0x0); + } + +/*** + END + ***/ + diff --git a/src/sys/kernel/sys_call_new.S b/src/sys/kernel/sys_call_new.S index c8763a5..2797c06 100644 --- a/src/sys/kernel/sys_call_new.S +++ b/src/sys/kernel/sys_call_new.S @@ -31,14 +31,14 @@ .text .code32 _sysCall_new: - cmpl totalCalls,%eax + cmpl totalCalls_new,%eax jae invalidSysCall cld pushl %edx pushl %ecx pushl %ebx - call *systemCalls(,%eax,4) + call *systemCalls_new(,%eax,4) popl %ebx popl %ecx popl %edx /* Restore Registers */ diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index ae8e5aa..76d1661 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include