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
0e1e15e85a
Result: Construct a Result from an Option using from_option()
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
82b555cf5c
TarStream: Refactor the API to get rid of that awful method in Result
...
continuous-integration/drone/push Build is passing
That method being try_set_value_with_specific_error()
2023-01-11 17:30:53 +01:00
6cf042e65e
Result: Remove m_has_value, rely on Option::has_value()
continuous-integration/drone/push Build is passing
2023-01-11 17:09:32 +01:00
67ebb00bd3
Option, Result: Introduce try_move_value(), which is the release_value() equivalent of try_set_value()
2023-01-11 17:06:17 +01:00
84c82a4e75
luna, kernel: More constness
continuous-integration/drone/push Build is passing
2023-01-10 19:31:41 +01:00
5aa667c776
luna: Make OwnedStringView::clone() just call from_string_literal()
continuous-integration/drone/push Build is passing
2023-01-10 19:03:00 +01:00
3ac3d54788
luna: Make check() and expect() output errors in userspace
2023-01-10 19:02:16 +01:00
c82ed5df01
Enable -Os on all targets
2023-01-10 18:13:21 +01:00
c83f6c03b5
Bitmap: Add a 'find_and_toggle' method
...
continuous-integration/drone/push Build is passing
Just like find(), but toggles the value when finding it.
Avoids doing this manually in MemoryManager and KernelVM.
2023-01-09 18:08:50 +01:00
4287ec6cb0
Bitmap: Introduce a new method 'find' and use it in MM and KernelVM
...
continuous-integration/drone/push Build is passing
This method looks for the first bit with a value, optionally from a starting index, and returns its index.
This should be (haven't benchmarked) way faster than the manual way,
AKA what MM and KernelVM were doing.
This is due to this method using bit and byte manipulation tricks instead of just calling get() until getting the desired result :)
2023-01-09 17:59:52 +01:00
c97f588d44
Fix TRY() with Option
2023-01-07 20:53:23 +01:00
7e377ef712
Implement printf()
continuous-integration/drone/push Build is passing
2023-01-07 01:49:26 +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
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
a01b56ed39
CString: Support strcpy(), strcat() and strchr()
2023-01-06 16:20:35 +01:00
08608d2344
Depend on libc headers
continuous-integration/drone/push Build is failing
2023-01-06 13:38:48 +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
b27cefb9c5
SystemError: Define _LUNA_SYSTEM_ERROR_EXTENSIONS to compile properly in hosted envs
2023-01-06 13:30:49 +01:00
fd8a0175d9
Add a syscall infrastructure (our baby program can print to the console now!)
continuous-integration/drone/push Build is passing
2023-01-05 22:39:56 +01:00
5854e5e530
Add newlines at end-of-file
2023-01-02 13:07:29 +01:00
3442970678
Add vscode configuration
2023-01-02 13:00:22 +01:00
df8f9c6cf6
SharedPtr: adopt_shared_from_owned
continuous-integration/drone/push Build is passing
2022-12-31 12:02:15 +01:00
831711ab7e
TypeTraits: Remove const, volatile, and reference
continuous-integration/drone/push Build is passing
2022-12-31 11:50:30 +01:00
e2e21923d7
Result: Implement operator=()
continuous-integration/drone/push Build is passing
2022-12-30 19:06:47 +01:00
4081186b27
Heap: Rewrite kmalloc to use Option<HeapBlock*> instead of nullable pointers to iterate over the heap
...
continuous-integration/drone/push Build is passing
At some point, this should be done inside LinkedList itself, but we have no such thing as break in for_each().
It's iterate over everything or nothing.
This also requires operator= in Option, might be also added to Result in the future.
2022-12-30 19:02:25 +01:00
3a3968b268
Result: Add nonnull_or_error()
2022-12-30 18:46:27 +01:00
973e39a255
LinkedList: Move nonnull_or_empty_option to Option.h so everyone can use it
2022-12-30 18:46:18 +01:00
28f53f9ccf
LinkedList: Rename the nonnull_or_error() helper to a more accurate nonnull_or_empty_option()
2022-12-30 18:44:37 +01:00
1f36ecd044
LinkedList: Make expect_first() and expect_last() show a more accurate error description on panic
...
Instead of showing a generic "Option::value() called on an empty Option" with no useful source location,
you will get something like "check failed: m_start_node at LinkedList.h:139"
2022-12-30 18:43:39 +01:00
400d0395a2
Result: Avoid double-checking when calling through to the underlying Option
continuous-integration/drone/push Build is passing
2022-12-30 15:00:02 +01:00
7952d1d8a0
x86_64: Add basic keyboard support with an ASYNC DRIVER
continuous-integration/drone/push Build is passing
2022-12-26 19:59:18 +01:00
2af3997456
LinkedList: Fixed some boogs, LinkedList is now boog-free :)
2022-12-26 15:54:29 +01:00
7efb79dd26
LinkedList: Check for nullptrs in detach_from_list()
2022-12-26 12:45:49 +01:00
f71ccde833
Add an overload for aligned deletes which just calls the normal operator delete
2022-12-24 11:49:12 +01:00
e5ae2b0435
TarStream: Make read_contents and friends const
2022-12-23 13:08:31 +01:00
ad0f6546d7
Add a global initrd TarStream to make the initial ramdisk accessible everywhere
...
continuous-integration/drone/push Build is passing
It's also mapped into virtual memory instead of directly going into the physical location!!
2022-12-23 11:33:23 +01:00
c39e54b7c6
Make TarStream::read_contents take any pointer as output
2022-12-23 10:51:55 +01:00
4fa33a9689
SharedPtr: Add operator=
continuous-integration/drone/push Build is passing
2022-12-23 10:31:48 +01:00
bd4b05e534
Add OwnedPtr and SharedPtr
continuous-integration/drone/push Build is passing
2022-12-23 10:23:13 +01:00
9afaad8fed
Add dbgln() for the luna library
continuous-integration/drone/push Build is passing
2022-12-22 18:00:35 +01:00
a3595e71a9
Update .clang-format
continuous-integration/drone/push Build is passing
2022-12-21 20:22:44 +01:00
96135ff808
Use limits.h for the standard definition of WCHAR_MAX
continuous-integration/drone/push Build is passing
2022-12-21 20:11:00 +01:00
16bf8b38ea
UTF-8 decoder: Error out on overlong encodings
continuous-integration/drone/push Build is passing
2022-12-21 20:08:43 +01:00
7a2cb28475
Make sure isize matches ssize_t on most cases
continuous-integration/drone/push Build is passing
2022-12-20 17:12:44 +01:00
a11a5dec1f
DoublyLinkedList -> LinkedList
continuous-integration/drone/push Build is passing
2022-12-19 12:43:23 +01:00
1269a045bd
LinkedList: Add a convenience delayed_for_each() method.
...
This is a special way of iterating over the list which permits removing items while iterating.
2022-12-19 12:41:25 +01:00
5b72144fac
Add a handy consume() method to LinkedList
continuous-integration/drone/push Build is passing
2022-12-19 12:35:08 +01:00