Index: uspace/srv/fb/serial_console.c
===================================================================
--- uspace/srv/fb/serial_console.c	(revision ebfabf6380f038fae3fc5fe621e478743080cd48)
+++ uspace/srv/fb/serial_console.c	(revision c20aa06a0854db4490824e2f9fe5e13719bf325e)
@@ -44,6 +44,7 @@
 #include <bool.h>
 #include <errno.h>
-#include <console/color.h>
-#include <console/style.h>
+#include <io/color.h>
+#include <io/style.h>
+#include <string.h>
 
 #include "../console/screenbuffer.h"
@@ -129,7 +130,7 @@
 }
 
-void serial_goto(const unsigned int row, const unsigned int col)
-{
-	if ((row > scr_height) || (col > scr_width))
+void serial_goto(const unsigned int col, const unsigned int row)
+{
+	if ((col > scr_width) || (row > scr_height))
 		return;
 	
@@ -154,5 +155,5 @@
 {
 	if (i > 0) {
-		serial_goto(scr_height - 1, 0);
+		serial_goto(0, scr_height - 1);
 		while (i--)
 			serial_puts("\033D");
@@ -236,5 +237,5 @@
 		serial_sgr(SGR_REVERSE_OFF);
 	else
-		serial_sgr(SGR_REVERSE);	
+		serial_sgr(SGR_REVERSE);
 }
 
@@ -242,9 +243,16 @@
 {
 	switch (a->t) {
-	case at_style: serial_set_style(a->a.s.style); break;
-	case at_rgb: serial_set_rgb(a->a.r.fg_color, a->a.r.bg_color); break;
-	case at_idx: serial_set_idx(a->a.i.fg_color,
-	    a->a.i.bg_color, a->a.i.flags); break;
-	default: break;
+	case at_style:
+		serial_set_style(a->a.s.style);
+		break;
+	case at_rgb:
+		serial_set_rgb(a->a.r.fg_color, a->a.r.bg_color);
+		break;
+	case at_idx:
+		serial_set_idx(a->a.i.fg_color,
+		    a->a.i.bg_color, a->a.i.flags);
+		break;
+	default:
+		break;
 	}
 }
@@ -266,5 +274,5 @@
 	attrs_t *a0, *a1;
 
-	serial_goto(y, x);
+	serial_goto(x, y);
 	a0 = &data[0].attrs;
 	serial_set_attrs(a0);
@@ -272,5 +280,5 @@
 	for (j = 0; j < h; j++) {
 		if (j > 0 && w != scr_width)
-			serial_goto(y, x);
+			serial_goto(x, j);
 
 		for (i = 0; i < w; i++) {
@@ -355,14 +363,14 @@
 			}
 			draw_text_data(interbuf, col, row, w, h);
+			lastcol = col + w;
 			lastrow = row + h - 1;
-			lastcol = col + w;
 			retval = 0;
 			break;
 		case FB_PUTCHAR:
 			c = IPC_GET_ARG1(call);
-			row = IPC_GET_ARG2(call);
-			col = IPC_GET_ARG3(call);
+			col = IPC_GET_ARG2(call);
+			row = IPC_GET_ARG3(call);
 			if ((lastcol != col) || (lastrow != row))
-				serial_goto(row, col);
+				serial_goto(col, row);
 			lastcol = col + 1;
 			lastrow = row;
@@ -371,13 +379,13 @@
 			break;
 		case FB_CURSOR_GOTO:
-			row = IPC_GET_ARG1(call);
-			col = IPC_GET_ARG2(call);
-			serial_goto(row, col);
+			col = IPC_GET_ARG1(call);
+			row = IPC_GET_ARG2(call);
+			serial_goto(col, row);
+			lastcol = col;
 			lastrow = row;
-			lastcol = col;
 			retval = 0;
 			break;
 		case FB_GET_CSIZE:
-			ipc_answer_2(callid, EOK, scr_height, scr_width);
+			ipc_answer_2(callid, EOK, scr_width, scr_height);
 			continue;
 		case FB_CLEAR:
@@ -417,5 +425,5 @@
 			}
 			serial_scroll(i);
-			serial_goto(lastrow, lastcol);
+			serial_goto(lastcol, lastrow);
 			retval = 0;
 			break;
@@ -446,5 +454,5 @@
 }
 
-/** 
+/**
  * @}
  */
