diff --git a/src/sys/include/sys/kern_descrip.h b/src/sys/include/sys/kern_descrip.h index e6168c1..9c5c934 100644 --- a/src/sys/include/sys/kern_descrip.h +++ b/src/sys/include/sys/kern_descrip.h @@ -91,9 +91,9 @@ int fcntl(struct thread *, struct fcntl_args *); -//int falloc(struct thread *,int **, int *); int close(struct thread *,struct close_args *); int falloc(struct thread *, struct file **, int *); +int getdtablesize(struct thread *, struct getdtablesize_args *); #endif diff --git a/src/sys/include/sys/kern_sig.h b/src/sys/include/sys/kern_sig.h new file mode 100644 index 0000000..5ab16b9 --- /dev/null +++ b/src/sys/include/sys/kern_sig.h @@ -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$ + +*****************************************************************************************/ + +#ifndef _KERN_SIG_H +#define _KERN_SIG_H + +#include +#include + +int sigaction(struct thread *,register struct sigaction_args *); + +#endif + +/*** + END + ***/ + diff --git a/src/sys/include/sys/sysproto.h b/src/sys/include/sys/sysproto.h index 0eb0c60..b125a18 100644 --- a/src/sys/include/sys/sysproto.h +++ b/src/sys/include/sys/sysproto.h @@ -101,10 +101,27 @@ char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char pos_l_[PADL_(off_t)]; off_t pos; char pos_r_[PADR_(off_t)]; }; + struct obreak_args { char nsize_l_[PADL_(char *)]; char * nsize; char nsize_r_[PADR_(char *)]; }; +struct sigaction_args { + char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; + char act_l_[PADL_(const struct sigaction *)]; const struct sigaction * act; char act_r_[PADR_(const struct sigaction *)]; + char oact_l_[PADL_(struct sigaction *)]; struct sigaction * oact; char oact_r_[PADR_(struct sigaction *)]; +}; + +struct getdtablesize_args { + register_t dummy; +}; + +struct munmap_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; +}; + + #endif diff --git a/src/sys/include/ubixos/syscalls_new.h b/src/sys/include/ubixos/syscalls_new.h index fc68107..50e00d8 100644 --- a/src/sys/include/ubixos/syscalls_new.h +++ b/src/sys/include/ubixos/syscalls_new.h @@ -43,6 +43,9 @@ int close(); int mmap(); int obreak(); +int sigaction(); +int getdtablesize(); +int munmap(); #define invalid_call 0x0 #define PSL_C 0x00000001 /* carry bit */ @@ -125,7 +128,7 @@ invalid_call, /** 70 **/ invalid_call, /** 71 **/ invalid_call, /** 72 **/ - invalid_call, /** 73 **/ + munmap, /** 73 **/ invalid_call, /** 74 **/ invalid_call, /** 75 **/ invalid_call, /** 76 **/ @@ -141,7 +144,7 @@ invalid_call, /** 86 **/ invalid_call, /** 87 **/ invalid_call, /** 88 **/ - invalid_call, /** 89 **/ + getdtablesize, /** 89 **/ invalid_call, /** 90 **/ invalid_call, /** 91 **/ fcntl, /** 92 **/ @@ -468,7 +471,7 @@ invalid_call, /** 413 **/ invalid_call, /** 414 **/ invalid_call, /** 415 **/ - invalid_call, /** 416 **/ + sigaction, /** 416 **/ invalid_call, /** 417 **/ invalid_call, /** 418 **/ invalid_call, /** 419 **/ diff --git a/src/sys/include/vmm/paging.h b/src/sys/include/vmm/paging.h index 4ea31c5..08eba72 100644 --- a/src/sys/include/vmm/paging.h +++ b/src/sys/include/vmm/paging.h @@ -68,6 +68,8 @@ void _vmm_pageFault(); int mmap(struct thread *,struct mmap_args *); int obreak(struct thread *,struct obreak_args *); +int munmap(struct thread *,struct munmap_args *); + extern uInt32 *kernelPageDirectory; diff --git a/src/sys/kernel/Makefile b/src/sys/kernel/Makefile index c62788b..3f4087c 100644 --- a/src/sys/kernel/Makefile +++ b/src/sys/kernel/Makefile @@ -6,7 +6,7 @@ include ../Makefile.inc # Objects -OBJS = pipe.o kern_descrip.o kernsysctl.o 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 syscall_new.o elf.o systemtask.o exec.o sched.o kpanic.o vitals.o ubthread.o timer.o +OBJS = kern_sig.o pipe.o kern_descrip.o kernsysctl.o 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 syscall_new.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/kern_descrip.c b/src/sys/kernel/kern_descrip.c index 66e05f5..03df200 100644 --- a/src/sys/kernel/kern_descrip.c +++ b/src/sys/kernel/kern_descrip.c @@ -98,6 +98,14 @@ } +int getdtablesize(struct thread *td, struct getdtablesize_args *uap) { + /* HACK */ + td->td_retval[0] = 0x1000000; + return (0); + } + + + /*** END ***/ diff --git a/src/sys/kernel/kern_sig.c b/src/sys/kernel/kern_sig.c new file mode 100644 index 0000000..78b382d --- /dev/null +++ b/src/sys/kernel/kern_sig.c @@ -0,0 +1,47 @@ +/***************************************************************************************** + 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 + +int sigaction(struct thread *td,register struct sigaction_args *uap) { + return(0x0); + } + + +/*** + END + ***/ + diff --git a/src/sys/kernel/kernsysctl.c b/src/sys/kernel/kernsysctl.c index e08655d..63be23e 100644 --- a/src/sys/kernel/kernsysctl.c +++ b/src/sys/kernel/kernsysctl.c @@ -129,6 +129,12 @@ name[1] = 7; name_len = 2; sysctl_add(name,name_len,"page_size",&page_val,sizeof(uInt32)); + /* Clock Rate */ + name[0] = 1; + name [1] = 12; + page_val = 0x3E8; + sysctl_add(name,name_len,"page_size",&page_val,sizeof(uInt32)); + /* User Stack */ name[0] = 1; name [1] = 33; page_val = 0xCBE8000; @@ -188,6 +194,7 @@ int sysctl_add(int *name,int namelen,char *str_name,void *buf,int buf_size) { struct sysctl_entry *tmpCtl = 0x0; + struct sysctl_entry *newCtl = 0x0; if (ctls == 0x0) { sysctl_init(); @@ -218,8 +225,18 @@ tmpCtl->children->val_len = buf_size; } else { - kprintf("CTL error\n"); - while (1); + newCtl = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + newCtl->prev = 0x0; + newCtl->next = tmpCtl->children; + newCtl->children = 0x0; + newCtl->id = name[namelen-1]; + sprintf(newCtl->name,str_name); + newCtl->value = (void *)kmalloc(buf_size); + memcpy(newCtl->value,buf,buf_size); + newCtl->val_len = buf_size; + tmpCtl->children->prev = newCtl; + tmpCtl->children = newCtl; + } return(0x0); diff --git a/src/sys/vmm/paging.c b/src/sys/vmm/paging.c index cf260f7..a414a91 100644 --- a/src/sys/vmm/paging.c +++ b/src/sys/vmm/paging.c @@ -448,6 +448,13 @@ return(0x0); } +int munmap(struct thread *td,struct munmap_args *uap) { + /* HACK */ + kprintf("munmap"); + return(0x0); + } + + /*** END ***/