1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 07:07:34 +00:00

UserspaceEmulator: Start sketching out a SoftMMU class :^)

This Emulator sub-object will keep track of all active memory regions
and handle memory read/write operations from the CPU.

A memory region is currently represented by a virtual Region object
that can implement arbitrary behavior by overriding read/write ops.
This commit is contained in:
Andreas Kling 2020-07-09 16:18:47 +02:00
parent 3a73fdd244
commit d5c46cf528
4 changed files with 145 additions and 0 deletions

View file

@ -27,6 +27,7 @@
#pragma once
#include "SoftCPU.h"
#include "SoftMMU.h"
#include <AK/Types.h>
#include <LibX86/Instruction.h>
#include <sys/types.h>
@ -40,9 +41,14 @@ public:
int exec(X86::SimpleInstructionStream&, u32 base);
u32 virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3);
SoftMMU& mmu() { return m_mmu; }
private:
SoftMMU m_mmu;
SoftCPU m_cpu;
void setup_stack();
uid_t virt$getuid();
void virt$exit(int);