4 * Main program entry point.
6 * (c) 2011 Björn Döbel <doebel@os.inf.tu-dresden.de>,
7 * economic rights: Technische Universität Dresden (Germany)
8 * This file is part of TUD:OS and distributed under the terms of the
9 * GNU General Public License 2.
10 * Please see the COPYING-GPL-2 file for details.
20 #include <l4/re/l4aux.h>
21 #include <l4/util/util.h>
22 #include <l4/sys/debugger.h>
27 Romain::Log::LogLevel Romain::Log::maxLog = Romain::Log::INFO;
28 l4_umword_t Romain::Log::logFlags = Romain::Log::None;
29 bool Romain::Log::withtime = false;
35 static void setup_aux(int argc, const char **argv)
37 l4_umword_t *auxp = (l4_umword_t*)&argv[argc] + 1;
45 Romain::l4re_aux = (l4re_aux_t*)auxp[1];
52 Romain::InstanceManager *_the_instance_manager = NULL;
55 static int _main(int argc, char const **argv)
57 (void)argc; (void)argv;
58 INFO() << "FILE: " << argv[1];
60 setup_aux(argc, argv);
62 Romain::_the_instance_manager = new Romain::InstanceManager(argc-1, &argv[1]);
63 Romain::_the_instance_manager->create_instances();
64 Romain::_the_instance_manager->run_instances();
72 static void sanity_check_cmdline(int argc, char const **argv)
75 _check( argc < 2, "No file name given.");
79 int main(int argc, char const**argv)
81 INFO() << std::hex << &argc;
85 DEBUG() << "argc " << argc;
86 sanity_check_cmdline(argc, argv);
87 err = _main(argc, argv);
89 catch (Argument_error &e) {
90 std::cerr << "Argument error: " << e.str() << "\n";
92 catch (L4::Runtime_error& e) {
93 std::cerr << "Uncaught exception: " << e.str() << "\n";
96 std::cerr << "FATAL uncaught exception of unknown type\n";
98 std::cerr << "Terminating.\n";