diff --git a/src/bin/edit/Makefile b/src/bin/edit/Makefile index 190abb4..10f0e81 100644 --- a/src/bin/edit/Makefile +++ b/src/bin/edit/Makefile @@ -9,7 +9,7 @@ LD = ld #Binary File Name -BINARY = init +BINARY = edit #Delete Program REMOVE = rm -f diff --git a/src/bin/edit/main.c b/src/bin/edit/main.c index 562e4fe..e6c4502 100644 --- a/src/bin/edit/main.c +++ b/src/bin/edit/main.c @@ -30,12 +30,23 @@ #include int main(int argc,char **argv) { + char data[512]; + FILE *out; printf("UbixOS Text Editor\n"); + out = fopen("sys:/test.txt","w"); + fread(data,4,1,out); + data[4] = '\0'; + printf("Data: [%s]\n",data); + fwrite("Test Line\n",9,1,out); + fclose(out); return(0); } /*** $Log$ + Revision 1.1.1.1 2006/06/01 12:46:09 reddawg + ubix2 + Revision 1.2 2005/10/12 00:13:28 reddawg Removed diff --git a/src/sys/init/main.c b/src/sys/init/main.c index c12fa02..1e6c525 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -95,7 +95,7 @@ /* New Root Mount Point */ //Old 2 new 10 - if (vfs_mount(0x1,2,0x0,0xAA,"sys","rw") != 0x0) { + if (vfs_mount(0x1,10,0x0,0xAA,"sys","rw") != 0x0) { kprintf("Problem Mounting sys Mount Point\n"); } diff --git a/src/sys/ufs/ufs.c b/src/sys/ufs/ufs.c index e1d25e3..d3de569 100644 --- a/src/sys/ufs/ufs.c +++ b/src/sys/ufs/ufs.c @@ -285,6 +285,11 @@ return(0x0); } +int ufs_writeFile(fileDescriptor *fd, char *data,uInt32 offset,long size) { + kprintf("Writing :)\n"); + return(0x0); + } + /***************************************************************************************** Function: int ufs_initialize() @@ -305,9 +310,9 @@ {NULL, /* prev */ NULL, /* next */ (void *)ufs_initialize, /* vfsInitFS */ - (void *)ufs_readFile, /* vfsRead */ - NULL, /* vfsWrite */ - (void *)ufs_openFile, /* vfsOpenFile */ + (void *)ufs_readFile, /* vfsRead */ + (void *)ufs_writeFile, /* vfsWrite */ + (void *)ufs_openFile, /* vfsOpenFile */ NULL, /* vfsUnlink */ NULL, /* vfsMakeDir */ NULL, /* vfsRemDir */ diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index 192db9c..117ee9a 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -375,11 +375,11 @@ return(tmpFd); } else { - kfree(tmpFd->buffer); - kfree(tmpFd); - spinUnlock(&fdTable_lock); - - return (NULL); + kfree(tmpFd->buffer); + kfree(tmpFd); + spinUnlock(&fdTable_lock); + kprintf("File Not Found?\n"); + return (NULL); } /* Return NULL */ diff --git a/src/tools/Makefile b/src/tools/Makefile index 03b2d24..936aecf 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -43,6 +43,7 @@ (cp ../bin/shell/shell /mnts/ubix/bin) (cp ../bin/clock/clock /mnts/ubix/bin) (cp ../bin/fdisk/fdisk /mnts/ubix/bin) + (cp ../bin/edit/edit /mnts/ubix/bin) (cp ../bin/ld/ld.so /mnts/ubix/lib) (cp ../lib/libc_old/libc_old.so /mnts/ubix/lib) (cp ../lib/ubix_api/ubix_api.so /mnts/ubix/lib)