00001
00009
00010
00011
00012
00013
00014 #include <omega0_proto.h>
00015 #include <l4/sys/types.h>
00016 #include <l4/sys/ipc.h>
00017 #include <l4/sys/syscalls.h>
00018 #include <l4/sys/kdebug.h>
00019 #include <l4/sigma0/kip.h>
00020 #include <l4/util/util.h>
00021 #include <l4/log/l4log.h>
00022 #include <l4/names/libnames.h>
00023 #include <l4/rmgr/librmgr.h>
00024 #include <l4/util/parse_cmd.h>
00025 #include <string.h>
00026 #include <stdlib.h>
00027
00028 #include "globals.h"
00029 #include "irq_threads.h"
00030 #include "server.h"
00031 #include "config.h"
00032 #include "events.h"
00033
00034
00035 unsigned MANAGEMENT_THREAD = 0;
00036
00037
00038 int main(int argc, const char**argv)
00039 {
00040 int error;
00041
00042 if ((error = parse_cmdline(&argc, &argv,
00043 'e', "events", "enable exit handling via events",
00044 PARSE_CMD_SWITCH, 1, &use_events,
00045 0)))
00046 return 1;
00047
00048 rmgr_init();
00049
00050 unsigned abi_version;
00051 if ((abi_version = l4sigma0_kip_kernel_abi_version()) < 9)
00052 {
00053 LOG_Error("Fiasco kernel too old (current ABI %d - need >=9)", abi_version);
00054 return 2;
00055 }
00056
00057 attach_irqs();
00058 LOGdl(OMEGA0_DEBUG_STARTUP,"attached to irqs");
00059
00060 if (use_events)
00061 {
00062 init_events();
00063 LOGdl(OMEGA0_DEBUG_STARTUP,"started events thread");
00064 }
00065
00066 if(names_register(OMEAG0_SERVER_NAME)==0)
00067 {
00068 LOGl("error registering at nameserver");
00069 return 1;
00070 }
00071 LOGdl(OMEGA0_DEBUG_STARTUP,"registered at nameserver");
00072
00073 server();
00074 return 0;
00075 }