diff --git a/src/bin/init/main.c b/src/bin/init/main.c index 602e799..67efee6 100755 --- a/src/bin/init/main.c +++ b/src/bin/init/main.c @@ -49,7 +49,7 @@ 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/include/ubixfs/ubixfs.h b/src/sys/include/ubixfs/ubixfs.h index 60b1570..0b02669 100755 --- a/src/sys/include/ubixfs/ubixfs.h +++ b/src/sys/include/ubixfs/ubixfs.h @@ -56,4 +56,6 @@ int readFile(char *file); int getFileByte(int fd,int offset); +extern int startSector; + #endif diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index eee982f..3191f4d 100755 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -30,6 +30,7 @@ #include #include #include +#include asm( ".globl _sysCall \n" @@ -87,8 +88,10 @@ elfHeader *binaryHeader = (elfHeader *)0x7C0000; elfProgramheader *programHeader; asm("":"=b"(file)); - kprintf("[%s][%i]\n",file,fdTable[0].status); - fd = fopen(file,1); + asm("sti"); + kprintf("test"); + fd = (int)fopen(file,1); + kprintf("FD: [%i]\n",fd); while(1); for (i=0;feof(fd) == 0;i++) { binarySpace[i] = fgetc(fd); diff --git a/src/sys/ubixfs/file.c b/src/sys/ubixfs/file.c index 0c35c3e..21131e2 100755 --- a/src/sys/ubixfs/file.c +++ b/src/sys/ubixfs/file.c @@ -23,6 +23,7 @@ #include #include +#include struct fileDescriptorTable *fdTable = (struct fileDescriptorTable *)0xECCCC000; @@ -43,18 +44,23 @@ } int fopen(const char *file,int mode) { - int i=0,err=0; + int i=0,ret=0; for (i=0;iid == 1) { while(1); } + return(i); + } + else { return((int)-1); } } } - return(-1); + return((int)-1); } int fgetc(int fd) { diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index f018451..e188aa8 100755 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -26,6 +26,7 @@ #include #include #include +#include int startSector; @@ -91,17 +92,19 @@ int findFile(char *file,struct fileDescriptorTable *head) { int i=0; + bool ret = TRUE; struct fileTableEntry *ft; char data[4096]; - readBlock(startSector,data,8); + ret = (bool)readBlock(startSector,data,8); ft = (void *)data; for (i=0;i<128;i++) { - if (!kstrcmp(ft[i].fileName,file)) { + if ((int)!kstrcmp(ft[i].fileName,file)) { head->start = ft[i].start; head->length = ft[i].length; head->size = ft[i].size; - return(1); + // if (_current->id == 1) { while(1); } + return((int)1); } } - return(0); + return((int)0); } \ No newline at end of file