diff --git a/src/bin/ld/main.c b/src/bin/ld/main.c index 276588d..a9ab213 100644 --- a/src/bin/ld/main.c +++ b/src/bin/ld/main.c @@ -150,10 +150,11 @@ //printf("\nld(%s:0x%X)",binaryDynStr + binaryRelSymTab[x].dynName,*reMap); //*reMap = ldFindFunc(binaryDynStr + binaryRelSymTab[x].dynName,(char *)(binaryDynStr + 1)); - +/* if (binaryFd) { fclose(binaryFd); } +*/ return(*reMap); } diff --git a/src/sys/include/vfs/vfs.h b/src/sys/include/vfs/vfs.h index b8e2d64..955a902 100644 --- a/src/sys/include/vfs/vfs.h +++ b/src/sys/include/vfs/vfs.h @@ -62,6 +62,8 @@ \brief filesSystem Structure not sure if we should allow function to point to NULL + + We don't as of 1/28/07 */ struct fileSystem { struct fileSystem *prev; diff --git a/src/sys/kernel/kern_descrip.c b/src/sys/kernel/kern_descrip.c index 17e833d..8c6c473 100644 --- a/src/sys/kernel/kern_descrip.c +++ b/src/sys/kernel/kern_descrip.c @@ -93,7 +93,7 @@ */ int getdtablesize(struct thread *td, struct getdtablesize_args *uap) { #ifdef NOTIMP - kprintf("[%s:%i]",__FILE__,__LINE__); + kprintf("[%s:%i:%s]",__FILE__,__LINE__,__FUNCTION__); #endif td->td_retval[0] = O_FILES; return (0); @@ -123,6 +123,9 @@ * \returns NULL for now */ int ioctl(struct thread *td, struct ioctl_args *uap) { + #ifdef NOTIMP + kprintf("[%s:%i:%s]",__FILE__,__LINE__,__FUNCTION__); + #endif td->td_retval[0] = 0x0; return(0x0); } diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index e8a19f3..6fd7de7 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -171,10 +171,9 @@ return; } -void sysExit(int status) -{ - endTask(_current->id); -} +void sysExit(int status) { + endTask(_current->id); + } void sysCheckPid(int pid,int *ptr) { diff --git a/src/sys/kernel/systemtask.c b/src/sys/kernel/systemtask.c index cc13a2e..1066cfe 100644 --- a/src/sys/kernel/systemtask.c +++ b/src/sys/kernel/systemtask.c @@ -103,10 +103,11 @@ 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(); + tmpTask = sched_getDelTask(); if (tmpTask != 0x0) { - if (tmpTask->imageFd != 0x0) + if ((tmpTask->imageFd != 0x0) || (tmpTask->imageFd != 0xBEBEBEBE)) { fclose(tmpTask->imageFd); + } vmmFreeProcessPages(tmpTask->id); kfree(tmpTask); } diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index 0b7f137..be0d822 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -344,7 +344,9 @@ /* in order to save resources we will allocate the buffer later when it is needed */ tmpFd->buffer = (char *)kmalloc(4096); -kprintf("meep meep [0x%X]\n",tmpFd->buffer); + #ifdef VFSDEBUG + kprintf("meep meep [0x%X]\n",tmpFd->buffer); + #endif if(tmpFd->buffer == 0x0) { kfree(tmpFd); @@ -400,8 +402,9 @@ struct file *tmpFd = 0x0; assert(fd); - //kfree(fd->fsObj); - kfree(fd->buffer); + //BUG FCLOSE BROKEN!! + if ((fd->buffer != 0x0) || (fd->buffer != 0xBEBEBEBE)) + kfree(fd->buffer); kfree(fd); //BUG think i'm missing things //K_PANIC("HMM?"); diff --git a/src/sys/vfs/vfs_syscalls.c b/src/sys/vfs/vfs_syscalls.c index b8df0c2..1f7a6b5 100644 --- a/src/sys/vfs/vfs_syscalls.c +++ b/src/sys/vfs/vfs_syscalls.c @@ -205,9 +205,13 @@ while (1); } //BUG make fopen return 0 or -1 if error; + #ifdef VFSDEBUG kprintf("[0x%X]-234\n",nfp->buffer); + #endif fopen(nfp,uap->path,"r"); + #ifdef VFSDEBUG kprintf("[0x%X]-sdf\n",nfp->buffer); + #endif if (nfp == 0x0) td->td_retval[0] = -1; else