1 /*
2 * (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
4 *
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
8 */
9 #include "boot_fs.h"
10 #include "loader_elf.h"
11 #include "debug.h"
12
13 #include <cstring>
14 #include <l4/libloader/elf>
15
16
17 bool
launch(App_task * t,cxx::String const & prog,cxx::String const & args)18 Elf_loader::launch(App_task *t, cxx::String const &prog,
19 cxx::String const &args)
20 {
21 Dbg ldr(Dbg::Loader, "ldr");
22 Moe_x_app_model am(t, prog, args);
23 Ldr::Elf_loader<Moe_x_app_model, Dbg>::launch(&am, "rom/l4re", ldr);
24 return true;
25 }
26
27 bool
check_file_type(Moe::Dataspace const * file) const28 Elf_loader::check_file_type(Moe::Dataspace const *file) const
29 {
30 char const *data = file->address(0).adr<char const*>();
31 return memcmp(data, "\177ELF", 4) == 0;
32 }
33