diff --git a/src/bin/init/main.c b/src/bin/init/main.c index 8afb619..6db8033 100755 --- a/src/bin/init/main.c +++ b/src/bin/init/main.c @@ -44,12 +44,13 @@ exit(1); } printf("Initializing system.\n"); -/* if (!fork()) { + if (!fork()) { printf("I'm The Child\n"); + exec("shell"); while(1); - } */ + } printf("I'm The Parent!\n"); - exec("shell"); +// exec("shell"); while (1); exit(1); } \ No newline at end of file diff --git a/src/sys/init/main.c b/src/sys/init/main.c index bce3231..7a68402 100755 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -89,20 +89,7 @@ initFloppy(); //Initialize Floppy Controller initUbixFS(); execThread(idleThread,0xAFFF,"Idle Thread"); - //execFile("shell"); execFile("init"); - //execThread(test,0xCFFF,"Test"); - /* - while(1) { - fd = fopen("COPYRIGHT",1); - while (ch != -1) { - ch = getFileByte(fd,i); - kprintf("%c",ch); - i++; - } - fclose(fd); - } - */ enableIrq(0); while (1); } diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index 935a496..48f8a40 100755 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -81,7 +81,7 @@ } void sysExec(int a,int b,int c,int d) { - int fd=0,i=0,x=0,eStart=0,pid; + int fd=0,i=0,x=0; char *binarySpace = (char *)0x7C0000; char *newLoc; char *file; @@ -97,21 +97,12 @@ } programHeader = (elfProgramheader *)(0x7C0000 + binaryHeader->ePhoff); newLoc = (char *)programHeader->phVaddr; - for (x=0;xeEntry; - newLoc = (char *)0x5DC000; - /* - for (i=0;i<4096;i++) { - newLoc[i] = 0x0; - } */ -/* pid = _current->id; - taskList[pid].tss.eip = (long)eStart; */ asm( "jmp *%0\n" : - : "g" (eStart) - ); - //while (1); + : "g" (binaryHeader->eEntry) + ); } diff --git a/ubixos.kdevprj b/ubixos.kdevprj index 49679b5..270409b 100755 --- a/ubixos.kdevprj +++ b/ubixos.kdevprj @@ -440,7 +440,7 @@ type=HEADER [src/sys/include/ubixos/Makefile.am] -files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h,src/sys/include/ubixos/elf.h,src/sys/include/ubixos/syscall.h,src/sys/include/ubixos/syscalls.h,src/sys/include/ubixos/a.out.h,src/sys/include/ubixos/fork.h,src/sys/include/ubixos/bios32.h +files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h,src/sys/include/ubixos/elf.h,src/sys/include/ubixos/syscall.h,src/sys/include/ubixos/syscalls.h,src/sys/include/ubixos/a.out.h,src/sys/include/ubixos/fork.h,src/sys/include/ubixos/bios32.h,src/sys/include/ubixos/kmalloc.h sub_dirs= type=normal @@ -504,6 +504,12 @@ install_location= type=HEADER +[src/sys/include/ubixos/kmalloc.h] +dist=true +install=false +install_location= +type=HEADER + [src/sys/include/ubixos/schedule.h] dist=true install=false @@ -582,7 +588,7 @@ type=DATA [src/sys/kernel/Makefile.am] -files=src/sys/kernel/Makefile,src/sys/kernel/io.c,src/sys/kernel/version.c,src/sys/kernel/kprintf.c,src/sys/kernel/vsprintf.c,src/sys/kernel/idt.c,src/sys/kernel/exec.c,src/sys/kernel/schedule.c,src/sys/kernel/dma.c,src/sys/kernel/idlethread.c,src/sys/kernel/syscall.c,src/sys/kernel/fork.c +files=src/sys/kernel/Makefile,src/sys/kernel/io.c,src/sys/kernel/version.c,src/sys/kernel/kprintf.c,src/sys/kernel/vsprintf.c,src/sys/kernel/idt.c,src/sys/kernel/exec.c,src/sys/kernel/schedule.c,src/sys/kernel/dma.c,src/sys/kernel/idlethread.c,src/sys/kernel/syscall.c,src/sys/kernel/fork.c,src/sys/kernel/kmalloc.c sub_dirs= type=static_library @@ -622,6 +628,12 @@ install_location= type=SOURCE +[src/sys/kernel/kmalloc.c] +dist=true +install=false +install_location= +type=SOURCE + [src/sys/kernel/kprintf.c] dist=true install=false