1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +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

@ -49,8 +49,8 @@ ByteBuffer procfs$pid_stack(Task& task)
{
InterruptDisabler disabler;
if (current != &task) {
MemoryManager::the().unmapRegionsForTask(*current);
MemoryManager::the().mapRegionsForTask(task);
MM.unmapRegionsForTask(*current);
MM.mapRegionsForTask(task);
}
struct RecognizedSymbol {
dword address;
@ -78,8 +78,8 @@ ByteBuffer procfs$pid_stack(Task& task)
}
buffer.trim(bufptr - (char*)buffer.pointer());
if (current != &task) {
MemoryManager::the().unmapRegionsForTask(task);
MemoryManager::the().mapRegionsForTask(*current);
MM.unmapRegionsForTask(task);
MM.mapRegionsForTask(*current);
}
return buffer;
}