Commit Graph

910 Commits

Author SHA1 Message Date
552186ad51 Add string_format and vstring_format 2022-11-30 12:36:21 +01:00
1ed51d11cb Do not push unused values 2022-11-23 19:37:25 +01:00
82893fa3a4 Introduce a kernel_yield function to use once a scheduler is implemented 2022-11-23 19:34:04 +01:00
88681bdc74 Default to ninja 2022-11-23 19:01:28 +01:00
7230eceb4d x86_64/Timer: Show explanatory message on static assertion fail 2022-11-23 18:58:39 +01:00
9934719f6b Use a more reliable signed 64-bit type than "long" 2022-11-23 18:05:01 +01:00
88f588a0c5 Make ARCH_TIMER_FREQ less frequent so it is more accurate (I hope) 2022-11-23 18:00:09 +01:00
3b2dc5db55 PlacementNew.h: Use Types.h 2022-11-23 17:22:16 +01:00
46cad14052 Print "All files OK" when all files are using correct types 2022-11-20 18:57:22 +01:00
f982152caa Add a script to manually check files with stdint.h types 2022-11-20 18:54:39 +01:00
2df0bc4238 Convert one tiny type to Types.h in Format.cpp 2022-11-20 18:31:55 +01:00
43e26e583c Calculate the boot timestamp in UNIX time for further usage 2022-11-20 18:30:40 +01:00
459e1ed653 luna/String.h: Convert to Types.h 2022-11-20 18:29:23 +01:00
1f2901d41a Add convenience script to replace stdint.h types with Types.h types 2022-11-20 18:28:46 +01:00
285c3cc411 Add Luna sources to list of sources to be formatted 2022-11-20 18:28:16 +01:00
ff952fa2e4 Confirm alignment when calculating an offset to split at 2022-11-20 18:04:29 +01:00
35b7194fb7 Move initialization into an init() function returning Result<void> so we can use TRY
And remove a lot of testing code as well.
2022-11-20 17:56:07 +01:00
a58b60d0cf Add a framebuffer text renderer 2022-11-20 17:55:22 +01:00
29defdf54d Add a debug function to dump heap usage 2022-11-20 16:33:54 +01:00
d54c882c63 Add new/delete-like functions but with Results 2022-11-20 15:48:08 +01:00
caf6d1563c Kernel: Add a heap memory allocator
This is the first time I've actually dropped liballoc in favor of writing my own implementation.
Usually, malloc() and such looked so complicated that I preferred to let a nice external library do the job.
But I've decided to try writing my own allocator, and now we have heap memory without any 3rd party code!
2022-11-20 15:15:26 +01:00
3815f9aa9f Introduce an offset_ptr function to avoid quirky C pointer arithmetic 2022-11-20 15:12:18 +01:00
cb88630d86 Bugfix: Make alloc_at return the start of the virtual memory range instead of the end 2022-11-20 15:11:53 +01:00
33876dcda4 Use _strto{i,u} in _atou and _atos 2022-11-20 09:28:17 +01:00
bde5de68ca Simplify is_valid_digit_for_base by reaching out to parse_digit_unchecked 2022-11-20 09:24:21 +01:00
44f44aedca Make _strtoi call _strtou, to deduplicate code 2022-11-19 22:52:08 +01:00
30a7d760ae Move a few repeated lambdas into their own functions 2022-11-19 22:48:20 +01:00
af267772f0 Rename MemoryManager::map to map_frames_at
To make it clearer that this API is only intented for mapping contiguous frames of physical memory (for MMIO perhaps?)
2022-11-19 22:32:48 +01:00
1b41a3e9cf Introduce a few helpers to allocate/map/unmap several pages, which wrap around the MMU functionality 2022-11-19 22:28:45 +01:00
c886669d56 Break down operations to make protect_kernel_sections() more readable 2022-11-19 22:27:59 +01:00
d96cb73995 Rename physical "pages" to "frames"
AFAIK, this is the proper naming scheme. "Pages" are virtual, and "frames" physical.
2022-11-19 22:27:08 +01:00
847f2b4f4c Replace more usage of stdint.h types with Luna's Types.h 2022-11-19 22:25:03 +01:00
83bcac7a16 Kernel: Introduce a timer interface 2022-11-19 20:01:01 +01:00
047f445651 Kernel: Add helpers to validate memory addresses 2022-11-19 18:38:47 +01:00
424b069d55 Kernel: Start the call stack with a null RBP on x86_64 2022-11-19 18:38:32 +01:00
db3e34b2ba Result: Add try_set_value()
This helper returns true if the Result contains a value, or false if it doesn't.
Additionally, if it has a value, it sets the passed reference to it.
2022-11-19 18:38:01 +01:00
883a1da0d7 More indentation in CMakeLists.txt 2022-11-19 18:00:45 +01:00
70c6b78e35 Organize source tree 2022-11-19 17:59:49 +01:00
a44e2f41fe Cleanup kernel/CMakeLists.txt 2022-11-19 17:59:39 +01:00
102eabcb4b Do some more formatted logging 2022-11-19 17:52:24 +01:00
83e6bd1322 Make the build system more platform-agnostic 2022-11-19 17:46:53 +01:00
8cae20a82c Move __check_failed out of line so anyone can implement it 2022-11-19 17:20:10 +01:00
2b9bdf560e Move include to .cpp file 2022-11-19 17:19:25 +01:00
b8c136eeb4 Make a common header for attribute shorthands 2022-11-19 17:18:51 +01:00
648bd3fb61 Switch format.h to use Result 2022-11-19 16:13:25 +01:00
31673c0ac9 Introduce format attribute 2022-11-19 15:53:58 +01:00
3cdf224b90 Remove useless files now that functions are out of line 2022-11-19 15:46:46 +01:00
dadc3e570b Move a few functions out of line 2022-11-19 15:43:09 +01:00
56c2ca3381 Add _strtoi and _strtou 2022-11-19 15:27:55 +01:00
bad856afe0 Add %p and %% to cstyle_format 2022-11-19 15:26:29 +01:00