Commit Graph

15 Commits

Author SHA1 Message Date
98da473fdc Run clang-format 2022-11-08 19:07:43 +01:00
249c79f8a3 Kernel, libc: Add ioctl()
Right now, only the framebuffer supports this system call, to query its dimensions.
2022-11-02 20:59:42 +01:00
8f2308c80d Kernel: Implement mmap-able device files (regular files are not mmap-able yet) 2022-11-02 20:24:07 +01:00
534500cda0 Implement enough runtime for binutils to compile 2022-10-31 12:29:53 +01:00
52d4f34f05 Kernel, libc: Implement umask() 2022-10-30 19:55:38 +01:00
32e09d3417 libc: Stub out more functionality so part of binutils builds 2022-10-29 09:39:12 +02:00
26b20938de Kernel, libc: Use mode in mkdir() 2022-10-28 17:11:35 +02:00
d93a4062a2 libc: Do not use the heavy variadic syscall() function for wrappers
That function is meant more for user programs, and should still be rarely used, since it's not portable.
Instead, we already know the number of arguments. We just call __lc_fast_syscallN, which also sets errno.
2022-10-27 17:42:00 +02:00
58b01b74e2 Kernel, libc: Add stat() 2022-10-23 18:35:32 +02:00
fcf191aa7a Kernel, libc: Add fstat() 2022-10-21 18:31:09 +02:00
671f2a2de3 Kernel, libc: Implement waitpid()
FIXME: exec() is now doing weird page table stuff. But at least it works, no panics :)
2022-10-18 21:30:52 +02:00
6d821d2638 libc: Add support for mkdir() 2022-10-16 17:37:29 +02:00
225284a6ca libc: Add support for mprotect() 2022-10-15 12:59:13 +02:00
1235ce8b32 Avoid magic numbers 2022-10-08 14:44:48 +02:00
71e15e94af Kernel, libc and userspace: Add basic errno support.
Kernel: Add an errno.h header with definitions for each header,
and return those, negated, from syscalls when there is an error.
mmap() returns an invalid address with errno encoded, instead of
returning a negated errno; this address is encoded as ffffffffffffffEE
where EE is errno in hex.

libc: make syscall() return -1 and set errno on error, instead of
returning the raw return value of the system call. Also, add mmap()
and munmap() wrappers in sys/mman.h :).

userspace: make the memeater program show the value of errno
when allocating memory fails.

Things to improve: add perror() and strerror() to make the errno
experience even better! >.<
2022-10-08 12:06:09 +02:00