diff --git a/sys/fs/vfs/file.c b/sys/fs/vfs/file.c index e24b27a..6c0042a 100644 --- a/sys/fs/vfs/file.c +++ b/sys/fs/vfs/file.c @@ -383,7 +383,6 @@ } /* Search For The File */ if ( tmpFd->mp->fs->vfsOpenFile( tmpFd->fileName, tmpFd ) == 0x1 ) { - kprintf("fopen1"); /* If The File Is Found Then Set Up The Descriptor */ /* in order to save resources we will allocate the buffer later when it is needed */ @@ -423,7 +422,6 @@ return (tmpFd); } else { - kprintf("fopen2"); kfree( tmpFd->buffer ); kfree( tmpFd ); spinUnlock( &fdTable_lock ); diff --git a/sys/i386/fork.c b/sys/i386/fork.c index 7e0e4bd..6436b4c 100644 --- a/sys/i386/fork.c +++ b/sys/i386/fork.c @@ -94,7 +94,7 @@ newProcess->td.vm_dsize = _current->td.vm_dsize; newProcess->td.vm_daddr = _current->td.vm_daddr; - kprintf("Copying Mem Space! [0x%X:0x%X:0x%X:0x%X:0x%X:%i:%i]\n", newProcess->tss.esp0, newProcess->tss.esp, newProcess->tss.ebp, td->frame->tf_esi, td->frame->tf_eip, newProcess->id, _current->id); + //MrOlsen 2018 kprintf("Copying Mem Space! [0x%X:0x%X:0x%X:0x%X:0x%X:%i:%i]\n", newProcess->tss.esp0, newProcess->tss.esp, newProcess->tss.ebp, td->frame->tf_esi, td->frame->tf_eip, newProcess->id, _current->id); newProcess->tss.cr3 = (uInt32) vmm_copyVirtualSpace(newProcess->id); //kprintf( "Copied Mem Space!\n" ); @@ -109,7 +109,7 @@ _current->children++; /* Return Id of Proccess */ - kprintf("Returning! [%i][0x%X]\n", _current->id, newProcess->tss.cr3); + //MrOlsen 2018kprintf("Returning! [%i][0x%X]\n", _current->id, newProcess->tss.cr3); td->td_retval[0] = newProcess->id; return (0); @@ -174,7 +174,7 @@ newProcess->td.vm_daddr = _current->td.vm_daddr; /* Create A Copy Of The VM Space For New Task */ - kprintf("Copying Mem Space! [0x%X:0x%X:0x%X:0x%X:0x%X:%i:%i:0x%X]\n", newProcess->tss.esp0, newProcess->tss.esp, newProcess->tss.ebp, esi, eip, newProcess->id, _current->id, newProcess->td.vm_daddr); + //MrOlsen 2018kprintf("Copying Mem Space! [0x%X:0x%X:0x%X:0x%X:0x%X:%i:%i:0x%X]\n", newProcess->tss.esp0, newProcess->tss.esp, newProcess->tss.ebp, esi, eip, newProcess->id, _current->id, newProcess->td.vm_daddr); newProcess->tss.cr3 = (uInt32) vmm_copyVirtualSpace(newProcess->id); //kprintf( "Copied Mem Space!\n" ); @@ -184,7 +184,7 @@ while (tmpProcPtr->state == FORK) sched_yield(); /* Return Id of Proccess */ - kprintf("Returning! [%i]", _current->id); + //MrOlsen 2018kprintf("Returning! [%i]", _current->id); return (newProcess->id); } diff --git a/sys/i386/i386_exec.c b/sys/i386/i386_exec.c index 6a706d3..28b6bb0 100644 --- a/sys/i386/i386_exec.c +++ b/sys/i386/i386_exec.c @@ -472,7 +472,7 @@ sprintf(newProcess->oInfo.cwd, "/"); - kprintf("execFile Return: 0x%X - %i\n", newProcess->tss.eip, newProcess->id); + //MrOlsen 2018 kprintf("execFile Return: 0x%X - %i\n", newProcess->tss.eip, newProcess->id); /* Put new thread into the READY state */ sched_setStatus(newProcess->id, READY); @@ -488,10 +488,6 @@ int i = 0x0; int x = 0x0; - kprintf("EXEVE: %s(%i)", file, _current->id); - if (_current->id == 10) - asm("nop"); - int argc = argv_count(argv); int envc = envp_count(envp); @@ -521,7 +517,6 @@ asm("movl %%cr3, %0;" : "=r" (cr3)); fd = fopen(file, "r"); - kprintf("fd: 0x%X", fd); if (fd == 0x0) return (-1); @@ -540,7 +535,7 @@ uint32_t *argv_out = 0x0; char *args_out = 0x0; - kprintf("ARGV: 0x%X\n", &argv_out); + //MrOlsen 2018kprintf("ARGV: 0x%X\n", &argv_out); args_copyin(argv, &argv_out, &args_out); @@ -648,12 +643,12 @@ } if ((programHeader[i].p_flags & PF_X) && text_size < seg_size) { - kprintf("setting text: 0x%X - 0x%X\n", seg_addr, seg_size); + //MrOlsen 2018kprintf("setting text: 0x%X - 0x%X\n", seg_addr, seg_size); text_size = seg_size; text_addr = seg_addr; } else { - kprintf("setting data: 0x%X - 0x%X\n", seg_addr, seg_size); + //MrOlsen 2018kprintf("setting data: 0x%X - 0x%X\n", seg_addr, seg_size); data_size = seg_size; data_addr = seg_addr; /* @@ -698,7 +693,7 @@ _current->td.vm_dsize = data_size >> PAGE_SHIFT; _current->td.vm_daddr = data_addr; - kprintf("Done Looping\n"); + //MrOlsen 2018kprintf("Done Looping\n"); ef->preloaded = 1; ef->address = 0x0; @@ -712,11 +707,9 @@ if (ldAddr != 0x0) { iFrame->eip = ldAddr; - kprintf("DYN"); } else { iFrame->eip = binaryHeader->e_entry; - kprintf("STATIC"); } //iFrame->edx = 0x0; @@ -776,26 +769,26 @@ tmp[i++] = 2; tmp[i++] = -1;// tFD; // _current->imageFd; _current->td.o_files[4] = _current->files[0]; - kprintf("AT_EXECFD: [%i:%i]", tmp[i - 1], tFD); + //MrOlsen 2018kprintf("AT_EXECFD: [%i:%i]", tmp[i - 1], tFD); tmp[i++] = 3; tmp[i++] = binaryHeader->e_phoff + 0x08048000; - kprintf("AT_PHDR: [0x%X]", tmp[i - 1]); + //MrOlsen 2018kprintf("AT_PHDR: [0x%X]", tmp[i - 1]); tmp[i++] = 4; tmp[i++] = binaryHeader->e_phentsize; - kprintf("AT_PHENT: [0x%X]", tmp[i - 1]); + //MrOlsen 2018kprintf("AT_PHENT: [0x%X]", tmp[i - 1]); tmp[i++] = 5; tmp[i++] = binaryHeader->e_phnum; - kprintf("AT_PHNUM: [0x%X]", tmp[i - 1]); + //MrOlsen 2018kprintf("AT_PHNUM: [0x%X]", tmp[i - 1]); tmp[i++] = 6; tmp[i++] = 0x1000; tmp[i++] = 7; tmp[i++] = LD_START; - kprintf("AT_BASE: [0x%X]", tmp[i - 1]); + //MrOlsen 2018kprintf("AT_BASE: [0x%X]", tmp[i - 1]); tmp[i++] = 8; tmp[i++] = 0x0; diff --git a/sys/isa/atkbd.c b/sys/isa/atkbd.c index 687f800..d03b55d 100644 --- a/sys/isa/atkbd.c +++ b/sys/isa/atkbd.c @@ -290,6 +290,7 @@ // endTask(tty_foreground->owner); //K_PANIC( "CTRL-C pressed\n" ); kprintf("FreePages: [0x%X]\n", systemVitals->freePages); + sched_setStatus(tty_foreground->owner, DEAD); break; case 0x9: kprintf("REBOOTING"); @@ -383,121 +384,3 @@ //spinUnlock(&atkbdSpinLock); return (retKey); } - -/*** - - $Log: atkbd.c,v $ - Revision 1.5 2006/12/05 17:01:15 reddawg - Modified kpanic - - Revision 1.4 2006/12/05 14:10:21 reddawg - Workign Distro - - Revision 1.3 2006/12/01 05:12:35 reddawg - We're almost there... :) - - Revision 1.2 2006/10/19 17:52:17 reddawg - Working On Userland - - Revision 1.1.1.1 2006/06/01 12:46:12 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:37 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:24:01 reddawg - no message - - Revision 1.29 2004/09/11 21:38:00 reddawg - Fixed a few problems - - Revision 1.28 2004/09/08 23:19:58 reddawg - hmm - - Revision 1.27 2004/09/07 21:54:38 reddawg - ok reverted back to old scheduling for now.... - - Revision 1.26 2004/09/06 22:18:52 reddawg - ok bed time - - Revision 1.25 2004/09/06 22:11:29 reddawg - tty: now each tty has a stdin.... - - Revision 1.24 2004/09/06 15:13:25 reddawg - Last commit before FreeBSD 6.0 - - Revision 1.23 2004/08/21 23:47:50 reddawg - *** empty log message *** - - Revision 1.22 2004/08/09 12:58:05 reddawg - let me know when you got the surce - - Revision 1.21 2004/08/06 22:32:16 reddawg - Ubix Works Again - - Revision 1.19 2004/08/03 18:31:19 reddawg - virtual terms - - Revision 1.18 2004/07/29 21:32:16 reddawg - My quick lunchs breaks worth of updates.... - - Revision 1.17 2004/07/28 18:45:39 reddawg - movement of files - - Revision 1.16 2004/07/28 17:07:25 reddawg - MPI: moved the syscalls - - Revision 1.15 2004/07/26 19:15:49 reddawg - test code, fixes and the like - - Revision 1.14 2004/07/25 05:32:58 reddawg - fixed - - Revision 1.13 2004/07/25 05:24:39 reddawg - atkbd: removed sti... does it still miss keys - - Revision 1.12 2004/07/24 20:00:51 reddawg - Lots of changes to the vmm subsystem.... Page faults have been adjust to now be blocking on a per thread basis not system wide. This has resulted in no more deadlocks.. also the addition of per thread locking has removed segfaults as a result of COW in which two tasks fault the same COW page and try to modify it. - - Revision 1.11 2004/07/24 15:12:56 reddawg - Now I'm current - - Revision 1.10 2004/07/23 17:49:58 reddawg - atkbd: adjust the timing issue on the driver hopefully it will work fine now - - Revision 1.9 2004/07/23 17:37:35 reddawg - Fix - - Revision 1.8 2004/07/23 09:10:06 reddawg - ubixfs: cleaned up some functions played with the caching a bit - vfs: renamed a bunch of functions - cleaned up a few misc bugs - - Revision 1.7 2004/07/22 20:53:07 reddawg - atkbd: fixed problem - - Revision 1.6 2004/07/09 13:34:51 reddawg - keyboard: keyboardInit to atkbd_init - Adjusted initialization routines - - Revision 1.5 2004/06/17 14:49:14 reddawg - atkbd: converted some variables to static - - Revision 1.4 2004/06/04 10:19:42 reddawg - notes: we compile again, thank g-d anyways i was about to cry - - Revision 1.3 2004/05/19 04:07:42 reddawg - kmalloc(size,pid) no more it is no kmalloc(size); the way it should of been - - Revision 1.2 2004/05/10 02:23:24 reddawg - Minor Changes To Source Code To Prepare It For Open Source Release - - Revision 1.1.1.1 2004/04/15 12:07:09 reddawg - UbixOS v1.0 - - Revision 1.19 2004/04/13 16:36:33 reddawg - Changed our copyright, it is all now under a BSD-Style license - - END - ***/ - diff --git a/sys/kernel/gen_calls.c b/sys/kernel/gen_calls.c index 8abc2bf..336c5e5 100644 --- a/sys/kernel/gen_calls.c +++ b/sys/kernel/gen_calls.c @@ -38,6 +38,7 @@ #include #include #include +#include /* Exit Syscall */ int sys_exit(struct thread *td, struct sys_exit_args *args) { @@ -145,13 +146,21 @@ int error = 0; kprintf("wait4: %i", args->pid); + if (args->pid == -1) { + if (_current->children <= 0) { + td->td_retval[0] = ECHILD; + return(-1); + } + int children = _current->children; while (_current->children == children) sched_yield(); td->td_retval[0] = _current->last_exit; + td->td_retval[1] = 0x8; + return(0x0); } else { kTask_t *tmpTask = schedFindTask(args->pid); diff --git a/sys/kernel/vfs_calls.c b/sys/kernel/vfs_calls.c index 30be331..b748804 100644 --- a/sys/kernel/vfs_calls.c +++ b/sys/kernel/vfs_calls.c @@ -119,7 +119,7 @@ if ( c == '\n') buf[x++] = '\n'; - kprintf("READ: %i", x); + //MROlsen 2018 kprintf("READ: %i", x); td->td_retval[0] = x; } diff --git a/sys/vmm/paging.c b/sys/vmm/paging.c index c7531fa..890eaea 100644 --- a/sys/vmm/paging.c +++ b/sys/vmm/paging.c @@ -575,7 +575,7 @@ /* #ifdef DEBUG */ - kprintf("CVS: [0x%X]\n", addr); + //MrOlsen 2018kprintf("CVS: [0x%X]\n", addr); /* #endif */