Index: uspace/srv/hid/output/Makefile
===================================================================
--- uspace/srv/hid/output/Makefile	(revision c4e30607d82ff59b363598359f0488a7d1200b22)
+++ uspace/srv/hid/output/Makefile	(revision e53794cd18f429f3843555710c0da7f171bc46af)
@@ -30,4 +30,6 @@
 USPACE_PREFIX = ../../..
 BINARY = output
+LIBS = $(LIBDRV_PREFIX)/libdrv.a
+EXTRA_CFLAGS = -I$(LIBDRV_PREFIX)/include
 
 SOURCES = \
@@ -37,4 +39,5 @@
 	port/niagara.c \
 	port/ski.c \
+	port/chardev.c \
 	proto/vt100.c \
 	output.c
Index: uspace/srv/hid/output/output.c
===================================================================
--- uspace/srv/hid/output/output.c	(revision c4e30607d82ff59b363598359f0488a7d1200b22)
+++ uspace/srv/hid/output/output.c	(revision e53794cd18f429f3843555710c0da7f171bc46af)
@@ -38,4 +38,5 @@
 #include "port/niagara.h"
 #include "port/ski.h"
+#include "port/chardev.h"
 #include "output.h"
 
@@ -479,4 +480,5 @@
 	niagara_init();
 	ski_init();
+	chardev_init();
 	
 	printf("%s: Accepting connections\n", NAME);
Index: uspace/srv/hid/output/port/chardev.c
===================================================================
--- uspace/srv/hid/output/port/chardev.c	(revision e53794cd18f429f3843555710c0da7f171bc46af)
+++ uspace/srv/hid/output/port/chardev.c	(revision e53794cd18f429f3843555710c0da7f171bc46af)
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2016 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @file
+ */
+
+#include <sys/types.h>
+#include <char_dev_iface.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <async.h>
+#include <fibril_synch.h>
+#include <loc.h>
+#include <errno.h>
+#include <str.h>
+#include "../ctl/serial.h"
+#include "../output.h"
+#include "chardev.h"
+
+static async_sess_t *sess;
+static service_id_t serial_cat_id;
+
+static FIBRIL_MUTEX_INITIALIZE(discovery_lock);
+static bool discovery_finished;
+static FIBRIL_CONDVAR_INITIALIZE(discovery_cv);
+
+static void chardev_putchar(wchar_t ch)
+{
+	uint8_t byte = (uint8_t) ch;
+	char_dev_write(sess, &byte, 1); 
+}
+
+static void chardev_control_puts(const char *str)
+{
+	char_dev_write(sess, (void *) str, str_size(str));
+}
+
+static void check_for_dev(void)
+{
+	int rc;
+
+	if (sess)
+		return;
+
+	service_id_t *svc;
+	size_t svcs;
+	rc = loc_category_get_svcs(serial_cat_id, &svc, &svcs);
+	if (rc != EOK) {
+		printf("%s: Failed to get services\n", NAME);
+		return;
+	}
+
+	if (svcs < 1) {
+		free(svc);
+		return;
+	}
+
+	service_id_t sid = svc[0];
+	free(svc);
+
+	sess = loc_service_connect(sid, INTERFACE_DDF, IPC_FLAG_BLOCKING);
+	if (!sess) {
+		printf("%s: Failed connecting to device\n", NAME);
+		return;
+	}
+	serial_init(chardev_putchar, chardev_control_puts);
+
+	fibril_mutex_lock(&discovery_lock);
+	discovery_finished = true;
+	fibril_condvar_signal(&discovery_cv);
+	fibril_mutex_unlock(&discovery_lock);
+}
+
+int chardev_init(void)
+{
+	int rc;
+
+	rc = loc_category_get_id("serial", &serial_cat_id, IPC_FLAG_BLOCKING);
+	if (rc != EOK) {
+		printf("%s: Failed to get \"serial\" category ID.\n", NAME);
+		return rc;
+	} 
+
+	rc = loc_register_cat_change_cb(check_for_dev);
+	if (rc != EOK) {
+		printf("%s: Failed to register callback for device discovery.\n",
+		    NAME);
+		return rc;
+	}
+
+	fibril_mutex_lock(&discovery_lock);
+	while (!discovery_finished)
+		fibril_condvar_wait(&discovery_cv, &discovery_lock);
+	fibril_mutex_unlock(&discovery_lock);
+
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/srv/hid/output/port/chardev.h
===================================================================
--- uspace/srv/hid/output/port/chardev.h	(revision e53794cd18f429f3843555710c0da7f171bc46af)
+++ uspace/srv/hid/output/port/chardev.h	(revision e53794cd18f429f3843555710c0da7f171bc46af)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @file
+ */
+
+#ifndef OUTPUT_PORT_CHARDEV_H_
+#define OUTPUT_PORT_CHARDEV_H_
+
+extern int chardev_init(void);
+
+#endif
+
+/** @}
+ */
