diff --git a/src/sys/kernel/Makefile b/src/sys/kernel/Makefile index 3f4087c..01c2c8b 100644 --- a/src/sys/kernel/Makefile +++ b/src/sys/kernel/Makefile @@ -6,7 +6,7 @@ include ../Makefile.inc # Objects -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 +OBJS = kern_sig.o pipe.o kern_descrip.o kern_sysctl.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/exec.c b/src/sys/kernel/exec.c index 70b1168..3f557be 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -38,6 +38,8 @@ #include #include +#define STACK_ADDR 0xC800000 + /***************************************************************************************** Function: execThread(void (*)(void),int,char *); @@ -139,9 +141,10 @@ *****************************************************************************************/ void execFile(char *file,int argc,char **argv,int console) { - int i = 0x0; - int x = 0x0; - u_int32_t *tmp = 0x0; + int i = 0x0; + int x = 0x0; + u_int32_t *tmp = 0x0; + u_int32_t stackAddr = 0x0; fileDescriptor *tmpFd = 0x0; elfHeader *binaryHeader = 0x0; @@ -251,10 +254,11 @@ /* Set Virtual Memory Start */ _current->oInfo.vmStart = 0x80000000;//((programHeader[i].phVaddr & 0xFFFFF000) + 0x1900000); - _current->td.vm_daddr = (programHeader[i].phVaddr & 0xFFFFF000); + _current->td.vm_daddr = (char *)(programHeader[i].phVaddr & 0xFFFFF000); + //0xC800000 - for (x = 0;x < 1000;x++) { - vmm_remapPage(vmmFindFreePage(_current->id),0xC800000 + (x * 0x1000),PAGE_DEFAULT | PAGE_STACK); + for (x = 1;x < 100;x++) { + vmm_remapPage(vmmFindFreePage(_current->id),STACK_ADDR - (x * 0x1000),PAGE_DEFAULT | PAGE_STACK); } /* Task Stack 0xD000 bytes long */ @@ -304,8 +308,8 @@ _current->tss.ss2 = 0x0; _current->tss.eip = (long)binaryHeader->eEntry; _current->tss.eflags = 0x206; - _current->tss.esp = 0xCBE8000-12;//0x5DD000-12; - _current->tss.ebp = 0xCBE8000;//0x5DD000; + _current->tss.esp = STACK_ADDR - 12;//0xCBE8000-12;//0x5DD000-12; + _current->tss.ebp = STACK_ADDR;//0xCBE8000;//0x5DD000; _current->tss.esi = 0x0; _current->tss.edi = 0x0; @@ -329,16 +333,16 @@ tmp = (uInt32 *)_current->tss.esp0 - 5; tmp[0] = binaryHeader->eEntry; - tmp[3] = 0xCBE8000-12;//0x5DD000-12; + tmp[3] = STACK_ADDR - 12;//0xCBE8000-12;//0x5DD000-12; // - 2 - tmp = (uInt32 *)0xCBE8000 - 2;//0x5DD000 - 2; + tmp = (uInt32 *)STACK_ADDR - 2;//0xCBE8000 - 2;//0x5DD000 - 2; //tmp[0] = argc; //1 if (_current->id > 4) kprintf("argv[0]: [%s]\n",argv[0]); kprintf("argv: [0x%X]\n",argv); - tmp[0] = argv; - tmp[1] = argv; + tmp[0] = (u_int32_t)argv; + tmp[1] = (u_int32_t)argv; /* Switch Back To The Kernels VM Space */ @@ -475,7 +479,7 @@ // kprintf("B[0x%X:0x%X:0x%X]",seg_size,seg_addr,seg_addr + seg_size); //_current->td.vm_daddr = (programHeader[i].phVaddr & 0xFFFFF000); _current->td.vm_dsize = seg_size >> PAGE_SHIFT; - _current->td.vm_daddr = seg_addr; + _current->td.vm_daddr = (char *)seg_addr; } //_current->oInfo.vmStart = 0x80000000;//((programHeader[i].phVaddr & 0xFFFFF000) + 0x1900000); @@ -499,6 +503,7 @@ } } + /* What is this doing? 11/23/06 */ if (elfDynamicS != 0x0) { for (i=0;i<12;i++) { if (elfDynamicS[i].dynVal == 0x3) { @@ -511,20 +516,24 @@ } } } + _current->td.vm_dsize = seg_size >> PAGE_SHIFT; + _current->td.vm_daddr = (char *)seg_addr; + + vmm_cleanVirtualSpace(_current->td.vm_daddr + (_current->td.vm_dsize << PAGE_SIZE)); /* Adjust iframe */ tmp = (uInt32 *)_current->tss.esp0 - 5; tmp[0] = binaryHeader->eEntry; - tmp[3] = 0xCBE8000-12;//0x5DD000-12; + tmp[3] = STACK_ADDR - 12; //0xCBE8000-12;//0x5DD000-12; // - 2 - tmp = (uInt32 *)0xCBE8000 - 2;//0x5DD000 - 2; + tmp = (uInt32 *)STACK_ADDR - 2;//0xCBE8000 - 2;//0x5DD000 - 2; //tmp[0] = argc; //1 if (_current->id > 4) kprintf("argv[0]: [%s]\n",argv[0]); kprintf("argv: [0x%X]\n",argv); - tmp[0] = argv; - tmp[1] = argv; + tmp[0] = (u_int32_t)argv; + tmp[1] = (u_int32_t)argv; /* Now That We Relocated The Binary We Can Unmap And Free Header Info */ kfree(binaryHeader); diff --git a/src/sys/kernel/kern_descrip.c b/src/sys/kernel/kern_descrip.c index b37baa2..12c2f56 100644 --- a/src/sys/kernel/kern_descrip.c +++ b/src/sys/kernel/kern_descrip.c @@ -91,7 +91,7 @@ } int close(struct thread *td,struct close_args *uap) { - kfree(td->o_files[uap->fd]); + kfree((void *)td->o_files[uap->fd]); td->o_files[uap->fd] = 0x0; td->td_retval[0] = 0x0; return(0x0); @@ -100,9 +100,7 @@ int getdtablesize(struct thread *td, struct getdtablesize_args *uap) { /* HACK */ - /* WHY? */ - //td->td_retval[0] = 0x1000000; - td->td_retval[0] = 0x10; + td->td_retval[0] = 20; return (0); } diff --git a/src/sys/kernel/kern_sysctl.c b/src/sys/kernel/kern_sysctl.c new file mode 100644 index 0000000..33b468b --- /dev/null +++ b/src/sys/kernel/kern_sysctl.c @@ -0,0 +1,249 @@ +/***************************************************************************************** + 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 + +#define CTL_MAXNAME 24 + +static struct sysctl_entry *ctls = 0x0; + +static struct sysctl_entry *sysctl_find(int *,int); + +int sysctl_init() { + struct sysctl_entry *tmpCtl = 0x0; + if (ctls != 0x0) { + kprintf("sysctl already Initialized\n"); + while (1); + } + + ctls = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + ctls->prev = 0x0; + ctls->id = 0x0; + ctls->children = 0x0; + sprintf(ctls->name,"CTL_UNSPEC"); + + tmpCtl = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->prev = ctls; + tmpCtl->id = 1; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_KERN"); + ctls->next = tmpCtl; + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 2; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_VM"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 3; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_VFS"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 4; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_NET"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 5; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_DEBUG"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 6; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_HW"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 7; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_MACHDEP"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 8; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_USER"); + + tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->next->prev = tmpCtl; + tmpCtl = tmpCtl->next; + tmpCtl->id = 9; + tmpCtl->children = 0x0; + sprintf(tmpCtl->name,"CTL_P1003_1B"); + + return(0x0); + } + +static void def_ctls() { + int name[CTL_MAXNAME], name_len; + uInt32 page_val = 0x1000; + name[0] = 6; + 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; + sysctl_add(name,name_len,"page_size",&page_val,sizeof(uInt32)); + } + +int __sysctl(struct thread *td, struct sysctl_args *uap) { + struct sysctl_entry *tmpCtl = 0x0; + int i = 0; + if (ctls == 0x0) { + def_ctls(); + } + if (uap->newlen < 0) { + kprintf("Changing Not supported yet.\n"); + endTask(_current->id); + } + + tmpCtl = sysctl_find(uap->name,uap->namelen); + if (tmpCtl == 0x0) { + kprintf("Invalid CTL\n"); + for (i=0;inamelen;i++) + kprintf("(%i)",uap->name[i]); + kprintf("\n"); + endTask(_current->id); + } + + if ((u_int32_t)uap->oldlenp < tmpCtl->val_len) + memcpy(uap->old,tmpCtl->value,(uInt32)uap->oldlenp); + else + memcpy(uap->old,tmpCtl->value,tmpCtl->val_len); + + td->td_retval[0] = 0x0; + + return(0x0); + } + +static struct sysctl_entry *sysctl_find(int *name,int namelen) { + int i = 0x0; + struct sysctl_entry *tmpCtl = 0x0; + struct sysctl_entry *lCtl = ctls; + + /* Loop Name Len */ + for (i = 0; i < namelen;i++) { + for (tmpCtl = lCtl;tmpCtl != 0x0;tmpCtl = tmpCtl->next) { + //kprintf("ctlName: [%s], ctlId; [%i]\n",tmpCtl->name,tmpCtl->id); + if (tmpCtl->id == name[i]) { + if ((i+1) == namelen) { + return(tmpCtl); + } + lCtl = tmpCtl->children; + break; + } + } + } + return(0x0); + } + +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(); + } + + /* Check if it exists */ + tmpCtl = sysctl_find(name,namelen); + if (tmpCtl != 0x0) { + kprintf("Node Exists!\n"); + while (1); + } + + /* Get Parent Node */ + tmpCtl = sysctl_find(name,namelen-1); + if (tmpCtl == 0x0) { + kprintf("Parent Node Non Existant\n"); + return(-1); + } + if (tmpCtl->children == 0x0) { + tmpCtl->children = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); + tmpCtl->children->children = 0x0; + tmpCtl->children->prev = 0x0; + tmpCtl->children->next = 0x0; + tmpCtl->children->id = name[namelen-1]; + sprintf(tmpCtl->children->name,str_name); + tmpCtl->children->value = (void *)kmalloc(buf_size); + memcpy(tmpCtl->children->value,buf,buf_size); + tmpCtl->children->val_len = buf_size; + } + else { + 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); + } + + +/*** + END + ***/ + diff --git a/src/sys/kernel/kernsysctl.c b/src/sys/kernel/kernsysctl.c deleted file mode 100644 index 63be23e..0000000 --- a/src/sys/kernel/kernsysctl.c +++ /dev/null @@ -1,249 +0,0 @@ -/***************************************************************************************** - 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 - -#define CTL_MAXNAME 24 - -static struct sysctl_entry *ctls = 0x0; - -static struct sysctl_entry *sysctl_find(int *,int); - -int sysctl_init() { - struct sysctl_entry *tmpCtl = 0x0; - if (ctls != 0x0) { - kprintf("sysctl already Initialized\n"); - while (1); - } - - ctls = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - ctls->prev = 0x0; - ctls->id = 0x0; - ctls->children = 0x0; - sprintf(ctls->name,"CTL_UNSPEC"); - - tmpCtl = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->prev = ctls; - tmpCtl->id = 1; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_KERN"); - ctls->next = tmpCtl; - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 2; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_VM"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 3; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_VFS"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 4; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_NET"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 5; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_DEBUG"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 6; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_HW"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 7; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_MACHDEP"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 8; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_USER"); - - tmpCtl->next = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->next->prev = tmpCtl; - tmpCtl = tmpCtl->next; - tmpCtl->id = 9; - tmpCtl->children = 0x0; - sprintf(tmpCtl->name,"CTL_P1003_1B"); - - return(0x0); - } - -static void def_ctls() { - int name[CTL_MAXNAME], name_len; - uInt32 page_val = 0x1000; - name[0] = 6; - 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; - sysctl_add(name,name_len,"page_size",&page_val,sizeof(uInt32)); - } - -int __sysctl(struct thread *td, struct sysctl_args *uap) { - struct sysctl_entry *tmpCtl = 0x0; - int i = 0; - if (ctls == 0x0) { - def_ctls(); - } - if (uap->newlen < 0) { - kprintf("Changing Not supported yet.\n"); - endTask(_current->id); - } - - tmpCtl = sysctl_find(uap->name,uap->namelen); - if (tmpCtl == 0x0) { - kprintf("Invalid CTL\n"); - for (i=0;inamelen;i++) - kprintf("(%i)",uap->name[i]); - kprintf("\n"); - endTask(_current->id); - } - - if (uap->oldlenp < tmpCtl->val_len) - memcpy(uap->old,tmpCtl->value,(uInt32)uap->oldlenp); - else - memcpy(uap->old,tmpCtl->value,tmpCtl->val_len); - - td->td_retval[0] = 0x0; - - return(0x0); - } - -static struct sysctl_entry *sysctl_find(int *name,int namelen) { - int i = 0x0; - struct sysctl_entry *tmpCtl = 0x0; - struct sysctl_entry *lCtl = ctls; - - /* Loop Name Len */ - for (i = 0; i < namelen;i++) { - for (tmpCtl = lCtl;tmpCtl != 0x0;tmpCtl = tmpCtl->next) { - //kprintf("ctlName: [%s], ctlId; [%i]\n",tmpCtl->name,tmpCtl->id); - if (tmpCtl->id == name[i]) { - if ((i+1) == namelen) { - return(tmpCtl); - } - lCtl = tmpCtl->children; - break; - } - } - } - return(0x0); - } - -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(); - } - - /* Check if it exists */ - tmpCtl = sysctl_find(name,namelen); - if (tmpCtl != 0x0) { - kprintf("Node Exists!\n"); - while (1); - } - - /* Get Parent Node */ - tmpCtl = sysctl_find(name,namelen-1); - if (tmpCtl == 0x0) { - kprintf("Parent Node Non Existant\n"); - return(-1); - } - if (tmpCtl->children == 0x0) { - tmpCtl->children = (struct sysctl_entry *)kmalloc(sizeof(struct sysctl_entry)); - tmpCtl->children->children = 0x0; - tmpCtl->children->prev = 0x0; - tmpCtl->children->next = 0x0; - tmpCtl->children->id = name[namelen-1]; - sprintf(tmpCtl->children->name,str_name); - tmpCtl->children->value = (void *)kmalloc(buf_size); - memcpy(tmpCtl->children->value,buf,buf_size); - tmpCtl->children->val_len = buf_size; - } - else { - 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); - } - - -/*** - END - ***/ - diff --git a/src/sys/kernel/ld.c b/src/sys/kernel/ld.c index 8120df4..0959ea3 100644 --- a/src/sys/kernel/ld.c +++ b/src/sys/kernel/ld.c @@ -48,8 +48,6 @@ char *shStr = 0x0; char *dynStr = 0x0; uInt32 *reMap = 0x0; - uInt32 seg_addr = 0x0; - uInt32 seg_size = 0x0; fileDescriptor *ldFd = 0x0; elfHeader *binaryHeader = 0x0; elfProgramHeader *programHeader = 0x0; diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index 7ec0819..a72a73a 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -194,13 +194,11 @@ ************************************************************************/ void sysGetFreePage(long *ptr,int count,int type) { if (ptr) { - kprintf("{0x%X}",type); if (type == 2) *ptr = (long) vmmGetFreeVirtualPage(_current->id,count,VM_THRD); else *ptr = (long) vmmGetFreeVirtualPage(_current->id,count,VM_TASK); } - //kprintf("addr: [0x%X]\n",*ptr); return; }