Simple ELF program loader

Now any initrd file is treated like a program image and passed to the
loader to load as a process. Very rudimentary elf loading just allocates
pages, copies sections, and sets the ELF's entrypoint as the RIP to
iretq to.
This commit is contained in:
Justin C. Miller
2018-09-06 01:31:47 -07:00
parent 3d0b262435
commit 585abe9a18
13 changed files with 321 additions and 51 deletions

View File

@@ -24,6 +24,12 @@ public:
/// \arg apic Pointer to the local APIC object
scheduler(lapic *apic);
/// Create a new process from a program image in memory.
/// \arg name Name of the program image
/// \arg data Pointer to the image data
/// \arg size Size of the program image, in bytes
void create_process(const char *name, const void *data, size_t size);
/// Start the scheduler working. This may involve starting
/// timer interrupts or other preemption methods.
void start();
@@ -41,6 +47,7 @@ private:
lapic *m_apic;
kutil::vector<process> m_processes;
uint16_t m_current;
uint16_t m_next_pid;
static scheduler s_instance;
};