cf3b2176f0
Implement OwnedStringView::from_string_literal
continuous-integration/drone/push Build is passing
2022-12-17 11:36:16 +01:00
df9a13cbfb
KernelVM: Make g_used_vm atomic and g_kernelvm_bitmap a LockedValue
continuous-integration/drone/push Build is passing
2022-12-17 10:56:24 +01:00
132963070b
MemoryManager: Make some variables atomic and the frame bitmap a LockedValue
2022-12-17 10:56:24 +01:00
f97515bd7e
Kernel: Add Spinlock and LockedValue<T>
2022-12-17 10:55:54 +01:00
6e5d2b5335
Thread: Make g_next_id atomic
2022-12-17 10:50:49 +01:00
14461c6fe8
Atomic: Add operators += and -=
2022-12-17 10:49:19 +01:00
9d6235e109
CPU: Add a pause() method
2022-12-17 10:45:55 +01:00
a16f357ab9
Add an Atomic class
continuous-integration/drone/push Build is passing
2022-12-16 21:15:22 +01:00
b316e3b3b7
Print stack trace on assertion fail
continuous-integration/drone/push Build is passing
2022-12-16 20:49:09 +01:00
da39ba33a9
Move OwnedStringView::operator[] out of line
2022-12-16 20:48:58 +01:00
59765aa334
Rename String.h -> CString.h
...
continuous-integration/drone/push Build is passing
Let's not confuse String.h with a managed string class, it's in fact the equivalent of the C stdlib's <string.h>
2022-12-16 20:40:04 +01:00
42a2c2af49
Add strdup()
2022-12-16 20:37:57 +01:00
e56075fb46
Use nothrow in raw_malloc
2022-12-16 20:36:43 +01:00
345e13965e
Add missing include
...
continuous-integration/drone/push Build is passing
No one was noticing because everyone using OwnedStringView included Result.h before it
2022-12-16 20:27:44 +01:00
4a6c59d519
Make all methods in OwnedStringView const
continuous-integration/drone/push Build is passing
2022-12-16 19:48:22 +01:00
2e24e09146
Convert MemoryMapIterator to Option
continuous-integration/drone/push Build is passing
2022-12-16 19:47:20 +01:00
a32590ff8a
Call expect_value more
2022-12-16 19:44:33 +01:00
cedcfa9c63
Improve cleanup on MemoryManager failure + add methods that use KernelVM
continuous-integration/drone/push Build is passing
2022-12-16 19:36:38 +01:00
814672c771
Remove some redundant error propagation
...
continuous-integration/drone/push Build is passing
Why can printing to the serial port or format onto a string fail?
Even if cstyle_format returns Result<usize>, we shouldn't always follow suit.
2022-12-16 18:32:29 +01:00
41b3c8adb2
Convert to_dynamic_unit to OwnedStringView and rename the old variant to to_dynamic_unit_cstr
continuous-integration/drone/push Build is passing
2022-12-16 18:18:24 +01:00
be22cf6267
Introduce OwnedStringView
...
A managed String which uses RAII to free its contents. It's not a proper string though, since it's read-only.
So it's a StringView... but an owned one.
Can't be copied automatically, must be either moved or copied manually by calling clone() on it.
2022-12-16 18:17:15 +01:00
d759058b80
Introduce std::nothrow
...
Let's make sure we explicitly tell new that we don't want exceptions
2022-12-16 18:14:48 +01:00
32c8869973
Option: Simplify release_value
...
This avoids copying + we don't need to destroy the item if we move it, since it either gets emptied by moving it or doesn't have anything to destroy.
2022-12-16 18:13:40 +01:00
19a4e2ab58
Result, Option: Make sure everything is properly moved
2022-12-16 18:11:17 +01:00
e729c38200
Merge pull request 'Add an Option type and get rid of ENONE' ( #19 ) from optionals-and-empty-errors into restart
...
continuous-integration/drone/push Build is passing
Reviewed-on: #19
2022-12-08 15:13:24 +00:00
b9f3d3c349
Remove ENONE
...
continuous-integration/drone/pr Build is passing
If you want to return an error without meaning, use Option.
2022-12-08 16:09:33 +01:00
da104c87cb
Heap: Return Option in split()
2022-12-08 16:09:12 +01:00
b6173e2b67
LinkedList: Return Option instead of ENONE if no value
2022-12-08 16:09:04 +01:00
406af68a54
Result: Use Option as backend
2022-12-08 16:08:18 +01:00
b58eba63f1
Add a new Option class which behaves like Result, but has no error number, just a value or no value
2022-12-08 16:08:02 +01:00
6cee208e62
Kernel: Enable -Wsign-conversion
...
continuous-integration/drone/push Build is passing
For real this time, turns out me, being dumb, added it to Luna instead of the kernel.
2022-12-08 15:09:32 +01:00
779fda307a
More scope guards!!
continuous-integration/drone/push Build is passing
2022-12-08 15:01:04 +01:00
1d5d1daa57
Add scope guards
2022-12-08 14:56:11 +01:00
6de7753b4c
Add malloc wrappers
continuous-integration/drone/push Build is passing
2022-12-07 18:17:49 +01:00
c8302a4fef
Add convenience functions to print the stack trace directly
continuous-integration/drone/push Build is passing
2022-12-07 18:11:24 +01:00
0d437cfcca
Add support for stack traces
continuous-integration/drone/push Build is passing
2022-12-07 17:39:59 +01:00
416e96c4d5
Merge pull request 'Add a basic scheduler with threads' ( #18 ) from threads into restart
...
continuous-integration/drone/push Build is passing
Reviewed-on: #18
2022-12-07 16:11:59 +00:00
d93d95f23c
Add sleeping mechanism
2022-12-07 16:11:59 +00:00
757cee4693
Add accessors for when you're sure a linked list is not empty
2022-12-07 16:11:59 +00:00
70497c37fb
Check for runnable threads
2022-12-07 16:11:59 +00:00
57517252d8
Add a state to Thread
2022-12-07 16:11:59 +00:00
f169718a4b
Initialize and demo the scheduler
2022-12-07 16:11:59 +00:00
c907e16311
x86_64: Invoke the scheduler every millisecond
2022-12-07 16:11:59 +00:00
13f5d09cfd
Add a Scheduler!!
2022-12-07 16:11:59 +00:00
12aa014a3d
Add a Thread class which can be part of a DoublyLinkedList
2022-12-07 16:11:59 +00:00
fbd290c01b
KernelVM: clean up a bit
2022-12-07 16:11:59 +00:00
8da5521273
Add a Stack convenience class
2022-12-07 16:11:59 +00:00
0bbd026660
CPU.h: pragma once
2022-12-07 16:11:59 +00:00
5d988c088f
Make idle_loop noreturn
2022-12-07 16:11:59 +00:00
f65ed465c4
Bitmap: Fix crash by attempting to memset -1 bits (UINT64_MAX)
2022-12-07 16:11:59 +00:00