Index: uspace/app/tester/Makefile
===================================================================
--- uspace/app/tester/Makefile	(revision c4c60250a236ed30397cd89ce5cea5eaf59cfba5)
+++ uspace/app/tester/Makefile	(revision e7588a831a1d2d5847475a67a5b1bc4b10366d7c)
@@ -68,5 +68,4 @@
 	mm/mapping1.c \
 	mm/pager1.c \
-	hw/misc/virtchar1.c \
 	hw/serial/serial1.c \
 	chardev/chardev1.c
Index: uspace/app/tester/hw/misc/virtchar1.c
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.c	(revision c4c60250a236ed30397cd89ce5cea5eaf59cfba5)
+++ 	(revision )
@@ -1,106 +1,0 @@
-/*
- * Copyright (c) 2010 Vojtech Horky
- * 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.
- */
-
-/** @addtogroup tester
- * @brief Test the virtual char driver
- * @{
- */
-/**
- * @file
- */
-
-#include <inttypes.h>
-#include <errno.h>
-#include <str_error.h>
-#include <stddef.h>
-#include <async.h>
-#include <char_dev_iface.h>
-#include <str.h>
-#include <vfs/vfs.h>
-#include <vfs/vfs_sess.h>
-#include "../../tester.h"
-
-#define DEVICE_PATH_NORMAL  "/loc/devices/\\virt\\null\\a"
-
-#define BUFFER_SIZE  64
-
-static const char *test_virtchar1_internal(const char *path)
-{
-	TPRINTF("Opening `%s'...\n", path);
-	int fd = vfs_lookup(path, WALK_REGULAR);
-	if (fd < 0) {
-		TPRINTF("   ...error: %s\n", str_error(errno));
-		if (fd == ENOENT) {
-			TPRINTF("   (error was ENOENT: " \
-			    "have you compiled test drivers?)\n");
-		}
-		return "Failed opening NULL device for reading";
-	}
-	
-	TPRINTF("   ...file handle %d\n", fd);
-	
-	TPRINTF(" Asking for session...\n");
-	async_sess_t *sess = vfs_fd_session(fd, INTERFACE_DDF);
-	if (!sess) {
-		vfs_put(fd);
-		TPRINTF("   ...error: %s\n", str_error(errno));
-		return "Failed to get session to device";
-	}
-	TPRINTF("   ...session is %p\n", sess);
-	
-	TPRINTF(" Will try to read...\n");
-	size_t i;
-	char buffer[BUFFER_SIZE];
-	char_dev_read(sess, buffer, BUFFER_SIZE);
-	TPRINTF(" ...verifying that we read zeroes only...\n");
-	for (i = 0; i < BUFFER_SIZE; i++) {
-		if (buffer[i] != 0) {
-			return "Not all bytes are zeroes";
-		}
-	}
-	TPRINTF("   ...data read okay\n");
-	
-	/* Clean-up. */
-	TPRINTF(" Closing session and file descriptor\n");
-	async_hangup(sess);
-	vfs_put(fd);
-	
-	return NULL;
-}
-
-const char *test_virtchar1(void)
-{
-	const char *res = test_virtchar1_internal(DEVICE_PATH_NORMAL);
-	if (res != NULL)
-		return res;
-	
-	return NULL;
-}
-
-/** @}
- */
Index: uspace/app/tester/hw/misc/virtchar1.def
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.def	(revision c4c60250a236ed30397cd89ce5cea5eaf59cfba5)
+++ 	(revision )
@@ -1,6 +1,0 @@
-{
-	"virtchar1",
-	"Virtual char device test",
-	&test_virtchar1,
-	false
-},
Index: uspace/app/tester/hw/serial/serial1.c
===================================================================
--- uspace/app/tester/hw/serial/serial1.c	(revision c4c60250a236ed30397cd89ce5cea5eaf59cfba5)
+++ uspace/app/tester/hw/serial/serial1.c	(revision e7588a831a1d2d5847475a67a5b1bc4b10366d7c)
@@ -35,16 +35,15 @@
  */
 
-#include <inttypes.h>
+#include <async.h>
 #include <errno.h>
+#include <io/chardev.h>
+#include <io/serial.h>
+#include <ipc/services.h>
+#include <loc.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stddef.h>
-#include <async.h>
+#include <str.h>
 #include <thread.h>
-#include <ipc/services.h>
-#include <loc.h>
-#include <char_dev_iface.h>
-#include <str.h>
-#include <io/serial.h>
 #include "../../tester.h"
 
@@ -57,4 +56,8 @@
 	size_t cnt;
 	serial_t *serial;
+	chardev_t *chardev;
+	int rc;
+	size_t nread;
+	size_t nwritten;
 	
 	if (test_argc < 1)
@@ -83,10 +86,20 @@
 		return "Failed connecting to serial device";
 	
+	res = chardev_open(sess, &chardev);
+	if (res != EOK) {
+		async_hangup(sess);
+		return "Failed opening serial port";
+	}
+	
 	res = serial_open(sess, &serial);
