f97e392f89
Add a Scheduler!!
2022-12-07 15:03:34 +01:00
ad11aa719e
Add a Thread class which can be part of a DoublyLinkedList
2022-12-07 15:02:46 +01:00
b9b7d1e201
KernelVM: clean up a bit
2022-12-07 14:48:50 +01:00
c5476115df
CPU.h: pragma once
2022-12-07 14:48:08 +01:00
b93a208f22
Make idle_loop noreturn
2022-12-07 14:46:56 +01:00
7c557b2eb4
Timer: add raw_ticks
2022-12-07 14:31:40 +01:00
7db1a8253b
CPU: Add an idle_loop method
2022-12-07 12:26:09 +01:00
f456eb3b6a
Run clang-format
2022-12-07 12:25:42 +01:00
56205a4a2f
Add a should_invoke_scheduler method
2022-12-07 12:15:30 +01:00
1badc40a4a
Run include-what-you-use everywhere
2022-12-07 11:40:02 +01:00
c2927de191
Remove unused includes
continuous-integration/drone/push Build is passing
2022-12-07 11:22:34 +01:00
dad95a8160
Map the page bitmap to virtual memory
2022-12-07 10:58:59 +01:00
1ebd892c16
Convert uses of u64 to usize
...
Not all of them, but if you're measuring a size it's more appropriate to use usize than u64.
2022-12-07 10:55:47 +01:00
8598b1e8fc
Replace the _noreturn macro with the C++ native attribute [[noreturn]]
continuous-integration/drone/push Build is passing
2022-12-06 19:40:35 +01:00
c099877c35
Remove unnecessary error propagation in Log.cpp
...
continuous-integration/drone/push Build is passing
Serial and TextConsole always succeed, no need to act as if they could fail
2022-12-06 19:35:34 +01:00
314acbfe21
Change the serial log to display only milliseconds
continuous-integration/drone/push Build is passing
2022-12-06 19:31:41 +01:00
39b310b6b9
Make alignment a template parameter to help the compiler optimize
continuous-integration/drone/push Build is passing
2022-12-06 19:27:58 +01:00
d48eb85d1d
Heap: Avoid magic numbers
continuous-integration/drone/push Build is passing
2022-12-06 19:05:00 +01:00
09e447d9d2
Heap: Use LinkedList instead of doing things manually
2022-12-06 18:28:04 +01:00
2734353a5d
Heap: Just align it on a 16-byte boundary if it's not aligned
2022-12-06 18:21:19 +01:00
cccf89dd16
Heap: Remove outdated FIXME
2022-12-06 18:20:18 +01:00
a021e7a309
Move make and destroy to luna
continuous-integration/drone/push Build is passing
2022-12-06 16:41:22 +01:00
b338126854
Heap: Use safe_mul in kcalloc()
2022-12-06 15:44:21 +01:00
8ff9cb4b96
x86_64: Add a friendlier handler for page faults
continuous-integration/drone/push Build is passing
2022-12-05 21:02:21 +01:00
1d0dd8fa93
Use KernelVM in kmalloc() and friends
...
Much better now!!
2022-12-05 21:02:05 +01:00
ba758bcef8
Initialize the KernelVM
2022-12-05 21:01:18 +01:00
6c3024d4ee
Heap: Count the heap blocks' size in the size required for an allocation
2022-12-05 21:01:06 +01:00
0edabd6d87
Heap: Add a new block to the end of the linked list
...
*facepalm*
This was causing page faults when having two blocks and the first one (oldest one) being freed first.
2022-12-05 21:00:21 +01:00
d445b29477
Add a virtual memory allocator for the kernel
2022-12-05 20:36:24 +01:00
762131a425
Make more constexpr
2022-12-05 16:43:52 +01:00
2eaa458555
Remove release_value call
2022-12-05 16:41:39 +01:00
1e3706ac01
Make ARCH_PAGE_SIZE and ARCH_TIMER_FREQ known at compile-time
2022-12-05 16:36:41 +01:00
4f183958e3
General constness + [[gnu::packed]] everywhere
2022-12-05 16:13:38 +01:00
a63a8b32b5
Make new and delete noexcept and return nullptr on failure
2022-12-05 13:45:32 +01:00
891320f7d3
Heap: Make const
2022-12-05 13:41:58 +01:00
ea7893ba71
Make CHECK_PAGE_ALIGNED use expect() instead of check()
2022-12-05 13:28:36 +01:00
55a30ac487
Make CHECK_PAGE_ALIGNED use expect() instead of check()
2022-12-05 13:26:50 +01:00
bfd4647467
Rename largest_free -> largest_free_entry
2022-12-05 13:26:09 +01:00
d9fc50f1ea
Make MemoryMapEntry have private fields with public getters
2022-12-05 13:23:01 +01:00
ec1354fc8d
const in TextConsole
2022-12-05 13:06:12 +01:00
58ecf11424
Make all refs to the bootboot structure const
2022-12-05 13:04:01 +01:00
54ce511f1d
More const
2022-12-05 13:00:41 +01:00
3b77ba6b04
EVERYTHING IS CONSTANT IN THIS UNIVERSE
...
Here's one advantage of Rust over C++:
Immutability by default. In Rust, you have to mark a variable as mutable, whereas in C++ you have to mark it as immutable.
What's the problem here? Usually, most variables don't need mutability. Thus we end up with const all over the place.
2022-12-05 12:49:01 +01:00
af96db3641
Remove bootboot declaration from MemoryManager now that it's MemoryMapIterator's job to walk the mmap
2022-12-04 15:56:25 +01:00
77e64d74a0
Remove unused header
2022-12-04 15:55:52 +01:00
0a296413e6
It's not worth it aborting when failing to determine CPU name
2022-12-04 15:55:12 +01:00
766804b3a0
Use get_blocks_from_size instead of +1
2022-12-04 15:52:56 +01:00
0d10c98477
SImplify init_physical_frame_allocator() even more
2022-12-04 15:50:21 +01:00
5f6c48bd12
Use a friendlier way of iterating over the memory map
2022-12-04 15:45:13 +01:00
5aa2d1fa18
Add a Bitmap class to provide common functionality and use that in the MemoryManager
2022-12-04 15:14:07 +01:00