Commit Graph

67 Commits

Author SHA1 Message Date
e76d903642 apps: make memeater use perror 2022-10-08 12:42:46 +02:00
21e8ea1486 apps: make memeater use strerror() 2022-10-08 12:29:19 +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
5d8b825659 Add a few example apps/demos in C, and make the kernel choose a random one to demonstrate every boot 2022-10-03 21:24:38 +02:00
34aa953dbc Add printf() and puts(), quite primitive, looks like hex printing isn't there yet... 2022-10-03 19:00:10 +02:00
dae2ff8d50 Add mmap and munmap syscalls, and thus, add malloc and free to libc!! (yet again, thanks to the wonderful liballoc) 2022-10-02 20:45:04 +02:00
1ecd24f5d6 Kernel: Add SSE support (enable SSE on boot and save context (user tasks only) on task switch) 2022-10-02 18:53:54 +02:00
d2f9e17c86 Use __luna_abort in init 2022-10-02 18:16:27 +02:00
ae95a528f2 Make function stubs in libc loudly abort instead of silently failing 2022-10-02 18:10:53 +02:00
8e6741ebd6 Rename SYS_version to SYS_getversion 2022-10-02 17:25:56 +02:00
6bacded5cf Update build system 2022-10-02 17:01:30 +02:00
f8a72f15c8 Adjust build system to be more flexible and to work with the new toolchain 2022-10-02 12:44:32 +02:00
c7f46f96ff Use the new syscalls in init 2022-10-01 17:32:50 +02:00
96f53922c9 Write a (kindof) proper init, at least with the capabilities we have right now 2022-10-01 15:54:42 +02:00
cde850258d Don't assume we are located at /bin/init 2022-10-01 13:16:59 +02:00
1c4383dea4 Add an apps/ folder and build-system to build userspace apps which can now be loaded from the initrd 2022-10-01 12:17:16 +02:00
867d312177 Let's try to start parsing ELFs! 2022-09-30 17:43:14 +02:00