5911b052dc
libluna: Add more options to to_dynamic_unit()
...
continuous-integration/drone/push Build is passing
Also, make the output look more like how it is on linux.
2023-05-13 12:01:09 +02:00
411c6c40cd
kernel: Add the fchmodat() and fchownat() system calls
continuous-integration/drone/push Build is passing
2023-05-11 19:49:03 +02:00
4a764bc315
tests+libluna: Start testing Format.cpp
continuous-integration/drone/push Build is passing
2023-05-11 16:56:28 +02:00
efc6d03f23
kernel+libc: Add support for unnamed pipes
continuous-integration/drone/push Build is passing
2023-05-10 22:48:31 +02:00
77560bbc3e
kernel+tools: Allow loading files with different owners + add a more dynamic install script
continuous-integration/drone/push Build is passing
2023-05-06 12:11:35 +02:00
58eb2d7703
libc: Print failed assertions to stderr instead of stdout
...
continuous-integration/drone/push Build is passing
This removes two FIXMEs from the time there was no stderr.
2023-05-04 16:37:13 +02:00
d9b7e8edc0
init: Read and launch service files in order using sort()
continuous-integration/drone/push Build is passing
2023-05-02 20:56:28 +02:00
dcd93cce3a
libluna: Add a sort() function
2023-05-02 20:56:27 +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
7058ec945a
libluna: Use a String for name and handle prefix correctly in TarStream
2023-05-02 10:51:53 +02:00
6982a8c07e
libluna: Make String::from_string_view handle non-null-terminated strings properly
2023-05-02 10:51:52 +02:00
1444cbb3df
libluna: Allow constructing a StringView from a string that might not be null-terminated
2023-05-02 10:51:52 +02:00
1d6a39c924
libluna: Make String::split() inline
continuous-integration/drone/push Build is passing
2023-05-01 20:05:10 +02:00
376247ba8a
libluna: Add String::from_string_view()
continuous-integration/drone/push Build is passing
2023-05-01 20:03:16 +02:00
a2303665fc
libos: Add os:: print(), println(), eprint(), and eprintln()
2023-05-01 19:31:15 +02:00
df590f4e26
libluna: Add String::join()
2023-05-01 19:29:17 +02:00
8adfb6fdb9
libluna: Leave String in a valid state when moved
2023-04-28 21:16:43 +02:00
c5a867d81c
libluna: Add wcscmp
2023-04-28 20:00:26 +02:00
15dcd6ad15
libluna: Check the whole string in Utf8StringDecoder::code_points()
2023-04-28 20:00:14 +02:00
b4a5aff071
libluna: Fix UTF-8 encoding
2023-04-28 19:59:40 +02:00
f3ffdd32d4
libluna: Add support for range-based iteration to LinkedList
2023-04-28 15:12:21 +02:00
b1e400d795
libluna: Allow callers to optimize heap allocations by telling us they won't resize the returned memory
...
continuous-integration/drone/push Build is passing
strdup() now does this. If someone resizes strdup()-ed memory, nothing bad will happen, they will just take a small performance hit the first time.
But I think realloc-ing strdup()-ed memory is rare, that's why I did this.
2023-04-27 17:36:25 +02:00
e1ac9473a2
libluna: If allowing garbage chars while decoding Base64, skip them after the padding instead of erroring out
2023-04-26 22:32:24 +02:00
b48d1024a8
libluna: Add Base64 encoding and decoding code
2023-04-26 20:57:48 +02:00
36bc217056
libluna: Allow constructing a Slice from another one with a different pointer type
2023-04-26 20:41:24 +02:00
97e9fceaa4
kernel+libc: Add dup2()
continuous-integration/drone/push Build is passing
2023-04-25 20:37:30 +02:00
403b0f6b94
kernel+libc+init: Add a way to modify the system hostname
continuous-integration/drone/push Build is passing
2023-04-24 21:20:44 +02:00
9eab0886b6
kernel+libc: Add uname()
continuous-integration/drone/push Build is passing
2023-04-24 20:34:44 +02:00
de25338d6c
libluna: Remove redundant return statements in Result<void>
2023-04-23 21:15:00 +02:00
37547ec640
libluna: Run lint scripts
continuous-integration/drone/push Build is passing
2023-04-23 10:53:48 +02:00
dcc6bbf055
libluna: Add String::trim
2023-04-22 15:19:07 +02:00
fb79e12248
StringView: Add split_once and to_uint
2023-04-20 20:08:49 +02:00
0058df9f01
libluna: Handle * characters correctly in cstyle_format
2023-04-19 19:05:09 +02:00
2ecb1e7c90
Vector: Call destructors on reassignment and call element copy constructors
continuous-integration/drone/push Build is passing
2023-04-18 20:17:05 +02:00
02f8a50b9d
kernel: Replace unlink() with unlinkat()
continuous-integration/drone/push Build is passing
2023-04-18 19:36:29 +02:00
259ea86c20
libluna: Fix compilation
continuous-integration/drone/push Build is passing
2023-04-18 18:49:55 +02:00
8560918931
libluna: Add Result<void>::from_syscall
continuous-integration/drone/push Build is failing
2023-04-18 18:49:24 +02:00
00832163d4
libos: Add Process::exec
continuous-integration/drone/push Build is passing
2023-04-18 18:39:37 +02:00
51eedf2b16
Buffer: Add an is_empty() method
2023-04-18 16:40:37 +02:00
3b4214c8be
dirname: Parse one-character paths properly
continuous-integration/drone/push Build is passing
2023-04-16 11:25:47 +02:00
82e7b0e860
kernel: Introduce *at() syscall framework, add openat() and fstatat()
continuous-integration/drone/push Build is passing
2023-04-15 20:26:15 +02:00
60c6e764a4
libos+apps: Add some missing functionality to File and eliminate any trace of C from cat and edit
continuous-integration/drone/push Build is passing
2023-04-13 17:31:21 +02:00
193d63c81b
libluna+libc: Add strpbrk()
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()
continuous-integration/drone/push Build is passing
2023-04-10 19:56:03 +02:00
76eb8cd129
kernel: Add an ioctl() system call
2023-04-09 11:22:57 +02:00
059c2bfa3f
kernel+libc: Add chown and chmod
2023-04-08 14:47:34 +02:00
0f8a46ab67
Vector: Copy the right amount in try_dequeue()
...
I always forget to multiply by sizeof(T)...
2023-04-08 14:46:58 +02:00
3da1849c99
kernel+libc: Add set* and get* syscalls for UIDs and GIDs
2023-04-08 13:50:18 +02:00
fe348d56c0
String+StringView: Add split()
2023-04-07 15:14:46 +02:00
3a28771520
kernel+libc+apps: Add support for environment variables
2023-04-07 15:03:38 +02:00
0f678f845c
String: Add operator=
continuous-integration/drone/push Build is passing
2023-04-07 12:14:21 +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
4e48d024d9
libluna: Add StringBuilder
2023-04-07 11:53:52 +02:00
a9b5cf99f7
UBSAN: Add __ubsan_handle_nonnull_arg
2023-04-07 11:53:19 +02:00
1210d2b7da
libluna: Add/remove some const qualifiers
2023-04-07 11:52:20 +02:00
1c6fd95a70
Result: Add from_syscall()
2023-04-07 10:56:49 +02:00
baa2296aed
Result: Add try_{set,move}_value_or_error
2023-04-07 10:43:29 +02:00
9b8996adeb
libluna: Add String::format
2023-04-07 10:37:00 +02:00
e241c70aad
Vector: Call destructors on deallocation
...
continuous-integration/drone/push Build is passing
I hate the Gitea web editor on a phone.
2023-04-01 08:56:21 +00:00
e6645ed607
StringView+apps: Add a _sv literal suffix to not confuse function overloads
...
C++ was being naughty and implicitly casting our fallback const char* to a boolean.
2023-03-29 22:10:01 +02:00
d68f6bd76b
ArgumentParser+ls: Add switch arguments
continuous-integration/drone/push Build is passing
2023-03-29 19:25:11 +02:00
a164dcc160
libos: Add libos + very basic ArgumentParser
...
continuous-integration/drone/push Build is passing
libluna but for stuff that interests only userspace, like an argument parser or files or stuff like that.
2023-03-29 18:27:02 +02:00
724dab636c
apps: Switch to C++
continuous-integration/drone/push Build is passing
2023-03-29 17:56:56 +02:00
ef01f187c3
libluna: Add StringView
continuous-integration/drone/push Build is passing
2023-03-29 17:43:10 +02:00
01813ff0dd
String: Rename from_string_literal to from_cstring
2023-03-29 17:34:30 +02:00
ee60ab78b3
String: is_empty + proper initialization
2023-03-29 17:32:53 +02:00
b6c35124d6
libluna: OwnedStringView -> String
...
Also with inline storage!
2023-03-29 17:28:22 +02:00
0320ffb485
Vector: Fix operator[]
...
Istg Vector has a curse or something, the annoying and inexplicable bugs always end up in Vector.
2023-03-29 01:05:30 +02:00
0847cfcb65
kernel: Add a getdents() syscall
continuous-integration/drone/push Build is passing
2023-03-28 21:28:56 +02:00
df10544e84
libc: Add libgen.h
continuous-integration/drone/push Build is passing
2023-03-28 19:47:47 +02:00
b8b8d20f5b
Vector: Let realloc do its job and thus avoid a UAF (a particularly nasty one)
...
continuous-integration/drone/push Build is passing
Who even thought that copying from an old pointer passed to realloc() was a good idea?
Me, apparently.
Additionally, the entire point of this memcpy() was to copy the data over from the old buffer (which is already freed btw) to the new buffer, which is already done by realloc.
That's the entire point of realloc. The data is copied over by realloc already.
And even if the old pointer is not unmapped, we scrub freed memory with useless data, so the memcpy sets the vector's buffer to that useless data as well.
I don't even know how I managed to introduce so many bugs into Vector.
At least it should work properly now.
2023-03-28 18:37:12 +02:00
770286a19d
kernel+libc: Implement fcntl() for F_DUPFD and F_DUPFD_CLOEXEC
continuous-integration/drone/push Build is passing
2023-03-24 21:33:20 +01:00
e76ccd6c4c
kernel+libc+init: Add getppid() and wait()
continuous-integration/drone/push Build is passing
2023-03-24 17:39:55 +01:00
b6fb5f3dfe
kernel+libc: Implement waitpid()
continuous-integration/drone/push Build is passing
2023-03-23 22:42:24 +01:00
767dbf521c
Vector: Fix crash when trying to use vector after a call to clear()
2023-03-23 22:19:43 +01:00
83492339ec
Buffer: Add an append_data() method
2023-03-23 21:20:57 +01:00
89ad6869a4
Vector: Add a clear() method
2023-03-23 21:20:41 +01:00
54f2d35416
kernel: Add the fork() system call
2023-03-18 23:45:48 +01:00
49952320d6
kernel+libluna: Remove console_write entirely
continuous-integration/drone/push Build is passing
2023-03-18 20:12:59 +01:00
7173c05a22
kernel: Add support for special device files and add a mknod() syscall
2023-03-18 09:10:33 +01:00
d86da05bea
libluna/TarStream: Remove unused functionality
continuous-integration/drone/push Build is passing
2023-03-17 00:00:27 +01:00
8c72e9a49a
kernel: Add an exec() system call
...
continuous-integration/drone/push Build is passing
Doesn't support arguments or environment for now.
2023-03-16 22:44:58 +01:00
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
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
bd572473ad
kernel: Remove FileDescriptorTable and add a helper to resolve fds to FileDescriptors
2023-03-12 13:57:38 +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
af0cb83a58
libluna+kernel: Get rid of nullcpy()
continuous-integration/drone/push Build is passing
2023-03-12 10:28:50 +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
831973c39a
Option: Allow direct access to the underlying value via operator->
...
Crashes if the Option is empty.
2023-03-11 17:41:11 +01:00
30deed2820
libluna/CPath: Replace size_t with usize
continuous-integration/drone/push Build is passing
2023-03-11 10:39:42 +01:00
d95ef110c9
vfs: Add support for creating directories given a full path
2023-03-11 01:13:44 +01:00
6fd28379a9
TarStream: Add a direct pointer to entry data in the Entry struct
2023-03-11 00:55:26 +01:00