-	if (res != EOK)
+	if (res != EOK) {
+		chardev_close(chardev);
+		async_hangup(sess);
 		return "Failed opening serial port";
+	}
 	
 	char *buf = (char *) malloc(cnt + 1);
 	if (buf == NULL) {
+		chardev_close(chardev);
 		serial_close(serial);
 		async_hangup(sess);
@@ -103,4 +116,5 @@
 	if (res != EOK) {
 		free(buf);
+		chardev_close(chardev);
 		serial_close(serial);
 		async_hangup(sess);
@@ -111,4 +125,5 @@
 	if (EOK != res) {
 		free(buf);
+		chardev_close(chardev);
 		serial_close(serial);
 		async_hangup(sess);
@@ -121,11 +136,12 @@
 	size_t total = 0;
 	while (total < cnt) {
-		ssize_t read = char_dev_read(sess, buf, cnt - total);
-		
-		if (read < 0) {
+		
+		rc = chardev_read(chardev, buf, cnt - total, &nread);
+		if (rc != EOK) {
 			(void) serial_set_comm_props(serial, old_baud,
 			    old_par, old_word_size, old_stop);
 			
 			free(buf);
+			chardev_close(chardev);
 			serial_close(serial);
 			async_hangup(sess);
@@ -133,9 +149,10 @@
 		}
 		
-		if ((size_t) read > cnt - total) {
+		if (nread > cnt - total) {
 			(void) serial_set_comm_props(serial, old_baud,
 			    old_par, old_word_size, old_stop);
 			
 			free(buf);
+			chardev_close(chardev);
 			serial_close(serial);
 			async_hangup(sess);
@@ -143,10 +160,10 @@
 		}
 		
-		TPRINTF("Read %zd bytes\n", read);
-		
-		if (read == 0)
+		TPRINTF("Read %zd bytes\n", nread);
+		
+		if (nread == 0)
 			thread_usleep(DEFAULT_SLEEP);
 		else {
-			buf[read] = 0;
+			buf[nread] = 0;
 			
 			/*
@@ -154,11 +171,11 @@
 			 * direction of data transfer.
 			 */
-			ssize_t written = char_dev_write(sess, buf, read);
-			
-			if (written < 0) {
+			rc = chardev_write(chardev, buf, nread, &nwritten);
+			if (rc != EOK) {
 				(void) serial_set_comm_props(serial, old_baud,
 				    old_par, old_word_size, old_stop);
 				
 				free(buf);
+				chardev_close(chardev);
 				serial_close(serial);
 				async_hangup(sess);
@@ -166,9 +183,10 @@
 			}
 			
-			if (written != read) {
+			if (nwritten != nread) {
 				(void) serial_set_comm_props(serial, old_baud,
 				    old_par, old_word_size, old_stop);
 				
 				free(buf);
+				chardev_close(chardev);
 				serial_close(serial);
 				async_hangup(sess);
@@ -176,8 +194,8 @@
 			}
 			
-			TPRINTF("Written %zd bytes\n", written);
-		}
-		
-		total += read;
+			TPRINTF("Written %zd bytes\n", nwritten);
+		}
+		
+		total += nread;
 	}
 	
@@ -185,5 +203,5 @@
 	
 	size_t eot_size = str_size(EOT);
-	ssize_t written = char_dev_write(sess, (void *) EOT, eot_size);
+	rc = chardev_write(chardev, (void *) EOT, eot_size, &nwritten);
 	
 	(void) serial_set_comm_props(serial, old_baud, old_par, old_word_size,
@@ -191,11 +209,12 @@
 	
 	free(buf);
+	chardev_close(chardev);
 	serial_close(serial);
 	async_hangup(sess);
 	
-	if (written < 0)
+	if (rc != EOK)
 		return "Failed to write EOT banner to serial device";
 	
-	if ((size_t) written != eot_size)
+	if (nwritten != eot_size)
 		return "Written less data than the size of the EOT banner "
 		    "to serial device";
Index: uspace/app/tester/tester.c
===================================================================
--- uspace/app/tester/tester.c	(revision c4c60250a236ed30397cd89ce5cea5eaf59cfba5)
+++ uspace/app/tester/tester.c	(revision e7588a831a1d2d5847475a67a5b1bc4b10366d7c)
@@ -76,5 +76,4 @@
 #include "mm/pager1.def"
 #include "hw/serial/serial1.def"
-#include "hw/misc/virtchar1.def"
 #include "chardev/chardev1.def"
 	{NULL, NULL, NULL, false}
Index: uspace/app/tester/tester.h
===================================================================
--- uspace/app/tester/tester.h	(revision c4c60250a236ed30397cd89ce5cea5eaf59cfba5)
+++ uspace/app/tester/tester.h	(revision e7588a831a1d2d5847475a67a5b1bc4b10366d7c)
@@ -108,5 +108,4 @@
 extern const char *test_pager1(void);
 extern const char *test_serial1(void);
-extern const char *test_virtchar1(void);
 extern const char *test_devman1(void);
 extern const char *test_devman2(void);
