Ejemplo n.º 1
0
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 ();
	}
}
Ejemplo n.º 2
0
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 ();
	}
}
Ejemplo n.º 3
0
void
vpn_user_init (struct config_data_vpn *vpn, char *seed, int len)
{
	int d, d1;
	struct config_data_vpn *p;
	char *q;
	struct msgbuf buf[2];

	mp = mempool_new (0, 1, true);
	d = newprocess ("vpn");
	if (d < 0)
		panic ("newprocess vpn");
	d1 = msgopen ("ttyout");
	if (d1 < 0)
		panic ("msgopen ttyout");
	msgsenddesc (d, d1);
	msgsenddesc (d, d1);
	msgclose (d1);
	p = mempool_allocmem (mp, sizeof *p);
	memcpy (p, vpn, sizeof *p);
	q = mempool_allocmem (mp, len);
	memcpy (q, seed, len);
	setmsgbuf (&buf[0], p, sizeof *p, 0);
	setmsgbuf (&buf[1], q, sizeof *q, 0);
	if (msgsendbuf (d, 0, buf, 2))
		panic ("vpn init failed");
	mempool_freemem (mp, q);
	mempool_freemem (mp, p);
	msgclose (d);
}
Ejemplo n.º 4
0
int
_start (int m, int c, struct msgbuf *buf, int bufcnt)
{
	int idman_user_init (void *, char *, int);
	void *tmp;

	if (m != MSG_BUF)
		exitprocess (1);
	printf ("idman (user) init\n");
	usleep_desc = msgopen ("usleep");
	if (usleep_desc < 0) {
		printf ("open usleep failed\n");
		exitprocess (1);
	}
	tmp = alloc (buf[0].len);
	memcpy (tmp, buf[0].base, buf[0].len);
	if (idman_user_init (tmp, buf[1].base, buf[1].len)) {
		printf ("idman init failed\n");
		exitprocess (1);
	}
	if (restrict (16384, 8 * 16384)) {
		printf ("idman restrict failed\n");
		exitprocess (1);
	}
	printf ("ready\n");
	return 0;
}
Ejemplo n.º 5
0
void
sendex (char *buf)
{
	unsigned char d[32];
	int a, i;

	a = msgopen ("recvex");
	if (a < 0) {
		printf ("msgopen failed.\n");
		return;
	}
	memset (d, 0, 32);
	printf ("sending buf %p len 0x%x recvbuf %p len 0x%lx\n",
		buf, strlen (buf), d, (unsigned long)sizeof d);
	if (msgsendbuf (a, 0, buf, strlen (buf), d, sizeof d)) {
		printf ("msgsendbuf failed.\n");
		msgclose (a);
		return;
	}
	msgclose (a);
	printf ("received: ");
	for (i = 0; i < 32; i++)
		printf ("0x%02x ", d[i]);
	printf ("\n");
}
Ejemplo n.º 6
0
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 ();
	}
}
Ejemplo n.º 7
0
void
do_panic_reboot (void)
{
	int d;

	printf ("Reboot in 5 seconds...\n");
	sleep_set_timer_counter ();
	usleep (5 * 1000000);
	printf ("Rebooting...");
	usleep (1 * 1000000);
	d = msgopen ("reboot");
	if (d >= 0) {
		msgsendint (d, 0);
		msgclose (d);
		printf ("Reboot failed.\n");
	} else
		printf ("reboot not found.\n");
}
Ejemplo n.º 8
0
void
handle_init_to_bsp (void)
{
	int d;

	if (config.vmm.auto_reboot == 1) {
		d = msgopen ("reboot");
		if (d >= 0) {
			msgsendint (d, 0);
			msgclose (d);
			printf ("Reboot failed.\n");
		} else {
			printf ("reboot not found.\n");
		}
	}
	if (config.vmm.auto_reboot)
		auto_reboot ();
	panic ("INIT signal to BSP");
}
Ejemplo n.º 9
0
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
}