diff --git a/src/bin/ld/addlibrary.c b/src/bin/ld/addlibrary.c index ae20911..7b652cd 100644 --- a/src/bin/ld/addlibrary.c +++ b/src/bin/ld/addlibrary.c @@ -28,8 +28,8 @@ } //if ((tmpLib->output = (char *)malloc((linkerFd->size+0x4000))) == 0x0) { //if ((tmpLib->output = (char *)malloc(0x111000)) == 0x0) { -//HELP - if ((tmpLib->output = (char *)getPage((0x0E4000/0x1000),2)) == 0x0) { +//HELP FOOKIN SIZE NEED + if ((tmpLib->output = (char *)getPage((0x0FF000/0x1000),2)) == 0x0) { printf("malloc failed: tmpLib->output\n"); exit(0x1); } diff --git a/src/bin/ls/ls.c b/src/bin/ls/ls.c index 150a9d3..8d515a6 100644 --- a/src/bin/ls/ls.c +++ b/src/bin/ls/ls.c @@ -158,9 +158,6 @@ char *bp = tcapbuf; #endif -//NOTE Fix -return(0x0); - (void)setlocale(LC_ALL, ""); /* Terminal defaults to -Cq, non-terminal defaults to -1. */ diff --git a/src/sys/Makefile.inc b/src/sys/Makefile.inc index d843e43..ba56c08 100644 --- a/src/sys/Makefile.inc +++ b/src/sys/Makefile.inc @@ -2,5 +2,5 @@ # global 'sys' options INCLUDES = -I../include -CFLAGS = -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -O -DNOTIMP -DLD_DEBUG -DVMMDEBUG #-DVFSDEBUG -DDEBUG #-DVMMDEBUG #-DVFSDEBUG +CFLAGS = -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -O -DNOTIMP -DVMMDEBUG #-DLD_DEBUG #-DVFSDEBUG -DDEBUG #-DVMMDEBUG #-DVFSDEBUG KERNEL = ubix.elf diff --git a/src/sys/include/ubixos/ld.h b/src/sys/include/ubixos/ld.h index 8c1b71c..44edcd0 100644 --- a/src/sys/include/ubixos/ld.h +++ b/src/sys/include/ubixos/ld.h @@ -32,7 +32,7 @@ #include -#define LD_START 0x1000000 +#define LD_START 0x60000000 //1.5GIG NOW0x1000000 uInt32 ldEnable(); @@ -40,6 +40,9 @@ /*** $Log$ + Revision 1.1.1.1 2007/01/17 03:31:52 reddawg + UbixOS + Revision 1.1.1.1 2006/06/01 12:46:14 reddawg ubix2 diff --git a/src/sys/init/main.c b/src/sys/init/main.c index f806908..459a908 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -134,22 +134,16 @@ if(sysTask == NULL) kprintf("OS: Unable to allocate memory\n"); - kprintf("T"); - /* Execute System Task */ // Send stack size to app zero there? memset(sysTask,0x0,0x2000); execThread(systemTask, (uInt32)sysTask+0x2000,0x0); - kprintf("P"); - /* Execute Init Process */ execFile("sys:/bin/init",0x0,0x0,0x0); /* OS Initializer */ - kprintf("BOO\n"); // execFile("sys:/bin/login",0x0,0x0,0x1); // execFile("sys:/bin/login",0x0,0x0,0x2); - irqEnable(0x0); while (0x1) diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 5bcf39b..7517aee 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -486,8 +486,8 @@ case PT_INTERP: interp = (char *)kmalloc(programHeader[i].phFilesz); fseek(tmpFd,programHeader[i].phOffset,0); - kprintf("R: %i, %i\n",fread((void *)interp,programHeader[i].phFilesz,1,tmpFd),programHeader[i].phFilesz); #ifdef LD_DEBUG + kprintf("R: %i, %i\n",fread((void *)interp,programHeader[i].phFilesz,1,tmpFd),programHeader[i].phFilesz); kprintf("Interp: [%s]\n",interp); #endif ldAddr = ldEnable(); @@ -497,7 +497,6 @@ } } - kprintf("What is this doing?\n"); /* What is this doing? 11/23/06 */ if (elfDynamicS != 0x0) { for (i=0;i<12;i++) { @@ -544,7 +543,7 @@ //! Clean the virtual of COW pages left over from the fork //QUESTION Why did I feel a need to add vm_dsize to vm_daddr - kprintf("First: 0x%X, 0x%X\n",_current->td.vm_dsize,_current->td.vm_daddr); + //kprintf("First: 0x%X, 0x%X\n",_current->td.vm_dsize,_current->td.vm_daddr); vmm_cleanVirtualSpace((u_int32_t)_current->td.vm_daddr + (_current->td.vm_dsize << PAGE_SHIFT)); //! Adjust iframe @@ -553,25 +552,17 @@ iFrame->eip = binaryHeader->eEntry; iFrame->user_esp = STACK_ADDR - 12; - //if (_current->id > 3) { + iFrame->user_esp = ((u_int32_t)STACK_ADDR) - (sizeof(u_int32_t) * (argc + 3)); + tmp = (u_int32_t *)iFrame->user_esp; - iFrame->user_esp = ((u_int32_t)STACK_ADDR) - (sizeof(u_int32_t) * (argc + 3)); - tmp = (u_int32_t *)iFrame->user_esp; + //! build argc and argv[] + tmp[0] = argc; + for (i = 0;i < argc;i++) { + tmp[i + 1] = (u_int32_t)argv[i]; + } + tmp[argc + 1] = 0x0; + tmp[argc + 2] = 0x1; - //! build argc and argv[] - tmp[0] = argc; - for (i = 0;i < argc;i++) { - tmp[i + 1] = (u_int32_t)argv[i]; - } - tmp[argc + 1] = 0x0; - tmp[argc + 2] = 0x1; - //} - //else { - //tmp = (u_int32_t *)STACK_ADDR - 2; - //tmp[0] = 0x1; - //tmp[1] = 0x0; - //tmp[1] = (u_int32_t)argv; - //} kfree(argvNew); /* Now That We Relocated The Binary We Can Unmap And Free Header Info */ kfree(binaryHeader); diff --git a/src/sys/kernel/ld.c b/src/sys/kernel/ld.c index 15c6d27..3f8b881 100644 --- a/src/sys/kernel/ld.c +++ b/src/sys/kernel/ld.c @@ -86,7 +86,6 @@ for (i = 0x0;i < binaryHeader->ePhnum;i++) { - //kprintf("LD.phType: %i\n",programHeader[i].phType); switch (programHeader[i].phType) { case PT_LOAD: newLoc = (char *)programHeader[i].phVaddr + LD_START; @@ -96,7 +95,7 @@ Settings so it helps us in the future */ //kprintf("LD.phMemsz: 0x%X\n",programHeader[i].phMemsz); - kprintf("phMemsz: %i",programHeader[i].phMemsz >> PAGE_SHIFT); + //kprintf("phMemsz: %i",programHeader[i].phMemsz >> PAGE_SHIFT); vmm_unmapPages(programHeader[i].phVaddr + LD_START,programHeader[i].phMemsz >> PAGE_SHIFT,0x0); for (x=0;x < (programHeader[i].phMemsz);x += 0x1000) { /* make r/w or ro */ @@ -114,9 +113,10 @@ break; case PT_DYNAMIC: newLoc = (char *)programHeader[i].phVaddr + LD_START; + //kprintf("DYN.newLoc: 0x%X\n",newLoc); /* Now Load Section To Memory */ fseek(ldFd,programHeader[i].phOffset,0x0); - //kprintf("fread: [0x%X - 0x%X]",newLoc,fread(newLoc,programHeader[i].phFilesz,1,ldFd)); + fread(newLoc,programHeader[i].phFilesz,1,ldFd); break; case PT_GNU_STACK: /* Tells us if the stack should be executable. Failsafe to executable @@ -146,9 +146,7 @@ elfRel = (elfPltInfo *)kmalloc(sectionHeader[i].shSize); fseek(ldFd,sectionHeader[i].shOffset,0x0); fread(elfRel,sectionHeader[i].shSize,1,ldFd); -#ifdef LD_DEBUG -kprintf("LD_START: 0x%X\n",LD_START); -#endif + for (x=0x0;xeEntry + LD_START; + kprintf("BH.eE: 0x%X",binaryHeader->eEntry); + kfree(dynStr); kfree(shStr); kfree(relSymTab); diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 7008962..47328e9 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -110,7 +110,6 @@ break; } else if (tmpTask->state == DEAD) { - kprintf("WTF"); delTask = tmpTask; tmpTask = tmpTask->next; sched_deleteTask(delTask->id); @@ -179,13 +178,11 @@ } +//Do Not Spin Lock But Must Be Called From Scheduler int sched_deleteTask(pidType id) { kTask_t *tmpTask = 0x0; - kprintf("Deleting: %i\n",id); - /* Checking each task from the prio queue */ - spinLock(&schedulerSpinLock); for (tmpTask = taskList; tmpTask != 0x0; tmpTask = tmpTask->next) { if (tmpTask->id == id) { if (tmpTask->prev != 0x0) @@ -195,11 +192,9 @@ if (taskList == tmpTask) taskList = tmpTask->next; - spinUnlock(&schedulerSpinLock); return(0x0); } } - spinUnlock(&schedulerSpinLock); return(0x1); } diff --git a/src/sys/vfs/mount.c b/src/sys/vfs/mount.c index 4f72900..e6720a4 100644 --- a/src/sys/vfs/mount.c +++ b/src/sys/vfs/mount.c @@ -95,7 +95,7 @@ kfree(mp); return(0x1); } - kprintf("Got Here\n"); + /* Return */ return(0x0); } diff --git a/src/sys/vmm/paging.c b/src/sys/vmm/paging.c index 8e9f3c7..43c167e 100644 --- a/src/sys/vmm/paging.c +++ b/src/sys/vmm/paging.c @@ -503,6 +503,7 @@ if (new > old) { for (i = old;i < new;i+= 0x1000) { + kprintf("(rm: 0x%X)",i); if (vmm_remapPage(vmm_findFreePage(_current->id),i,PAGE_DEFAULT) == 0x0) K_PANIC("remap Failed"); /* Clear Page */ @@ -510,8 +511,9 @@ td->vm_dsize += btoc(new - old); } else if (new < old) { - kprintf("0x%X < 0x%X\n",new,old); - //K_PANIC("new < old"); + for (i = new;i <= old;i += 0x1000) { + vmm_unmapPages(i,1,1); + } td->vm_dsize -= btoc(old - new); } @@ -521,6 +523,7 @@ int munmap(struct thread *td,struct munmap_args *uap) { /* HACK */ //kprintf("munmap: [0x%X:0x%X]",uap->addr,uap->len); + K_PANIC("munmap: not implimented"); return(0x0); }