diff --git a/src/bin/Makefile b/src/bin/Makefile index 37c4f62..a123b29 100644 --- a/src/bin/Makefile +++ b/src/bin/Makefile @@ -1,7 +1,7 @@ # $Id: Makefile 121 2016-01-14 03:18:20Z reddawg $ # The System Makefile (C) 2002 The UbixOS Project -all: init-bin login-bin shell-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin ld-bin ttyd-bin stat-bin #rtld-elf-bin +all: init-bin login-bin shell-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin ld-bin ttyd-bin stat-bin ls-bin #rtld-elf-bin # MrOlsen (2016-01-11) ERROR: weird it didnt like -elf rtld-elf-bin # MrOlsen (2016-01-11) NOTE: edit-bin cat-bin # test-bin pwd-bin cat-bin de-bin ls-bin goofball-bin mount-bin diff --git a/src/bin/clock/main.c b/src/bin/clock/main.c index d7c7f49..397c3a4 100644 --- a/src/bin/clock/main.c +++ b/src/bin/clock/main.c @@ -92,11 +92,6 @@ sec = sysTime; printf("[%s][%02d/%02d/%i, %02d:%02d.%02d]\n",argv[0],month,day,year,hour,min,sec); - /* - for (i = 0x0;i < argc;i++) { - printf("argv[%i](0x%X:%s),__progrname(%s), argc: %i\n",i,argv[i],argv[i],__progname,argc); - } - */ return(0); } diff --git a/src/bin/ls/Makefile b/src/bin/ls/Makefile index fe8e375..55ec9fd 100644 --- a/src/bin/ls/Makefile +++ b/src/bin/ls/Makefile @@ -17,12 +17,12 @@ #Objects OBJS = main.o -LIBRARIES = ../../lib/libc_old/libc_old.so +LIBRARIES = ../../build/lib/libc_old.so # Link The Binary $(BINARY) : $(OBJS) $(CC) $(CFLAGS) -o ../../build/bin/$@ $(STARTUP) $(LIBRARIES) $(OBJS) - strip $(BINARY) + #strip $(BINARY) # Compile the source files .cpp.o: diff --git a/src/bin/ls/main.c b/src/bin/ls/main.c index 3f38528..1574b9f 100644 --- a/src/bin/ls/main.c +++ b/src/bin/ls/main.c @@ -23,6 +23,7 @@ #include #include +#include #include @@ -34,14 +35,14 @@ //UbixFS Directory Entry struct directoryEntry { - u_int32_t startCluster; //Starting Cluster Of File - u_int32_t size; //Size Of File - u_int32_t creationDate; //Date Created - u_int32_t lastModified; //Date Last Modified - u_int32_t uid; //UID Of Owner - u_int32_t gid; //GID Of Owner - u_int16_t attributes; //Files Attributes - u_int16_t permissions; //Files Permissions + uint32_t startCluster; //Starting Cluster Of File + uint32_t size; //Size Of File + uint32_t creationDate; //Date Created + uint32_t lastModified; //Date Last Modified + uint32_t uid; //UID Of Owner + uint32_t gid; //GID Of Owner + uint16_t attributes; //Files Attributes + uint16_t permissions; //Files Permissions char fileName[256]; //File Name }; @@ -62,6 +63,7 @@ if (argv == 0x0) { getcwd(pwd,256); +printf("PWD1: %s\n", pwd); if ((fd = fopen(pwd,"rb")) == 0x0) { printf("Error: Reading Directory\n"); exit(1); @@ -69,12 +71,15 @@ } else if (argv[1] == 0x0) { getcwd(pwd,256); +printf("PWD2: %s\n", pwd); if ((fd = fopen(pwd,"rb")) == 0x0) { printf("Error: Reading Directory\n"); exit(1); } } else { + getcwd(pwd,256); +printf("PWD3: %s\n", pwd); fd = fopen(argv[1],"rb"); if (fd->fd == 0x0) { printf("Error: Reading Directory\n"); @@ -85,6 +90,7 @@ fread(dirEntry,fd->size,1,fd); pwd[0] = '/'; for (i=0;i<(fd->size/sizeof(struct directoryEntry));i++) { +printf("[fN: %s]", dirEntry[i].fileName); if ((dirEntry[i].fileName[0] > 0) && (dirEntry[i].fileName[0] != '/')) { for (x=0;x<12;x++) { permsData[x] = '-'; diff --git a/src/bin/shell/main.c b/src/bin/shell/main.c index 737d3b4..36d564e 100644 --- a/src/bin/shell/main.c +++ b/src/bin/shell/main.c @@ -65,11 +65,9 @@ if ( inBuf->args->arg != 0x0 ) { - execProgram( inBuf ); - /* +// execProgram( inBuf ); if (!commands(inBuf)) execProgram(inBuf); - */ } freeArgs( inBuf ); diff --git a/src/lib/libc_old/stdlib/exit.c b/src/lib/libc_old/stdlib/exit.c index 4b8fe26..c79b14e 100644 --- a/src/lib/libc_old/stdlib/exit.c +++ b/src/lib/libc_old/stdlib/exit.c @@ -26,6 +26,6 @@ void exit(int status) { asm( "int %0\n" - : : "i" (0x80),"a" (2),"b" (status) + : : "i" (0x80),"a" (1),"b" (status) ); } diff --git a/src/sys/i386/i386_exec.c b/src/sys/i386/i386_exec.c index fda818f..156aa8d 100644 --- a/src/sys/i386/i386_exec.c +++ b/src/sys/i386/i386_exec.c @@ -499,10 +499,10 @@ /* Make readonly and read/write !!! */ if ( vmm_remapPage( vmmFindFreePage( _current->id ), ((programHeader[i].phVaddr & 0xFFFFF000) + x), PAGE_DEFAULT ) == 0x0 ) { K_PANIC( "Error: Remap Page Failed" ); - } + } /* else { kprintf("rP[0x%X]", (programHeader[i].phVaddr & 0xFFFFF000) + x); - } + } */ memset( (void *) ((programHeader[i].phVaddr & 0xFFFFF000) + x), 0x0, 0x1000 ); @@ -589,7 +589,6 @@ */ } } - kprintf("WTF"); /* _current->td.vm_dsize = seg_size >> PAGE_SHIFT; _current->td.vm_daddr = (char *) seg_addr; @@ -630,7 +629,7 @@ //! Adjust iframe // iFrame = (struct i386_frame *) (_current->tss.esp0 - sizeof(struct i386_frame)); - kprintf( "EBP-1(%i): EBP: [0x%X], EIP: [0x%X], ESP: [0x%X]\n", _current->id, iFrame->ebp, iFrame->eip, iFrame->user_esp ); + //kprintf( "EBP-1(%i): EBP: [0x%X], EIP: [0x%X], ESP: [0x%X]\n", _current->id, iFrame->ebp, iFrame->eip, iFrame->user_esp ); iFrame->ebp = STACK_ADDR; iFrame->eip = binaryHeader->eEntry; @@ -638,13 +637,13 @@ tmp = (void *) iFrame->user_esp; //MrOlsen 2017-11-14 iFrame->user_ebp; - kprintf( "STACK: 0x%X, ESP0: 0x%X\n", iFrame->user_esp, _current->tss.esp0 ); + //kprintf( "STACK: 0x%X, ESP0: 0x%X\n", iFrame->user_esp, _current->tss.esp0 ); //! build argc and argv[] /*MrOlsen Did I Fuck Up Stack? *tmp-- = argc; - kprintf( "xSTACK: 0x%X, ESP0: 0x%X\n", iFrame->user_esp, _current->tss.esp0 ); + //kprintf( "xSTACK: 0x%X, ESP0: 0x%X\n", iFrame->user_esp, _current->tss.esp0 ); if ( argc == 1 ) { *tmp-- = 0x0; @@ -732,8 +731,8 @@ */ tmp = (char *)iFrame->eip; - kprintf("N:[0x%X]\n", tmp[0]); - kprintf( "EBP-4(%i): [0x%X], EBP: [0x%X], EIP: [0x%X], ESP: [0x%X], CR3: [0x%X-0x%X]\n", _current->id, _current->oInfo.vmStart, iFrame->ebp, iFrame->eip, iFrame->user_esp, cr3, kernelPageDirectory ); + //kprintf("N:[0x%X]\n", tmp[0]); + //kprintf( "EBP-4(%i): [0x%X], EBP: [0x%X], EIP: [0x%X], ESP: [0x%X], CR3: [0x%X-0x%X]\n", _current->id, _current->oInfo.vmStart, iFrame->ebp, iFrame->eip, iFrame->user_esp, cr3, kernelPageDirectory ); return (0x0); } diff --git a/src/sys/i386/syscall.c b/src/sys/i386/syscall.c index 3c4d3c2..5ffa196 100644 --- a/src/sys/i386/syscall.c +++ b/src/sys/i386/syscall.c @@ -123,7 +123,7 @@ ************************************************************************/ int sysGetFreePage( struct thread *td, u_int32_t *count) { - kprintf("sysGetFreePage - Count: %i\n", *count); + //MrOlsen 2017-12-15 kprintf("sysGetFreePage - Count: %i\n", *count); return((int) vmmGetFreeVirtualPage(_current->id, *count, VM_THRD)); //return(vmmGetFreeVirtualPage(_current->id, *count, VM_TASK)); } @@ -159,6 +159,7 @@ int sys_getcwd(struct thread *td, struct sys_getcwd_args *args) { if ( args->buf ) sprintf( args->buf, "%s", _current->oInfo.cwd ); +kprintf("[CWD: %s]", _current->oInfo.cwd); return (0); } diff --git a/src/sys/vmm/copyvirtualspace.c b/src/sys/vmm/copyvirtualspace.c index 52d79ab..b216fa2 100644 --- a/src/sys/vmm/copyvirtualspace.c +++ b/src/sys/vmm/copyvirtualspace.c @@ -197,7 +197,7 @@ newPageDirectory[PD_INDEX( PD_BASE_ADDR )] = (u_int32_t)( vmm_getPhysicalAddr( (uInt32) newPageTable ) | PAGE_DEFAULT ); newPageTable[0] = (u_int32_t)( (u_int32_t)( newPageDirectoryAddress ) | PAGE_DEFAULT ); - kprintf( "PD3: %i - 0x%X - 0x%X\n", PD_INDEX( PD_BASE_ADDR ), newPageDirectoryAddress, newPageTable[0] ); + //MrOlsen (2017-12-15) - kprintf( "PD3: %i - 0x%X - 0x%X\n", PD_INDEX( PD_BASE_ADDR ), newPageDirectoryAddress, newPageTable[0] ); vmmUnmapPage( (uInt32) newPageTable, 1 ); diff --git a/src/sys/vmm/createvirtualspace.c b/src/sys/vmm/createvirtualspace.c index dfbb960..faef67b 100644 --- a/src/sys/vmm/createvirtualspace.c +++ b/src/sys/vmm/createvirtualspace.c @@ -116,7 +116,7 @@ newPageDirectory[PD_INDEX( PD_BASE_ADDR )] = (u_int32_t)( vmm_getPhysicalAddr( (uInt32) newPageTable ) | PAGE_DEFAULT ); newPageTable[0] = (u_int32_t)( (u_int32_t)( newPageDirectoryAddress ) | PAGE_DEFAULT ); - kprintf( "PD3: %i - 0x%X - 0x%X\n", PD_INDEX( PD_BASE_ADDR ), newPageDirectoryAddress, newPageTable[0] ); + //MrOlsen 2017-12-15 kprintf( "PD3: %i - 0x%X - 0x%X\n", PD_INDEX( PD_BASE_ADDR ), newPageDirectoryAddress, newPageTable[0] ); vmmUnmapPage( (uInt32) newPageTable, 1 ); diff --git a/src/sys/vmm/getfreevirtualpage.c b/src/sys/vmm/getfreevirtualpage.c index 6e0c959..d43f887 100644 --- a/src/sys/vmm/getfreevirtualpage.c +++ b/src/sys/vmm/getfreevirtualpage.c @@ -137,7 +137,7 @@ if ( type == VM_THRD ) { _current->td.vm_dsize += btoc( count * 0x1000 ); - kprintf( "vm_dsize: [0x%X]][0x%X]\n", ctob( _current->td.vm_dsize ), _current->td.vm_dsize ); + //kprintf( "vm_dsize: [0x%X]][0x%X]\n", ctob( _current->td.vm_dsize ), _current->td.vm_dsize ); } else if ( type == VM_TASK ) _current->oInfo.vmStart += count * 0x1000; @@ -146,7 +146,7 @@ * MMAP Return */ - kprintf( "mmap: [0x%x]\n", start_page ); + //kprintf( "mmap: [0x%x]\n", start_page ); /* If No Free Page Was Found Return NULL */ spinUnlock( &fvpSpinLock ); return (start_page); diff --git a/src/sys/vmm/paging.c b/src/sys/vmm/paging.c index 258e0a8..f2872f6 100644 --- a/src/sys/vmm/paging.c +++ b/src/sys/vmm/paging.c @@ -636,7 +636,7 @@ for ( y = 0; y < 1024; y++ ) { if ( (pageTableSrc[y] & PAGE_PRESENT) == PAGE_PRESENT ) { if ( (pageTableSrc[y] & PAGE_COW) == PAGE_COW ) { - kprintf( "COW: 0x%X", (x * 0x400000) + (y * 0x1000) ); + //kprintf( "COW: 0x%X", (x * 0x400000) + (y * 0x1000) ); pageTableSrc[y] = 0x0; } else if ( (pageTableSrc[y] & PAGE_STACK) == PAGE_STACK ) {