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
e5a41d2d52
tmpfs: Implement FileInode read() and write()
2023-03-11 00:52:39 +01:00
89bea931cd
libluna: Add a very simple Buffer class, to help implement tmpfs files
continuous-integration/drone/push Build is passing
2023-03-11 00:27:08 +01:00
4c66017807
libluna: Add PathParser, a C++-style way of iterating over path sections
...
Still uses strtok under the hood, though.
2023-03-10 22:17:16 +01:00
5a9da55e05
libluna/CString: Implement strspn and strcspn, and using those implement strtok
2023-03-10 21:32:18 +01:00
41203df472
libluna/Vector: Use bytes instead of count in resize()
...
This fixes a bug that was causing the heap linked list to become quite corrupted.
2023-03-10 21:07:08 +01:00
e8a401efc2
libluna/Heap: Crash the kernel (but not userspace) on invalid frees
...
This makes them way easier to catch and forces us to get those out of the way.
2023-03-10 21:02:09 +01:00
c376477080
libluna/StaticString: Rename OSize to OtherSize
continuous-integration/drone/push Build is passing
2023-03-08 16:41:09 +01:00
c51b119eb4
StaticString: Add a constructor that takes in another StaticString
2023-03-07 22:18:34 +01:00
7d045e45c1
libluna/Heap: Zero out newly created heap blocks
2023-03-07 20:45:30 +01:00
eaed109fe9
libluna: Let Alignment.h functions take non-powers-of-two
...
Since the alignment must be known at compile-time, the compiler will optimize for powers of two and leave an inefficient implementation for other values.
2023-03-07 20:37:30 +01:00
80492f6ad3
luna: Add error_name, similar to strerrorname_np from glibc
...
continuous-integration/drone/push Build is passing
man strerrorname_np(3)
2023-03-07 13:14:21 +01:00
3a2e5b7ce0
luna: Adjust cstyle_format's description
continuous-integration/drone/push Build is passing
2023-03-02 13:40:42 +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
b978d02cfb
luna: Fix %% skipping a character
2023-02-27 16:27:45 +01:00
517ef70214
luna: Add UBSAN.cpp to CMakeLists
continuous-integration/drone/push Build is passing
2023-02-27 15:25:20 +01:00
77887eed80
luna -> libluna
continuous-integration/drone/push Build is passing
2023-02-27 15:22:39 +01:00