static void telnet_dbgsh_thread (void *arg) { int ttyin, ttyout; msgregister ("telnet_dbgsh_i", telnet_dbgsh_ttyin_msghandler); msgregister ("telnet_dbgsh_o", telnet_dbgsh_ttyout_msghandler); ttyin = msgopen ("telnet_dbgsh_i"); ttyout = msgopen ("telnet_dbgsh_o"); for (;;) { debug_shell (ttyin, ttyout); telnet_server_output (-1); schedule (); } }
static void dbgsh_thread (void *arg) { int ttyin, ttyout; msgregister ("dbgsh_ttyin", dbgsh_ttyin_msghandler); msgregister ("dbgsh_ttyout", dbgsh_ttyout_msghandler); ttyin = msgopen ("dbgsh_ttyin"); ttyout = msgopen ("dbgsh_ttyout"); for (;;) { debug_shell (ttyin, ttyout); dbgsh_send_to_guest (0x100 | '\n'); schedule (); } }
void storage_init (struct config_data_storage *config_storage) { void crypto_init (void); crypto_init (); cfg = config_storage; storage_desc = msgregister ("storage", storage_msghandler); }
static void keyboard_init_msg (void) { int i; spinlock_init (&keyboard_lock); for (i = 0; i < 128; i++) pressed[i] = false; msgregister ("keyboard", keyboard_msghandler); }
static void dbgsh_thread (void *arg) { int shell, ttyin, ttyout; msgregister ("dbgsh_ttyin", dbgsh_ttyin_msghandler); msgregister ("dbgsh_ttyout", dbgsh_ttyout_msghandler); debug_msgregister (); ttyin = msgopen ("dbgsh_ttyin"); ttyout = msgopen ("dbgsh_ttyout"); for (;;) { shell = newprocess ("shell"); if (ttyin < 0 || ttyout < 0 || shell < 0) panic ("dbgsh_thread"); msgsenddesc (shell, ttyin); msgsenddesc (shell, ttyout); msgsendint (shell, 0); msgclose (shell); schedule (); } }
static void vpn_kernel_init (void) { void vpn_user_init (struct config_data_vpn *vpn, char *seed, int len); #ifdef VPN_PD int i; spinlock_init (&handle_lock); for (i = 0; i < NUM_OF_HANDLE; i++) handle[i] = NULL; vpn_timer_handle = vpn_NewTimer (vpn_timer_callback, NULL); vpnkernel_desc = msgregister ("vpnkernel", vpnkernel_msghandler); if (vpnkernel_desc < 0) panic ("register vpnkernel"); #endif /* VPN_PD */ vpn_user_init (&config.vpn, config.vmm.randomSeed, sizeof config.vmm.randomSeed); #ifdef VPN_PD desc = msgopen ("vpn"); if (desc < 0) panic ("open vpn"); #endif }
void debug_msgregister (void) { memdump = msgregister ("memdump", memdump_msghandler); memfree = msgregister ("free", memfree_msghandler); }
static void time_init_msg (void) { if (false) /* DEBUG */ msgregister ("time", time_msghandler); }