diff --git a/sys/fs/vfs/file.c b/sys/fs/vfs/file.c index 2be808b..eb40f76 100644 --- a/sys/fs/vfs/file.c +++ b/sys/fs/vfs/file.c @@ -352,7 +352,8 @@ return (NULL); } - if (file[0] == '.' && file[1] == '\0') + //if (file[0] == "." && file[1] == '\0') + if (strcmp(file, ".") == 0) strcpy(fileName, _current->oInfo.cwd); else strcpy( fileName, file ); @@ -383,6 +384,8 @@ return (0x0); } + kprintf("[fO: %s]", file); + /* This Will Set Up The Descriptor Modes */ tmpFd->mode = 0; for ( i = 0; '\0' != flags[i]; i++ ) { diff --git a/sys/include/sys/ioctl.h b/sys/include/sys/ioctl.h index 38233e0..6a2a0b2 100644 --- a/sys/include/sys/ioctl.h +++ b/sys/include/sys/ioctl.h @@ -44,4 +44,12 @@ speed_t c_ospeed; /* output speed */ }; +struct winsize { + unsigned short ws_row; /* rows, in characters */ + unsigned short ws_col; /* columns, in characters */ + unsigned short ws_xpixel; /* horizontal size, pixels */ + unsigned short ws_ypixel; /* vertical size, pixels */ +}; + #define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */ +#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ diff --git a/sys/kernel/descrip.c b/sys/kernel/descrip.c index f4df918..47f7ac1 100644 --- a/sys/kernel/descrip.c +++ b/sys/kernel/descrip.c @@ -176,48 +176,55 @@ int sys_ioctl(struct thread *td, struct sys_ioctl_args *args) { switch (args->com) { - case TIOCGETA: - if (args->fd == 0 || args->fd == 1) { - struct termios *t = (struct termios *) args->data; + case TIOCGETA: + if (args->fd == 0 || args->fd == 1) { + struct termios *t = (struct termios *) args->data; - t->c_iflag = 0x2B02; - t->c_oflag = 0x3; - t->c_cflag = 0x4B00; - t->c_lflag = 0x5CB; + t->c_iflag = 0x2B02; + t->c_oflag = 0x3; + t->c_cflag = 0x4B00; + t->c_lflag = 0x5CB; - t->c_cc[0] = 4; - t->c_cc[1] = 255; - t->c_cc[2] = 255; - t->c_cc[3] = 127; - t->c_cc[4] = 23; - t->c_cc[5] = 21; - t->c_cc[6] = 18; - t->c_cc[7] = 8; - t->c_cc[8] = 3; - t->c_cc[9] = 28; - t->c_cc[10] = 26; - t->c_cc[11] = 25; - t->c_cc[12] = 17; - t->c_cc[13] = 19; - t->c_cc[14] = 22; - t->c_cc[15] = 15; - t->c_cc[16] = 1; - t->c_cc[17] = 0; - t->c_cc[18] = 20; - t->c_cc[19] = 255; + t->c_cc[0] = 4; + t->c_cc[1] = 255; + t->c_cc[2] = 255; + t->c_cc[3] = 127; + t->c_cc[4] = 23; + t->c_cc[5] = 21; + t->c_cc[6] = 18; + t->c_cc[7] = 8; + t->c_cc[8] = 3; + t->c_cc[9] = 28; + t->c_cc[10] = 26; + t->c_cc[11] = 25; + t->c_cc[12] = 17; + t->c_cc[13] = 19; + t->c_cc[14] = 22; + t->c_cc[15] = 15; + t->c_cc[16] = 1; + t->c_cc[17] = 0; + t->c_cc[18] = 20; + t->c_cc[19] = 255; - t->c_ispeed = 0x9600; - t->c_ospeed = 0x9600; + t->c_ispeed = 0x9600; + t->c_ospeed = 0x9600; - td->td_retval[0] = 0; - } else { - td->td_retval[0] = -1; - } + td->td_retval[0] = 0; + } + else { + td->td_retval[0] = -1; + } break; - default: - kprintf("ioFD:%i:%i!", args->fd, args->com); + case TIOCGWINSZ: + struct winsize *win = struct winsize *) args->data; + win.ws_row = 50; + win.ws_col = 80; + break; + default: + kprintf("ioFD:%i:0x%X!", args->fd, args->com); break; } + td->td_retval[0] = 0x0; return (0x0); } diff --git a/sys/kernel/gen_calls.c b/sys/kernel/gen_calls.c index 96475fe..4be212a 100644 --- a/sys/kernel/gen_calls.c +++ b/sys/kernel/gen_calls.c @@ -43,6 +43,7 @@ /* Exit Syscall */ int sys_exit(struct thread *td, struct sys_exit_args *args) { + kprintf("exit(%i)", args->status); endTask(_current->id); return (0x0); }