was getting an empty pml4e in the wrong context, this is correct now

merge-requests/1/merge
xerox 4 years ago
parent 84441d5a80
commit 585afda693

@ -8,11 +8,14 @@ namespace nasa
dirbase(get_dirbase(v_ctx, pid)),
pid(pid)
{
// find an empty pml4e...
// find an empty pml4e inside of current processes pml4...
const auto current_pml4 =
v_ctx.get_virtual(reinterpret_cast<std::uintptr_t>(
get_dirbase(v_ctx, GetCurrentProcessId())));
for (auto idx = 100u; idx > 0u; --idx)
if (!v_ctx.rkm<pml4e>(v_ctx.get_virtual((
reinterpret_cast<std::uintptr_t>(get_dirbase()) + idx))).value)
this->pml4e_index = idx;
if (!v_ctx.rkm<pml4e>(current_pml4 + (idx * sizeof pml4e)).value)
this->pml4e_index = idx;
// allocate a pdpt
this->new_pdpt.second =

Loading…
Cancel
Save