08c888eaae
kernel+libc: Remove (de)allocate_memory and replace it with POSIX mmap
continuous-integration/drone/push Build is passing
2023-03-14 20:43:15 +01:00
80a897fbc5
libc: Add fileno()
continuous-integration/drone/push Build is passing
2023-03-12 17:38:35 +01:00
9e9f268562
libc: Make fopen() parse the mode string
2023-03-12 17:36:04 +01:00
d66506256d
kernel/VFS+libc: Introduce modes
continuous-integration/drone/push Build is passing
2023-03-12 16:55:46 +01:00
682d3c753e
kernel+libc: Add mkdir()
continuous-integration/drone/push Build is passing
2023-03-12 15:32:09 +01:00
d2049567c8
libluna+libc: Add strncmp, strncat and strncpy
continuous-integration/drone/push Build is passing
2023-03-12 15:20:44 +01:00
b54a7f3a80
kernel+libc: Add O_* flags and parse them in open()
...
continuous-integration/drone/push Build is passing
O_RDONLY, O_WRONLY, O_RDWR, O_TRUNC, O_CREAT and O_EXCL are fully implemented.
O_APPEND is partially implemented.
Other flags are not here yet.
2023-03-12 14:43:58 +01:00
7e655e320a
kernel+libc: Add the lseek() syscall, and fseek, ftell, rewind, fsetpos, and fgetpos
continuous-integration/drone/push Build is passing
2023-03-12 13:15:24 +01:00
292433dc39
kernel+libc: Add the write() system call, and fwrite()
2023-03-12 11:37:41 +01:00
92dbe58729
libc: Unify function descriptions
continuous-integration/drone/push Build is passing
2023-03-12 11:15:45 +01:00
36e0a1e970
libc: Add definitions for strnlen, strndup and strlcpy to string.h
continuous-integration/drone/push Build is passing
2023-03-12 11:10:18 +01:00
377b8bea43
libc: Adjust comment in string.cpp
continuous-integration/drone/push Build is passing
2023-03-12 10:45:21 +01:00
3b03e19489
libc: Replace usize with size_t in string.h
continuous-integration/drone/push Build is passing
2023-03-12 10:43:13 +01:00
12bc59ead5
libc: Add strspn, strcspn, and strtok declarations to string.h
continuous-integration/drone/push Build is failing
2023-03-12 10:39:38 +01:00
7649b44aab
libc: Add declaration for strrchr (already implemented)
2023-03-12 10:27:07 +01:00
5c0104111d
libc: Implement fopen, fclose, fread, feof, ferror, and clearerr
continuous-integration/drone/push Build is passing
2023-03-12 10:23:08 +01:00
c0a7f6776f
kernel+libc: Add getpid()
continuous-integration/drone/push Build is passing
2023-03-11 22:19:58 +01:00
8fa72f3cf0
kernel+libc: Implement read()
continuous-integration/drone/push Build is passing
2023-03-11 18:02:50 +01:00
810c4bc257
kernel+libc: Start interfacing with the VFS from userspace (open & close)
...
This commit adds open and close syscalls to the kernel, and adds matching wrappers to libc.
No read/write support, so file descriptors are kind of useless for now.
2023-03-11 17:45:20 +01:00
de38eb6877
luna: Remove pure_cstyle_format
...
continuous-integration/drone/push Build is passing
It was causing a lot of code duplication. If someone doesn't have errors, just return {} from the callback and unwrap the Result.
2023-03-02 13:38:21 +01:00
03ed2c3e12
libc: Make dbgln() also print a newline in userspace
...
Previously, dbgln() only printed a newline in kernel-space.
2023-02-25 17:36:03 +01:00
7f8a8cdcaf
kernel, libc: Add an usleep() system call and use that to implement usleep() and sleep() in libc
continuous-integration/drone/push Build is passing
2023-01-22 15:00:20 +01:00
cb59a4e0e3
libc: Add assert.h
continuous-integration/drone/push Build is passing
2023-01-22 12:51:30 +01:00
a6974b605e
tools+CMake: Prefix all environment variables with LUNA_
continuous-integration/drone/push Build is passing
2023-01-21 22:44:16 +01:00
e3ef29e80d
libc: Implement wcstombs()
continuous-integration/drone/push Build is passing
2023-01-14 11:59:08 +01:00
00ee8314b3
luna: Make Utf8String{De,En}coders return the number of bytes written
...
This means we can avoid a call to code_points() in mbstowcs(),
which would parse a string twice.
2023-01-14 11:55:19 +01:00
28bde216c4
libc: Implement perror()
continuous-integration/drone/push Build is passing
2023-01-13 21:08:10 +01:00
e676fb8299
libc: Add a wide range of time manipulation functions, including reentrant variants
2023-01-13 21:06:27 +01:00
2d2db300b0
libc: Add malloc(), calloc(), realloc() and free()
continuous-integration/drone/push Build is passing
2023-01-13 20:00:20 +01:00
5fb2ff09c7
kernel, luna, libc: Move the heap code to a common zone, to be used by both kernel and userspace
2023-01-13 19:27:53 +01:00
d864bda751
libc: Add (de)allocate_memory wrappers located in sys/mman.h
2023-01-13 19:08:02 +01:00
586ca19b62
Add a VERY BASIC and hacky way of allocating memory from userspace
...
continuous-integration/drone/push Build is passing
Only supports one-page allocations and doesn't have libc wrappers, which means it has to be invoked using syscall().
2023-01-11 23:02:42 +01:00
d150c55143
TarStream: Support mode
continuous-integration/drone/push Build is passing
2023-01-11 18:42:50 +01:00
c82ed5df01
Enable -Os on all targets
2023-01-10 18:13:21 +01:00
a620b00b18
Unify libc header descriptions
2023-01-08 15:29:30 +01:00
471103e4f3
Remove the word 'header' from libc header descriptions
continuous-integration/drone/push Build is passing
2023-01-07 11:39:15 +01:00
12dc96b4a5
Fix comment typo
...
continuous-integration/drone/push Build is passing
My bad :(
2023-01-07 11:31:08 +01:00
b70bbc0ba6
More libc commenting
continuous-integration/drone/push Build is passing
2023-01-07 11:21:53 +01:00
7e377ef712
Implement printf()
continuous-integration/drone/push Build is passing
2023-01-07 01:49:26 +01:00
7fb2807d0c
libc: Implement time() using clock_gettime().
...
continuous-integration/drone/push Build is passing
The cool POSIX kids use clock_gettime() now because it has NANOSECONDS (and different clocks!),
but ANSI C prefers this function.
We can still implement it based on clock_gettime(), we just have to discard the NANOSECONDS.
2023-01-07 00:27:23 +01:00
a8a64863c8
kernel, libc: Add clock_gettime()
2023-01-07 00:21:08 +01:00
b851dcf9b9
libc: Implement mbstowcs() using Utf8StringDecoder
continuous-integration/drone/push Build is failing
2023-01-06 21:01:37 +01:00
8891304509
libc: Add ctype.h
2023-01-06 20:48:08 +01:00
80f5c790f8
Implement string formatting into libc :)
...
continuous-integration/drone/push Build is passing
Of course, using <luna/Format.h> makes it so simple. No need for duplicate code!
2023-01-06 20:15:43 +01:00
367a2ce521
libc: header documentation for supported functions
continuous-integration/drone/push Build is passing
2023-01-06 20:02:07 +01:00
c3653cd4e6
More stdlib.h implementation + commenting + atexit()
continuous-integration/drone/push Build is passing
2023-01-06 19:40:25 +01:00
bdfe7dac17
libc: Remove crti.o and crtn.o
...
continuous-integration/drone/push Build is failing
Looks like these are now provided by the compiler.
2023-01-06 17:59:54 +01:00
8838e2cf22
Bring back the OS-Specific Toolchain on restart :^)
continuous-integration/drone/push Build is failing
2023-01-06 17:35:07 +01:00
7acef24494
Make libc depend on crt{0,i,n}.o
continuous-integration/drone/push Build is failing
2023-01-06 14:32:38 +01:00
129e3c434a
Switch to C for userspace, with a very bare-bones libc!!
continuous-integration/drone/push Build is failing
2023-01-06 13:31:14 +01:00