1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:38:10 +00:00

Implement loading of linked ELF executables.

This took me a couple hours. :^)

The ELF loading code now allocates a single region for the entire
file and creates virtual memory mappings for the sections as needed.

Very nice!
This commit is contained in:
Andreas Kling 2018-10-27 14:56:52 +02:00
parent 99ee6acd69
commit 9a71c7759a
16 changed files with 258 additions and 57 deletions

View file

@ -35,6 +35,8 @@ private:
bool copyToZone(Zone&, const void* data, size_t);
#define MM MemoryManager::the()
class MemoryManager {
public:
static MemoryManager& the() PURE;
@ -50,6 +52,11 @@ public:
// HACK: don't use this jeez :(
byte* quickMapOnePage(PhysicalAddress);
bool mapSubregion(Task&, Task::Subregion&);
bool unmapSubregion(Task&, Task::Subregion&);
bool mapSubregionsForTask(Task&);
bool unmapSubregionsForTask(Task&);
bool mapRegion(Task&, Task::Region&);
bool unmapRegion(Task&, Task::Region&);
bool mapRegionsForTask(Task&);
@ -63,6 +70,8 @@ private:
void flushEntireTLB();
void flushTLB(LinearAddress);
void* allocatePageTable();
void protectMap(LinearAddress, size_t length);
void identityMap(LinearAddress, size_t length);