Exemplo n.º 1
0
int main(int argc, char *argv[])
{
	if (argc < 2) {
		printf("Compositor server not specified.\n");
		return 1;
	}
	
	list_initialize(&led_devs);
	int rc = loc_register_cat_change_cb(loc_callback);
	if (rc != EOK) {
		printf("Unable to register callback for device discovery.\n");
		return 1;
	}
	
	led_timer = fibril_timer_create(NULL);
	if (!led_timer) {
		printf("Unable to create LED timer.\n");
		return 1;
	}
	
	frame_timer = fibril_timer_create(NULL);
	if (!frame_timer) {
		printf("Unable to create frame timer.\n");
		return 1;
	}
	
	if (!decode_frames())
		return 1;
	
	winreg = argv[1];
	window_t *main_window = window_open(argv[1], NULL,
	    WINDOW_MAIN | WINDOW_DECORATED, "barber");
	if (!main_window) {
		printf("Cannot open main window.\n");
		return 1;
	}
	
	frame_canvas = create_canvas(window_root(main_window), NULL,
	    FRAME_WIDTH, FRAME_HEIGHT, frames[frame]);
	
	if (!frame_canvas) {
		window_close(main_window);
		printf("Cannot create widgets.\n");
		return 1;
	}
	
	window_resize(main_window, 0, 0, FRAME_WIDTH + 8, FRAME_HEIGHT + 28,
	    WINDOW_PLACEMENT_RIGHT | WINDOW_PLACEMENT_BOTTOM);
	window_exec(main_window);
	
	plan_led_timer();
	plan_frame_timer(0);
	
	task_retval(0);
	async_manager();
	
	return 0;
}
Exemplo n.º 2
0
int main(int argc, char **argv)
{
	printf("%s: HelenOS VFS server\n", NAME);
	
	/*
	 * Initialize VFS node hash table.
	 */
	if (!vfs_nodes_init()) {
		printf("%s: Failed to initialize VFS node hash table\n",
		    NAME);
		return ENOMEM;
	}
	
	/*
	 * Allocate and initialize the Path Lookup Buffer.
	 */
	plb = as_area_create(AS_AREA_ANY, PLB_SIZE,
	    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
	if (plb == AS_MAP_FAILED) {
		printf("%s: Cannot create address space area\n", NAME);
		return ENOMEM;
	}
	memset(plb, 0, PLB_SIZE);
	
	/*
	 * Set client data constructor and destructor.
	 */
	async_set_client_data_constructor(vfs_client_data_create);
	async_set_client_data_destructor(vfs_client_data_destroy);

	/*
	 * Set a connection handling function/fibril.
	 */
	async_set_client_connection(vfs_connection);

	/*
	 * Set notification handler and subscribe to notifications.
	 */
	async_set_interrupt_received(notification_received);
	event_task_subscribe(EVENT_TASK_STATE_CHANGE, VFS_TASK_STATE_CHANGE);
	
	/*
	 * Register at the naming service.
	 */
	int rc = service_register(SERVICE_VFS);
	if (rc != EOK) {
		printf("%s: Cannot register VFS service\n", NAME);
		return rc;
	}
	
	/*
	 * Start accepting connections.
	 */
	printf("%s: Accepting connections\n", NAME);
	async_manager();
	return 0;
}
Exemplo n.º 3
0
int main(int argc, char *argv[])
{
	if (argc >= 2) {
		window_t *main_window = window_open(argv[1], NULL,
		    WINDOW_MAIN | WINDOW_DECORATED | WINDOW_RESIZEABLE, "vdemo");
		if (!main_window) {
			printf("Cannot open main window.\n");
			return 1;
		}

		pixel_t grd_bg = PIXEL(255, 240, 240, 240);
		
		pixel_t btn_bg = PIXEL(255, 240, 240, 240);
		pixel_t btn_fg = PIXEL(255, 186, 186, 186);
		pixel_t btn_text = PIXEL(255, 0, 0, 0);
		
		pixel_t lbl_bg = PIXEL(255, 240, 240, 240);
		pixel_t lbl_text = PIXEL(255, 0, 0, 0);

		my_label_t *lbl_action = create_my_label(NULL, "Hello there!", 16,
		    lbl_bg, lbl_text);
		button_t *btn_confirm = create_button(NULL, NULL, "Confirm", 16,
		    btn_bg, btn_fg, btn_text);
		button_t *btn_cancel = create_button(NULL, NULL, "Cancel", 16,
		    btn_bg, btn_fg, btn_text);
		grid_t *grid = create_grid(window_root(main_window), NULL, 2, 2,
		    grd_bg);
		if (!lbl_action || !btn_confirm || !btn_cancel || !grid) {
			window_close(main_window);
			printf("Cannot create widgets.\n");
			return 1;
		}

		sig_connect(
		    &btn_confirm->clicked,
		    &lbl_action->label.widget,
		    lbl_action->confirm);
		sig_connect(
		    &btn_cancel->clicked,
		    &lbl_action->label.widget,
		    lbl_action->cancel);

		grid->add(grid, &lbl_action->label.widget, 0, 0, 2, 1);
		grid->add(grid, &btn_confirm->widget, 0, 1, 1, 1);
		grid->add(grid, &btn_cancel->widget, 1, 1, 1, 1);
		window_resize(main_window, 0, 0, 200, 76,
		    WINDOW_PLACEMENT_CENTER);

		window_exec(main_window);
		task_retval(0);
		async_manager();
		return 1;
	} else {
		printf("Compositor server not specified.\n");
		return 1;
	}
}
Exemplo n.º 4
0
int main(int argc, char **argv)
{
	printf("%s: HelenOS APIC driver\n", NAME);
	
	if (!apic_init())
		return -1;
	
	printf("%s: Accepting connections\n", NAME);
	task_retval(0);
	async_manager();
	
	/* Never reached */
	return 0;
}
Exemplo n.º 5
0
int main(int argc, char *argv[])
{
	printf("%s: Task Monitoring Service\n", NAME);
	
	if (event_subscribe(EVENT_FAULT, 0) != EOK) {
		printf("%s: Error registering fault notifications.\n", NAME);
		return -1;
	}
	
	async_set_interrupt_received(fault_event);
	task_retval(0);
	async_manager();
	
	return 0;
}
Exemplo n.º 6
0
int main(int argc, char *argv[])
{
	service_id_t service_id;
	int rc;
	int i;

	printf(NAME ": VIA-CUDA Apple Desktop Bus driver\n");

	for (i = 0; i < ADB_MAX_ADDR; ++i) {
		adb_dev[i].client_sess = NULL;
		adb_dev[i].service_id = 0;
	}

	async_set_client_connection(cuda_connection);
	rc = loc_server_register(NAME);
	if (rc < 0) {
		printf(NAME ": Unable to register server.\n");
		return rc;
	}

	rc = loc_service_register("adb/kbd", &service_id);
	if (rc != EOK) {
		printf(NAME ": Unable to register service %s.\n", "adb/kdb");
		return rc;
	}

	adb_dev[2].service_id = service_id;
	adb_dev[8].service_id = service_id;

	rc = loc_service_register("adb/mouse", &service_id);
	if (rc != EOK) {
		printf(NAME ": Unable to register servise %s.\n", "adb/mouse");
		return rc;
	}

	adb_dev[9].service_id = service_id;

	if (cuda_init() < 0) {
		printf("cuda_init() failed\n");
		return 1;
	}

	task_retval(0);
	async_manager();

	return 0;
}
Exemplo n.º 7
0
int main(int argc, char *argv[])
{
	log_init(NAME);
	log_msg(LOG_DEFAULT, LVL_NOTE, "HelenOS UDF 1.02 file system server");
	
	if (argc == 3) {
		if (!str_cmp(argv[1], "--instance"))
			udf_vfs_info.instance = strtol(argv[2], NULL, 10);
		else {
			log_msg(LOG_DEFAULT, LVL_FATAL, "Unrecognized parameters");
			return 1;
		}
	}
	
	async_sess_t *vfs_sess =
	    service_connect_blocking(SERVICE_VFS, INTERFACE_VFS_DRIVER, 0);
	if (!vfs_sess) {
		log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to connect to VFS");
		return 2;
	}
	
	int rc = fs_register(vfs_sess, &udf_vfs_info, &udf_ops,
	    &udf_libfs_ops);
	if (rc != EOK)
		goto err;
	
	rc = udf_idx_init();
	if (rc != EOK)
		goto err;
	
	log_msg(LOG_DEFAULT, LVL_NOTE, "Accepting connections");
	task_retval(0);
	async_manager();
	
	/* Not reached */
	return 0;
	
err:
	log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to register file system (%d)", rc);
	return rc;
}
Exemplo n.º 8
0
int main(int argc, char **argv)
{
	printf(NAME ": HelenOS FAT file system server\n");
	
	if (argc == 3) {
		if (!str_cmp(argv[1], "--instance"))
			fat_vfs_info.instance = strtol(argv[2], NULL, 10);
		else {
			printf(NAME " Unrecognized parameters");
			return -1;
		}
	}

	int rc = fat_idx_init();
	if (rc != EOK)
		goto err;
	
	async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
	    SERVICE_VFS, 0, 0);
	if (!vfs_sess) {
		printf(NAME ": failed to connect to VFS\n");
		return -1;
	}
	
	rc = fs_register(vfs_sess, &fat_vfs_info, &fat_ops, &fat_libfs_ops);
	if (rc != EOK) {
		fat_idx_fini();
		goto err;
	}
	
	printf(NAME ": Accepting connections\n");
	task_retval(0);
	async_manager();
	
	/* Not reached */
	return 0;
	
err:
	printf(NAME ": Failed to register file system (%d)\n", rc);
	return rc;
}
Exemplo n.º 9
0
/** Program loader main function.
 */
