start executing

This commit is contained in:
2026-05-12 14:02:34 +02:00
parent 0b1d14bcd5
commit fc5beebd8e
12 changed files with 144 additions and 13 deletions
+5 -2
View File
@@ -1,10 +1,11 @@
#include <loaders/elf.hpp>
#include <mem.hpp>
#include <broadway.hpp>
#include <elfio/elfio.hpp>
#include <print>
namespace weee::core {
bool load_elf(const std::string &path, mem &mem) {
bool load_elf(const std::string &path, mem &mem, broadway &broadway) {
ELFIO::elfio reader;
if (!reader.load(path))
return false;
@@ -39,10 +40,12 @@ bool load_elf(const std::string &path, mem &mem) {
continue;
}
mem.copy((const ircolib::u8 *)segment->get_data(), segment->get_file_size(),
mem.copy((ircolib::u8 *)segment->get_data(), segment->get_file_size(),
segment->get_virtual_address() & 0x0FFFFFFF);
}
broadway.set_pc(reader.get_entry());
return true;
}
} // namespace weee::core