Commit Graph

967 Commits

Author SHA1 Message Date
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
7cc139c3f7
Make expect and check use unlikely 2022-12-05 13:35:33 +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
792642dd6f
MORE CONST 2022-12-05 12:58:59 +01:00
86a12f301e
Make value_byte a helper 2022-12-05 12:53:16 +01:00
004e13a5f3
Make bitmap methods const if not modifying the bitmap 2022-12-05 12:50:30 +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
ee76bdf84d
Add sanity check 2022-12-04 13:41:14 +01:00
bde3d55eb2
Remove escape from comment 2022-12-04 13:38:48 +01:00
f8120e01c0
Panic in delete as well 2022-12-04 12:58:37 +01:00
22019ac6b2
Print the error instead 2022-12-04 12:57:43 +01:00
96b32f5a93
Please use make<T> and destroy<T> instead of new and delete
Those are there only for common stuff (in the Luna library) that needs an environment-agnostic way of allocating memory.
new and delete are standard, thus we should use those.
2022-12-04 12:55:32 +01:00
adb2c2ab41
Add kernel-side new and delete 2022-12-04 12:52:49 +01:00
b8239698db
Add descriptions in CMakeLists 2022-12-04 12:47:08 +01:00
c7ab6bc2d3
Reorganize the luna/ directory so that headers aren't in the top level include path 2022-12-04 12:42:43 +01:00
cdbed6970a
Result: Add expect_ variants of value() and release_value() 2022-12-04 12:32:34 +01:00
bed29e71af
Replace some uses of check() with expect() 2022-12-04 12:25:16 +01:00
bb92480aa3
Add a variant of check() that accepts an error message 2022-12-04 12:19:17 +01:00
a0c4bbe6f3 Make sure to clean CMake cache when rebuilding 2022-12-04 11:55:47 +01:00
5d9c50eb12 Make build-debug.sh work 2022-12-04 10:27:25 +01:00
9a6d0d1bae Update README.md 2022-12-04 10:07:56 +01:00
37a41f3d2c Add warning message 2022-12-03 17:53:47 +01:00
d72478de29 Update README.md 2022-12-03 17:51:39 +01:00
bbc5470ae4 Update symlink location 2022-12-03 17:39:22 +01:00
e440df58c9 cleanup: remove unused scripts 2022-12-03 17:37:12 +01:00
505dde35ac Make GDB source .gdbconf relative to the root directory 2022-12-03 17:34:36 +01:00
dcd5a82073 Make GDB use the correct kernel file 2022-12-03 17:34:14 +01:00
1d7b9260c3 Add config.h for version information 2022-12-03 17:25:25 +01:00
bdc9747f9e Set a project version 2022-12-03 17:18:25 +01:00
3740309427 Check for STRINGIZE_VALUE_OF before defining it 2022-12-03 17:18:16 +01:00
9c9cb6a05a oopsie 2022-11-30 17:29:18 +01:00
2bc99f2e6e Make log __attribute__(format), so the compiler can warn us of bad format strings 2022-11-30 17:28:46 +01:00
3f40ccd703 Indicate the log level in the serial console 2022-11-30 17:26:33 +01:00
985d45ddfb Switch to logging functions everywhere 2022-11-30 17:16:36 +01:00
d2856d8812 Provide meaningful error numbers 2022-11-30 17:13:59 +01:00