1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

Use ELF program headers to load executables smarter.

This turned out way better than the old code. ELF loading is now quite
straightforward, and we don't need the weird concept of subregions anymore.

Next step is to respect the is_writable flag.
This commit is contained in:
Andreas Kling 2018-11-03 11:28:23 +01:00
parent dd060d0fa8
commit aa6d06b47e
9 changed files with 42 additions and 198 deletions

View file

@ -12,7 +12,6 @@
class FileHandle;
class PageDirectory;
class Region;
class Subregion;
class Zone;
class Process : public InlineLinkedListNode<Process> {
@ -130,8 +129,6 @@ public:
size_t regionCount() const { return m_regions.size(); }
const Vector<RetainPtr<Region>>& regions() const { return m_regions; }
size_t subregionCount() const { return m_regions.size(); }
const Vector<OwnPtr<Subregion>>& subregions() const { return m_subregions; }
void dumpRegions();
void didSchedule() { ++m_timesScheduled; }
@ -203,14 +200,12 @@ private:
TTY* m_tty { nullptr };
Region* allocateRegion(size_t, String&& name);
Region* allocateRegion(size_t, String&& name, LinearAddress);
bool deallocateRegion(Region& region);
Region* allocate_region(LinearAddress, size_t, String&& name, bool is_readable = true, bool is_writable = true);
bool deallocate_region(Region& region);
Region* regionFromRange(LinearAddress, size_t);
Vector<RetainPtr<Region>> m_regions;
Vector<OwnPtr<Subregion>> m_subregions;
// FIXME: Implement some kind of ASLR?
LinearAddress m_nextRegion;