Commit Graph

219 Commits

Author SHA1 Message Date
a0b45a51de
libc: Add rand() + srand()
All checks were successful
continuous-integration/drone/push Build is passing
Very basic random number generator, but that's what rand() is.
If you want secure numbers then use arc4random() or something idk
2023-05-02 21:20:24 +02:00
3628464284
libc: Fix some naming inconsistencies 2023-05-02 20:56:28 +02:00
d1801d484c
libc: Add qsort() 2023-05-02 20:56:27 +02:00
0fad179485
apps+libc+libos: Remove _LUNA_SYSTEM_ERROR_EXTENSIONS and reorder headers
All checks were successful
continuous-integration/drone/push Build is passing
libluna/libos headers can now go after errno.h, so there's no reason to keep them separate.
2023-05-02 10:51:53 +02:00
052ae4902e
libluna: Remove EFIXME and make others declare error_string() and error_name()
Closes #26.
2023-05-02 10:51:53 +02:00
2572d5b238
libc: Add wrapper for the fstatat() system call 2023-05-01 20:00:43 +02:00
458e0a87cc
libc: Fix S_IS* macros 2023-05-01 20:00:10 +02:00
7fbc644753
libc: Add clearenv
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-01 19:06:31 +02:00
967758d464
libc: Implement setenv() and unsetenv()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-30 14:46:34 +02:00
ac4bbd135b
libos: Add Directory::list()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-28 22:41:44 +02:00
3e277b5d6f
libos: Introduce os::Directory 2023-04-28 21:16:43 +02:00
97e9fceaa4
kernel+libc: Add dup2()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-25 20:37:30 +02:00
188a97cf54
libc: Add execlp
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-25 20:25:51 +02:00
89fd57dea4
libc: Propagate all errors in execl() and execvpe() + add execle().
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-25 17:43:11 +02:00
403b0f6b94
kernel+libc+init: Add a way to modify the system hostname
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-24 21:20:44 +02:00
cfb4baab4b
apps: Add uname
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-24 21:02:04 +02:00
9eab0886b6
kernel+libc: Add uname()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-24 20:34:44 +02:00
4f6e020196
kernel+libc: Add framebuffer ioctls
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-21 18:25:53 +02:00
02f8a50b9d
kernel: Replace unlink() with unlinkat()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-18 19:36:29 +02:00
b2fe1f45ef
libc: Define NULL in stdio.h
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-16 22:00:41 +02:00
82e7b0e860
kernel: Introduce *at() syscall framework, add openat() and fstatat()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-15 20:26:15 +02:00
8c4ead0c0f
libc: Add more conversion specifiers to strftime 2023-04-14 21:08:50 +02:00
b7df596f8a
libc: Add strftime()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-13 21:09:27 +02:00
193d63c81b
libluna+libc: Add strpbrk()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-12 18:42:25 +02:00
417e505750
kernel+libc: Add unlink(), rmdir(), remove() 2023-04-12 18:11:36 +02:00
427662d5f1
kernel+libc: Add getcwd() 2023-04-11 22:45:13 +02:00
2a967f4b8b
kernel+libc: Add chdir() 2023-04-11 22:15:21 +02:00
13c9caa856
kernel+libc: Add stat() + fstat()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-10 19:56:03 +02:00
3e5957f9fc
libc: Add ioctl() syscall wrapper 2023-04-09 11:24:13 +02:00
fee33e7a14
kernel: Add ioctls() for termios stuff to ConsoleDevice
Only handles echoing for now.
2023-04-09 11:23:57 +02:00
e5a3bbcbbc
libc: Allow empty fields in the password file
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 22:19:51 +02:00
7667f49d62
libc: Add a password file and pwd.h 2023-04-08 16:30:18 +02:00
059c2bfa3f
kernel+libc: Add chown and chmod 2023-04-08 14:47:34 +02:00
3da1849c99
kernel+libc: Add set* and get* syscalls for UIDs and GIDs 2023-04-08 13:50:18 +02:00
208fdd64ac
execvpe: Execute a shell if errno == ENOEXEC
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:28:26 +02:00
eb3fb04734
libc: Add system()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:18:52 +02:00
9bb1720cca
libc: Add execvp() and execvpe()
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-07 15:39:10 +02:00
3a28771520
kernel+libc+apps: Add support for environment variables 2023-04-07 15:03:38 +02:00
7b8260f3f6
all: Enable/disable debug symbols/optimization in COMMON_FLAGS 2023-04-07 12:07:08 +02:00
d07b00a892
all: Move all warning flags to a common CMake variable 2023-04-07 12:02:49 +02:00
cb67b41a39
libc: Set errno in mbstowcs() and wcstombs() 2023-04-07 10:55:22 +02:00
429e4c9f61
libc: Disable -pedantic
All checks were successful
continuous-integration/drone/push Build is passing
It does not like TRY().
2023-03-30 21:31:35 +02:00
47ee52dc0a
libc: Add execl()
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-30 21:28:39 +02:00
2fbc6105d7
kernel+libc: Add O_DIRECTORY and use it in opendir()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-29 22:23:52 +02:00
724dab636c
apps: Switch to C++
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-29 17:56:56 +02:00
3e30f0a88c
libc: Add opendir, readdir and closedir 2023-03-29 01:06:57 +02:00
0847cfcb65
kernel: Add a getdents() syscall
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-28 21:28:56 +02:00
0d54d0ece1
libc: Check for a compatible mode in fdopen()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-28 20:56:00 +02:00
6239ed83c7
kernel+libc: Add F_GETFD, F_SETFD, F_GETFL and F_SETFL to fcntl 2023-03-28 20:55:38 +02:00
df10544e84
libc: Add libgen.h
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-28 19:47:47 +02:00
d00ca0d3ed
libc: Add setjmp.h
All checks were successful
continuous-integration/drone/push Build is passing
Partially taken from pre-rewrite Luna, converted setjmp.asm to GNU assembly.
2023-03-28 19:40:48 +02:00
d41e5b7b74
libc: Add signal.h and inttypes.h
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-24 22:15:28 +01:00
770286a19d
kernel+libc: Implement fcntl() for F_DUPFD and F_DUPFD_CLOEXEC
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-24 21:33:20 +01:00
374a9ff7b8
kernel+libc: Implement O_CLOEXEC 2023-03-24 21:19:24 +01:00
e76ccd6c4c
kernel+libc+init: Add getppid() and wait()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-24 17:39:55 +01:00
b6fb5f3dfe
kernel+libc: Implement waitpid()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-23 22:42:24 +01:00
41c7e3780d
kernel: Add support for exit codes and start preparing for waitpid() 2023-03-23 22:25:56 +01:00
0e9890901f
libc: Add (f)getc, getchar, and fgets 2023-03-23 21:35:09 +01:00
6f14bf553f
libc: Add missing header to fcntl.h
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-23 19:24:47 +01:00
bab9600be5
libc: Add creat()
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-19 19:21:36 +01:00
31ef96ebfc
libc: Add stdin 2023-03-19 19:19:20 +01:00
51f0bdff0e
kernel+libc: Add O_NONBLOCK
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-19 11:25:14 +01:00
40f01c825d
libc: Add fork()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-18 23:58:56 +01:00
e664af4c2b
libc: Add execv()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-18 22:31:16 +01:00
a4ac3c85ed
kernel+libc: Copy argv to userspace
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-18 22:25:19 +01:00
cb1ef3e404
libc: Add (v)fprintf and make (v)printf use that
All checks were successful
continuous-integration/drone/push Build is passing
Let's free libc of console_write!
2023-03-18 20:11:19 +01:00
629ed9e43b
libc: Start switching to /dev/console for console IO and add a proper init 2023-03-18 19:23:18 +01:00
8c831a6906
libc: Add mknod()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-18 09:13:31 +01:00
7173c05a22
kernel: Add support for special device files and add a mknod() syscall 2023-03-18 09:10:33 +01:00
08c888eaae
kernel+libc: Remove (de)allocate_memory and replace it with POSIX mmap
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-14 20:43:15 +01:00
80a897fbc5
libc: Add fileno()
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 16:55:46 +01:00
682d3c753e
kernel+libc: Add mkdir()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 15:32:09 +01:00
d2049567c8
libluna+libc: Add strncmp, strncat and strncpy
All checks were successful
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()
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 11:10:18 +01:00
377b8bea43
libc: Adjust comment in string.cpp
All checks were successful
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
All checks were successful
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
Some checks failed
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 10:23:08 +01:00
c0a7f6776f
kernel+libc: Add getpid()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-11 22:19:58 +01:00
8fa72f3cf0
kernel+libc: Implement read()
All checks were successful
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-22 15:00:20 +01:00
cb59a4e0e3
libc: Add assert.h
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-22 12:51:30 +01:00
a6974b605e
tools+CMake: Prefix all environment variables with LUNA_
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-21 22:44:16 +01:00
e3ef29e80d
libc: Implement wcstombs()
All checks were successful
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()
All checks were successful
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()
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-07 11:39:15 +01:00
12dc96b4a5
Fix comment typo
All checks were successful
continuous-integration/drone/push Build is passing
My bad :(
2023-01-07 11:31:08 +01:00
b70bbc0ba6
More libc commenting
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-07 11:21:53 +01:00
7e377ef712
Implement printf()
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-07 01:49:26 +01:00
7fb2807d0c
libc: Implement time() using clock_gettime().
All checks were successful
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
Some checks failed
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 :)
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-06 20:02:07 +01:00
c3653cd4e6
More stdlib.h implementation + commenting + atexit()
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-06 19:40:25 +01:00
bdfe7dac17
libc: Remove crti.o and crtn.o
Some checks failed
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 :^)
Some checks failed
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
Some checks failed
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!!
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-06 13:31:14 +01:00