Commit Graph

10 Commits

Author SHA1 Message Date
momo5502
7d6648ade0 Extend clang-format column limit to 140 2025-08-16 14:55:07 +02:00
Maurice Heumann
9e5a6b509b Implement guard pages (#406)
Hey, looking for feedback on my guard page implementation. 

I wasn't sure on how to structure the additional windows specific memory
flags, since the emulation backends won't like additional guard flag. I
opted to create a new `memory_permission_ext` enum to hold the guard
flag, and a `nt_memory_permission` struct to wrap the "common" memory
permission flags, with the new extended flags. This struct implicitly
coerces to the original `memory_permission` to reduce the amount of
changes for the PR.

This however meant that I changed signatures of `map_memory` and
`apply_memory_protection` in `memory_interface` to accommodate this new
structure, and was an afterthought.

The `map_nt_to_emulator_protection` function might also need some
attention now, too. For future reference, windows uses
[MiMakeProtectionMask](https://doxygen.reactos.org/d1/d9a/marea_8c.html#adfb66408771a4df77c1056cc2a99ef21)
in ntoskrnl to map `PAGE_*` flags to [MM PTE
constants](https://reactos.org/wiki/Techwiki:Memory_management_in_the_Windows_XP_kernel).

The test added to the `test-sample` binary seems to be passing.

Fixes #21
2025-07-17 17:41:06 +02:00
3fault
f1d54f7417 Parameterize basic_memory_region to support extended memory flags 2025-07-17 11:19:56 -04:00
momo5502
08995a4205 Print memory stats 2025-07-12 14:17:52 +02:00
3fault
19574fb512 remove references to nt_memory_permission from backend 2025-07-09 14:43:06 -04:00
3fault
1276c7e2bc Update occurances of memory_permission to nt_memory_permission where needed 2025-07-01 19:04:22 -04:00
momo5502
4f8c374b01 Support initial memory protection 2025-04-14 07:46:19 +02:00
momo5502
d191f8e667 Optimize MMIO handling 2025-04-05 09:03:41 +02:00
Maurice Heumann
2686251fde Cleanup windows-emulator and extract classes 2025-02-10 13:42:49 +01:00
momo5502
6263353438 Isolate memory manager 2025-02-09 18:19:32 +01:00