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
88af7a915b
Start padding and alternate forms for integers
2022-11-19 13:59:06 +01:00
c48203997a
Move output_integer into a function that accepts value arguments
2022-11-19 13:21:21 +01:00
4ebf244d3b
Support printing some integers in output_integer
2022-11-19 13:15:13 +01:00
603ff46d8c
Add a format implementation
2022-11-19 12:30:36 +01:00
be2e915d0d
Use the standard names for ctype functions if inside moon or _LUNA_OVERRIDE_STDC is defined
2022-11-18 21:17:26 +01:00
1b3243a80c
Add ctype.h functions to the Luna library
2022-11-18 21:12:54 +01:00
762ca844d8
Add CPU::platform_string
2022-11-18 21:04:53 +01:00
109de54822
Provide stubbed handlers for many more x86 exceptions
...
I am now officially a big-boy OS developer, I read the Intel manuals for this!! (Not that the OSDev wiki doesn't have the information, but it was missing descriptions for some more obscure exceptions)
2022-11-18 20:51:25 +01:00
860f13cd7e
Rename align_base to alignment
2022-11-18 18:02:38 +01:00
2e2656a02f
Add static assertions to constexpr functions
2022-11-18 17:59:19 +01:00
9d318d50aa
Use TRY in MMU.cpp
2022-11-16 20:37:41 +01:00
2c9329928c
Replace page_size (function) with ARCH_PAGE_SIZE (constant)
2022-11-16 20:37:32 +01:00
30ac95bcf8
Use usize/isize instead of (s)size_t
...
Since we're using Rust-style integer types already, why not go all in?
2022-11-16 20:30:34 +01:00
7fc5a6b753
Make kernel rodata and data not executable
2022-11-16 20:02:04 +01:00
7f15ba0ac5
Add some interrupt handling
2022-11-16 17:37:18 +01:00
df8666fd73
Remove unneeded label
2022-11-15 20:47:50 +01:00
bb46cd890b
Add GDT and IDT setup and loading + NX if supported
2022-11-15 20:41:59 +01:00
c9feb11366
Introduce a check() method (like assert() but always on)
2022-11-15 19:36:50 +01:00
c319336e3d
Add a CPU interface
2022-11-15 19:10:32 +01:00
e16324887f
MMU: Properly clear flags
2022-11-15 19:10:19 +01:00
3358454833
Add getters for free, used and reserved memory
2022-11-13 16:56:03 +01:00
6a7097c9ec
Add variables for the future
2022-11-13 16:54:07 +01:00
ae235e5538
MMU: unmap and remap for x86_64
2022-11-13 16:51:21 +01:00
ba1bf72e1b
Remove unused include
2022-11-13 16:32:28 +01:00
d6c56fb512
Mapping finally works!!
2022-11-13 16:31:32 +01:00
4c4f72b865
More MMU stuff, but writing still fails
2022-11-13 15:33:53 +01:00