int main(int argc, char *argv[])
{
	/* Set a handler of incomming connections. */
	async_set_client_connection(ldr_connection);
	
	/* Introduce this task to the NS (give it our task ID). */
	task_id_t id = task_get_id();
	int rc = ns_intro(id);
	if (rc != EOK)
		return rc;
	
	/* Register at naming service. */
	rc = service_register(SERVICE_LOAD);
	if (rc != EOK)
		return rc;
	
	async_manager();
	
	/* Never reached */
	return 0;
}
Exemplo n.º 10
0
int main(int argc, char **argv)
{
	printf("%s: HelenOS ext4 file system server\n", NAME);
	
	if (argc == 3) {
		if (!str_cmp(argv[1], "--instance"))
			ext4fs_vfs_info.instance = strtol(argv[2], NULL, 10);
		else {
			printf("%s: Unrecognized parameters\n", NAME);
			return 1;
		}
	}
	
	async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
	    SERVICE_VFS, 0, 0);
	if (!vfs_sess) {
		printf("%s: Failed to connect to VFS\n", NAME);
		return 2;
	}
	
	int rc = ext4fs_global_init();
	if (rc != EOK) {
		printf("%s: Global initialization failed\n", NAME);
		return rc;
	}
	
	rc = fs_register(vfs_sess, &ext4fs_vfs_info, &ext4fs_ops,
	    &ext4fs_libfs_ops);
	if (rc != EOK) {
		printf("%s: Failed to register file system\n", NAME);
		return rc;
	}
	
	printf("%s: Accepting connections\n", NAME);
	task_retval(0);
	async_manager();
	
	/* Not reached */
	return 0;
}
Exemplo n.º 11
0
int main(int argc, char *argv[])
{
	int rc;

	printf(NAME ": HelenOS IP over Ethernet service\n");

	if (log_init(NAME) != EOK) {
		printf(NAME ": Failed to initialize logging.\n");
		return 1;
	}

	rc = ethip_init();
	if (rc != EOK)
		return 1;

	printf(NAME ": Accepting connections.\n");
	task_retval(0);
	async_manager();

	/* Not reached */
	return 0;
}
Exemplo n.º 12
0
int main(int argc, char *argv[])
{
	printf(NAME ": HelenOS Logging Service\n");
	
	parse_initial_settings();
	for (int i = 1; i < argc; i++) {
		parse_level_settings(argv[i]);
	}

	async_set_client_connection(connection_handler);
	
	int rc = service_register(SERVICE_LOGGER);
	if (rc != EOK) {
		printf(NAME ": failed to register: %s.\n", str_error(rc));
		return -1;
	}
	
	printf(NAME ": Accepting connections\n");
	async_manager();
	
	/* Never reached */
	return 0;
}
Exemplo n.º 13
0
int main(int argc, char **argv)
{
	int rc;
	char *image_name;
	char *device_name;
	category_id_t disk_cat;

	printf(NAME ": File-backed block device driver\n");

	block_size = DEFAULT_BLOCK_SIZE;

	++argv; --argc;
	while (*argv != NULL && (*argv)[0] == '-') {
		/* Option */
		if (str_cmp(*argv, "-b") == 0) {
			if (argc < 2) {
				printf("Argument missing.\n");
				print_usage();
				return -1;
			}

			rc = str_size_t(argv[1], NULL, 10, true, &block_size);
			if (rc != EOK || block_size == 0) {
				printf("Invalid block size '%s'.\n", argv[1]);
				print_usage();
				return -1;
			}
			++argv; --argc;
		} else {
			printf("Invalid option '%s'.\n", *argv);
			print_usage();
			return -1;
		}
		++argv; --argc;
	}

	if (argc < 2) {
		printf("Missing arguments.\n");
		print_usage();
		return -1;
	}

	image_name = argv[0];
	device_name = argv[1];

	if (file_bd_init(image_name) != EOK)
		return -1;

	rc = loc_service_register(device_name, &service_id);
	if (rc != EOK) {
		printf("%s: Unable to register device '%s'.\n",
		    NAME, device_name);
		return rc;
	}

	rc = loc_category_get_id("disk", &disk_cat, IPC_FLAG_BLOCKING);
	if (rc != EOK) {
		printf("%s: Failed resolving category 'disk'.\n", NAME);
		return rc;
	}

	rc = loc_service_add_to_cat(service_id, disk_cat);
	if (rc != EOK) {
		printf("%s: Failed adding %s to category.",
		    NAME, device_name);
		return rc;
	}

	printf("%s: Accepting connections\n", NAME);
	task_retval(0);
	async_manager();
	
	/* Not reached */
	return 0;
}
Exemplo n.º 14
0
int main(int argc, char *argv[])
{
char buffer[30];
struct timeval tv;
struct tm result;
window_t *main_window = window_open(argv[1], true, true," ",0,720);
	if (!main_window) {
	printf("Cannot open main window.\n");
		return 1;
	}

	time_t curtime;
	gettimeofday(&tv, NULL); 
	curtime=tv.tv_sec;
	time_utc2tm(curtime,&result);
	strftime(buffer,30,"%T %m-%d-%Y",&result);

	pixel_t grd_bg = PIXEL(255, 25, 25, 112);
	
	pixel_t lbl_bg = PIXEL(255, 25, 25, 112);//(255, 240, 240, 240);
	pixel_t lbl_fg = PIXEL(255, 255, 255, 255);

	my_label_t *stime= create_my_label(NULL,buffer, 16, lbl_bg, lbl_fg);

	grid_t *grid = create_grid(window_root(main_window),1, 10, grd_bg);
	grid->add(grid, &stime->label.widget, 0, 7, 1, 2);
	window_resize(main_window,1024,60);
	window_exec(main_window);

	while(1){
		gettimeofday(&tv, NULL); 
		curtime=tv.tv_sec;
		time_utc2tm(curtime,&result);

//Converting month to integer		
		char month[5];
		strftime(month,5,"%m",&result);
		char *mon;
		mon=month;
		int value=0;
		value=toInteger1(mon);

		switch(value){
case 0:
			strftime(buffer,30,"%T Jan-%d, %Y",&result);		
			break;
case 1:
			strftime(buffer,30,"%T Feb-%d, %Y",&result);		
			break;
case 2:
			strftime(buffer,30,"%T Mar-%d, %Y",&result);		
			break;
case 3:
			strftime(buffer,30,"%T Apr-%d, %Y",&result);		
			break;
case 4:
			strftime(buffer,30,"%T May-%d, %Y",&result);		
			break;
case 5:
			strftime(buffer,30,"%T Jun-%d, %Y",&result);		
			break;
case 6:
			strftime(buffer,30,"%T Jul-%d, %Y",&result);		
			break;
case 7:
			strftime(buffer,30,"%T Aug-%d, %Y",&result);		
			break;
case 8:
			strftime(buffer,30,"%T Sep-%d, %Y",&result);		
			break;
case 9:
			strftime(buffer,30,"%T Oct-%d, %Y",&result);		
			break;
case 10:
			strftime(buffer,30,"%T Nov-%d, %Y",&result);		
			break;
case 11:
			strftime(buffer,30,"%T Dec-%d, %Y",&result);		
			break;
		}	
		stime->label.rewrite(&stime->label.widget, (void *)buffer);
	}

	task_retval(0);
	async_manager();

return 0;
}
Exemplo n.º 15
0
int main(int argc, char **argv)
{
	log_init(NAME);

	if (argc <= 3) {
		syntax_print();
		return 1;
	}

	const char *rfb_name = argv[1];
	
	char *endptr;
	unsigned long width = strtoul(argv[2], &endptr, 0);
	if (*endptr != 0) {
		fprintf(stderr, "Invalid width\n");
		syntax_print();
		return 1;
	}
	
	unsigned long height = strtoul(argv[3], &endptr, 0);
	if (*endptr != 0) {
		fprintf(stderr, "Invalid height\n");
		syntax_print();
		return 1;
	}
	
	unsigned long port = 5900;
	if (argc > 4) {
		port = strtoul(argv[4], &endptr, 0);
		if (*endptr != 0) {
			fprintf(stderr, "Invalid port number\n");
			syntax_print();
			return 1;
		}
	}
	
	rfb_init(&rfb, width, height, rfb_name);
	
	vis = malloc(sizeof(visualizer_t));
	if (vis == NULL) {
		fprintf(stderr, "Failed allocating visualizer struct\n");
		return 3;
	}
	
	graph_init_visualizer(vis);
	
	pixel_mode.mode.index = 0;
	pixel_mode.mode.version = 0;
	pixel_mode.mode.refresh_rate = 0;
	pixel_mode.mode.screen_aspect.width = rfb.width;
	pixel_mode.mode.screen_aspect.height = rfb.height;
	pixel_mode.mode.screen_width = rfb.width;
	pixel_mode.mode.screen_height = rfb.height;
	pixel_mode.mode.cell_aspect.width = 1;
	pixel_mode.mode.cell_aspect.height = 1;
	pixel_mode.mode.cell_visual.pixel_visual = VISUAL_RGB_8_8_8;
	
	link_initialize(&pixel_mode.link);
	list_append(&pixel_mode.link, &vis->modes);
	
	vis->def_mode_idx = 0;
	
	vis->ops = rfb_ops;
	vis->dev_ctx = NULL;

	async_set_fallback_port_handler(client_connection, NULL);

	int rc = loc_server_register(NAME);
	if (rc != EOK) {
		printf("%s: Unable to register server.\n", NAME);
		return rc;
	}

	char *service_name;
	rc = asprintf(&service_name, "rfb/%s", rfb_name);
	if (rc < 0) {
		printf(NAME ": Unable to create service name\n");
		return rc;
	}

	service_id_t service_id;
	
	rc = loc_service_register(service_name, &service_id);
	if (rc != EOK) {
		printf(NAME ": Unable to register service %s.\n", service_name);
		return rc;
	}
	
	free(service_name);

	category_id_t visualizer_category;
	rc = loc_category_get_id("visualizer", &visualizer_category, IPC_FLAG_BLOCKING);
	if (rc != EOK) {
		fprintf(stderr, NAME ": Unable to get visualizer category id.\n");
		return 1;
	}
	
	rc = loc_service_add_to_cat(service_id, visualizer_category);
	if (rc != EOK) {
		fprintf(stderr, NAME ": Unable to add service to visualizer category.\n");
		return 1;
	}
	
	rc = rfb_listen(&rfb, port);
	if (rc != EOK) {
		fprintf(stderr, NAME ": Unable to listen at rfb port\n");
		return 2;
	}
	
	printf("%s: Accepting connections\n", NAME);
	task_retval(0);
	async_manager();

	/* Not reached */
	return 0;
}
Exemplo n.º 16
0
int main(int argc, char **argv)
{
	sysarg_t baud = 38400;
	service_id_t svc_id;
	char *serial_port_name = NULL;

	int arg = 1;
	int rc;

	isdv4_event_fn event_fn = emit_event;

	if (argc > arg && str_test_prefix(argv[arg], "--baud=")) {
		size_t arg_offset = str_lsize(argv[arg], 7);
		char* arg_str = argv[arg] + arg_offset;
		if (str_length(arg_str) == 0) {
			fprintf(stderr, "--baud requires an argument\n");
			syntax_print();
			return 1;
		}
		char *endptr;
		baud = strtol(arg_str, &endptr, 10);
		if (*endptr != '\0') {
			fprintf(stderr, "Invalid value for baud\n");
			syntax_print();
			return 1;
		}
		arg++;
	}

	if (argc > arg && str_cmp(argv[arg], "--print-events") == 0) {
		event_fn = print_and_emit_event;
		arg++;
	}

	if (argc > arg) {
		serial_port_name = argv[arg];
		rc = loc_service_get_id(serial_port_name, &svc_id, 0);
		if (rc != EOK) {
			fprintf(stderr, "Cannot find device service %s\n",
			    argv[arg]);
			return 1;
		}
		arg++;
	}
	else {
		category_id_t serial_cat_id;

		rc = loc_category_get_id("serial", &serial_cat_id, 0);
		if (rc != EOK) {
			fprintf(stderr, "Failed getting id of category "
			    "'serial'\n");
			return 1;
		}

		service_id_t *svc_ids;
		size_t svc_count;

		rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);		if (rc != EOK) {
			fprintf(stderr, "Failed getting list of services\n");
			return 1;
		}

		if (svc_count == 0) {
			fprintf(stderr, "No service in category 'serial'\n");
			free(svc_ids);
			return 1;
		}

		svc_id = svc_ids[0];

		rc = loc_service_get_name(svc_id, &serial_port_name);
		if (rc != EOK) {
			fprintf(stderr, "Failed getting name of serial service\n");
			return 1;
		}

		free(svc_ids);
	}

	if (argc > arg) {
		fprintf(stderr, "Too many arguments\n");
		syntax_print();
		return 1;
	}

	fibril_mutex_initialize(&client_mutex);

	printf(NAME ": Using serial port %s\n", serial_port_name);

	async_sess_t *sess = loc_service_connect(svc_id, INTERFACE_DDF,
	    IPC_FLAG_BLOCKING);
	if (!sess) {
		fprintf(stderr, "Failed connecting to service\n");
	}

	async_exch_t *exch = async_exchange_begin(sess);
	rc = async_req_4_0(exch, SERIAL_SET_COM_PROPS, baud,
	    SERIAL_NO_PARITY, 8, 1);
	async_exchange_end(exch);

	if (rc != EOK) {
		fprintf(stderr, "Failed setting serial properties\n");
		return 2;
	}

	rc = isdv4_init(&state, sess, event_fn);
	if (rc != EOK) {
		fprintf(stderr, "Failed initializing isdv4 state");
		return 2;
	}

	rc = isdv4_init_tablet(&state);
	if (rc != EOK) {
		fprintf(stderr, "Failed initializing tablet");
		return 2;
	}

	printf("Tablet information:\n");
	printf(" Stylus: %ux%u pressure: %u tilt: ", state.stylus_max_x,
	    state.stylus_max_y, state.stylus_max_pressure);
	if (state.stylus_tilt_supported) {
		printf("%ux%u\n", state.stylus_max_xtilt, state.stylus_max_ytilt);
	}
	else {
		printf("not supported\n");
	}
	printf(" Touch: %ux%u type: %s\n", state.touch_max_x, state.touch_max_y,
		touch_type(state.touch_type));
	
	fid_t fibril = fibril_create(read_fibril, NULL);
	/* From this on, state is to be used only by read_fibril */
	fibril_add_ready(fibril);

	async_set_fallback_port_handler(mouse_connection, NULL);
	rc = loc_server_register(NAME);
	if (rc != EOK) {
		printf("%s: Unable to register driver.\n", NAME);
		return rc;
	}

	service_id_t service_id;
	char *service_name;
	rc = asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id);
	if (rc < 0) {
		printf(NAME ": Unable to create service name\n");
		return rc;
	}

	rc = loc_service_register(service_name, &service_id);
	if (rc != EOK) {
		printf(NAME ": Unable to register service %s.\n", service_name);
		return rc;
	}

	category_id_t mouse_category;
	rc = loc_category_get_id("mouse", &mouse_category, IPC_FLAG_BLOCKING);
	if (rc != EOK) {
		printf(NAME ": Unable to get mouse category id.\n");
	}
	else {
		rc = loc_service_add_to_cat(service_id, mouse_category);
		if (rc != EOK) {
			printf(NAME ": Unable to add device to mouse category.\n");
		}
	}

	printf("%s: Accepting connections\n", NAME);
	task_retval(0);
	async_manager();

	/* Not reached */
	return 0;
}