Commit Graph

6 Commits

Author SHA1 Message Date
bef9158450 Kernel, libc: Add isatty() and F_ISTTY to fcntl() 2022-10-21 18:34:31 +02:00
36bb1cab5c FileDescriptor: add operator=() so that the fcntl(F_DUPFD syscall compiles :) 2022-10-15 11:16:18 +02:00
854f585e1a Kernel: Add a seek() system call
Now, time for libc support!!
2022-10-12 15:28:52 +02:00
e67ef7778c VFS: Support writing to files 2022-10-11 21:03:30 +02:00
da2ede3450 Kernel, libc, userspace: Implement file descriptors
Kernel: Implement a descriptor struct which stores the opened node and read offset, and give each task 8 of those.
Implement three syscalls: sys_read, sys_open and sys_close (sys_write still writes to the console instead of using a fd, for now)
Implement three new errors: ENOENT, EBADF and EMFILE.

libc: Implement the new errors, and the new syscalls in syscall().
Also fix _RETURN_WITH_ERRNO() to set errno correctly, which was making strerror() return null, thus crashing perror().

userspace: make init demonstrate the new file API.
2022-10-10 20:21:39 +02:00
63b2de4e3c Basic FDs 2022-10-10 19:00:24 +02:00