diff --git a/src/bin/ld/main.c b/src/bin/ld/main.c index 98003d3..90c7459 100644 --- a/src/bin/ld/main.c +++ b/src/bin/ld/main.c @@ -45,7 +45,6 @@ static Elf32_Dyn *binaryElf32_Dyn = 0x0; //static elfPltInfo *binaryElfRelDyn = 0x0; static elfPltInfo *binaryElfRel = 0x0; -int fTime = 0x0; uInt32 ld(uInt32 got2,uInt32 entry) { int i = 0x0; @@ -56,8 +55,6 @@ uInt32 *reMap = 0x0; FILE *binaryFd = 0x0; - printf("here? [%i]\n",fTime); - fTime = 0xBA; if (binaryHeader == 0x0) { binaryFd = malloc(sizeof(FILE)); @@ -67,12 +64,8 @@ fread(binaryHeader,sizeof(elfHeader),1,binaryFd); } - printf("binarySectionHeader: [0x%X]\n",(uInt32)binarySectionHeader); - if (binarySectionHeader <= 0x5) - binarySectionHeader = 0; if (binarySectionHeader == 0x0) { - printf("b\n"); binarySectionHeader = (elfSectionHeader *)malloc(sizeof(elfSectionHeader)*binaryHeader->eShnum); fseek(binaryFd,binaryHeader->eShoff,0); fread(binarySectionHeader,sizeof(elfSectionHeader),binaryHeader->eShnum,binaryFd); @@ -125,7 +118,6 @@ } } } - printf("Here2\n"); /* if ((binaryElfRelDyn == 0x0) && (relDyn != 0)) { @@ -149,7 +141,6 @@ } */ - printf("Here3\n"); if (binaryElfRel == 0x0) { binaryElfRel = (elfPltInfo *)malloc(binarySectionHeader[rel].shSize); @@ -172,8 +163,6 @@ } */ - printf("Here4\n"); - return(*reMap); } diff --git a/src/bin/ls/main.c b/src/bin/ls/main.c index cbde456..a0e06e9 100644 --- a/src/bin/ls/main.c +++ b/src/bin/ls/main.c @@ -24,6 +24,7 @@ #include #include #include +#include #define permRead 0x8 diff --git a/src/bin/shell/main.c b/src/bin/shell/main.c index 19f9c16..0be249a 100644 --- a/src/bin/shell/main.c +++ b/src/bin/shell/main.c @@ -35,14 +35,9 @@ int main() { - printf("Test\n"); -while(1); - char *buffer = (char *)malloc(512); inputBuffer *inBuf = (inputBuffer *)malloc(sizeof(inputBuffer)); - while (1); - machine = (char *)malloc(32); cwd = (char *)malloc(1024); diff --git a/src/sys/kernel/ld.c b/src/sys/kernel/ld.c index 12328ef..54f77df 100644 --- a/src/sys/kernel/ld.c +++ b/src/sys/kernel/ld.c @@ -98,20 +98,22 @@ K_PANIC("vmmRemapPage: ld"); memset((void *)((programHeader[i].phVaddr & 0xFFFFF000) + x + LD_START),0x0,0x1000); } - kprintf("X: 0x%X\n",x); + //kprintf("X: 0x%X\n",x); /* Now Load Section To Memory */ fseek(ldFd,programHeader[i].phOffset,0x0); fread(newLoc,programHeader[i].phFilesz,1,ldFd); - + //kprintf("Z:[0x%X - 0x%X]\n",programHeader[i].phOffset,programHeader[i].phFilesz); break; case PT_DYNAMIC: + newLoc = (char *)programHeader[i].phVaddr + LD_START; /* Now Load Section To Memory */ fseek(ldFd,programHeader[i].phOffset,0x0); - fread(newLoc,programHeader[i].phFilesz,1,ldFd); + //kprintf("fread: [0x%X - 0x%X]",newLoc,fread(newLoc,programHeader[i].phFilesz,1,ldFd)); break; case PT_GNU_STACK: /* Tells us if the stack should be executable. Failsafe to executable until we add checking */ + kprintf("WTF!"); break; case PT_PAX_FLAGS: /* Not sure... */