diff --git a/sys/fs/fat/fat.c b/sys/fs/fat/fat.c index 86b06d0..3a8e1ef 100644 --- a/sys/fs/fat/fat.c +++ b/sys/fs/fat/fat.c @@ -90,6 +90,11 @@ int read_fat(fileDescriptor_t *fd, char *data, off_t offset, long size) { FL_FILE *_file = (FL_FILE*) fd->res; + if (size == 0) { + kprintf("ZERO"); + return (-1); + } + kprintf("Offset(%s): %i:%i", _file->filename, offset, size); if (fl_fseek(_file, offset, 0) != 0) kprintf("SEEK FAILED!"); diff --git a/sys/fs/vfs/file.c b/sys/fs/vfs/file.c index e63fa63..1de72a7 100644 --- a/sys/fs/vfs/file.c +++ b/sys/fs/vfs/file.c @@ -371,6 +371,7 @@ ************************************************************************/ int fgetc(fileDescriptor_t *fd) { int ch = 0x0; + kprintf("[%s:%i]", __FILE__, __LINE__); /* If Found Return Next Char */ if (fd != 0x0) { fd->mp->fs->vfsRead(fd, (char*) &ch, fd->offset, 1); diff --git a/sys/kernel/vfs_calls.c b/sys/kernel/vfs_calls.c index b991b27..af442d8 100644 --- a/sys/kernel/vfs_calls.c +++ b/sys/kernel/vfs_calls.c @@ -199,6 +199,7 @@ break; default: //kprintf("[r:0x%X::%i:%s]",fd->fd, args->fd, fd->fd_type, fd->fd->fileName); + kprintf("[%s:%i]", __FILE__, __LINE__); td->td_retval[0] = fread(args->buf, args->nbyte, 1, fd->fd); } }