Index: uspace/srv/fb/ega.c
===================================================================
--- uspace/srv/fb/ega.c	(revision fc0110df7ea7e14571f47118909114c5dbbbd866)
+++ uspace/srv/fb/ega.c	(revision 215abc165fc8eda817e4c859ba67ddcadb7c1e64)
@@ -50,6 +50,6 @@
 #include <ipc/services.h>
 #include <libarch/ddi.h>
-#include <console/style.h>
-#include <console/color.h>
+#include <io/style.h>
+#include <io/color.h>
 #include <sys/types.h>
 
@@ -71,5 +71,5 @@
 int ega_inverted_color = 0xf0;
 
-#define NORMAL_COLOR		ega_normal_color       
+#define NORMAL_COLOR		ega_normal_color
 #define INVERTED_COLOR		ega_inverted_color
 
@@ -96,5 +96,5 @@
 }
 
-static void cursor_goto(unsigned int row, unsigned int col)
+static void cursor_goto(unsigned int col, unsigned int row)
 {
 	int ega_cursor;
@@ -145,5 +145,5 @@
 }
 
-static void printchar(wchar_t c, unsigned int row, unsigned int col)
+static void printchar(wchar_t c, unsigned int col, unsigned int row)
 {
 	scr_addr[(row * scr_width + col) * 2] = ega_glyph(c);
@@ -242,9 +242,13 @@
 {
 	switch (a->t) {
-	case at_style: return style_to_ega_style(a->a.s.style);
-	case at_rgb: return rgb_to_ega_style(a->a.r.fg_color, a->a.r.bg_color);
-	case at_idx: return color_to_ega_style(a->a.i.fg_color,
-	    a->a.i.bg_color, a->a.i.flags);
-	default: return INVERTED_COLOR;
+	case at_style:
+		return style_to_ega_style(a->a.s.style);
+	case at_rgb:
+		return rgb_to_ega_style(a->a.r.fg_color, a->a.r.bg_color);
+	case at_idx:
+		return color_to_ega_style(a->a.i.fg_color,
+		    a->a.i.bg_color, a->a.i.flags);
+	default:
+		return INVERTED_COLOR;
 	}
 }
@@ -321,21 +325,21 @@
 		case FB_PUTCHAR:
 			c = IPC_GET_ARG1(call);
+			col = IPC_GET_ARG2(call);
+			row = IPC_GET_ARG3(call);
+			if (col >= scr_width || row >= scr_height) {
+				retval = EINVAL;
+				break;
+			}
+			printchar(c, col, row);
+			retval = 0;
+			break;
+ 		case FB_CURSOR_GOTO:
+ 			col = IPC_GET_ARG1(call);
 			row = IPC_GET_ARG2(call);
-			col = IPC_GET_ARG3(call);
-			if (col >= scr_width || row >= scr_height) {
-				retval = EINVAL;
-				break;
-			}
-			printchar(c, row, col);
-			retval = 0;
-			break;
- 		case FB_CURSOR_GOTO:
-			row = IPC_GET_ARG1(call);
-			col = IPC_GET_ARG2(call);
 			if (row >= scr_height || col >= scr_width) {
 				retval = EINVAL;
 				break;
 			}
-			cursor_goto(row, col);
+			cursor_goto(col, row);
  			retval = 0;
  			break;
Index: uspace/srv/fb/ega.h
===================================================================
--- uspace/srv/fb/ega.h	(revision fc0110df7ea7e14571f47118909114c5dbbbd866)
+++ uspace/srv/fb/ega.h	(revision 215abc165fc8eda817e4c859ba67ddcadb7c1e64)
@@ -28,8 +28,8 @@
 
 /** @addtogroup egafb
- * @brief	HelenOS EGA framebuffer.
+ * @brief HelenOS EGA framebuffer.
  * @ingroup fbs
  * @{
- */ 
+ */
 /** @file
  */
@@ -44,3 +44,2 @@
 /** @}
  */
-
Index: uspace/srv/fb/fb.c
===================================================================
--- uspace/srv/fb/fb.c	(revision fc0110df7ea7e14571f47118909114c5dbbbd866)
+++ uspace/srv/fb/fb.c	(revision 215abc165fc8eda817e4c859ba67ddcadb7c1e64)
@@ -52,6 +52,6 @@
 #include <kernel/errno.h>
 #include <kernel/genarch/fb/visuals.h>
-#include <console/color.h>
-#include <console/style.h>
+#include <io/color.h>
+#include <io/style.h>
 #include <async.h>
 #include <bool.h>
@@ -376,6 +376,6 @@
 static void vport_redraw(viewport_t *vport)
 {
+	unsigned int col;
 	unsigned int row;
-	unsigned int col;
 	
 	for (row = 0; row < vport->rows; row++) {
@@ -432,6 +432,6 @@
 static void vport_scroll(viewport_t *vport, int lines)
 {
+	unsigned int col;
 	unsigned int row;
-	unsigned int col;
 	unsigned int x;
 	unsigned int y;
@@ -1565,5 +1565,5 @@
 		int scroll;
 		wchar_t ch;
-		unsigned int row, col;
+		unsigned int col, row;
 		
 		if ((vport->cursor_active) || (anims_enabled))
@@ -1602,6 +1602,6 @@
 		case FB_PUTCHAR:
 			ch = 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 ((col >= vport->cols) || (row >= vport->rows)) {
@@ -1621,6 +1621,6 @@
 			break;
 		case FB_CURSOR_GOTO:
-			row = IPC_GET_ARG1(call);
-			col = IPC_GET_ARG2(call);
+			col = IPC_GET_ARG1(call);
+			row = IPC_GET_ARG2(call);
 			
 			if ((col >= vport->cols) || (row >= vport->rows)) {
@@ -1642,5 +1642,5 @@
 			break;
 		case FB_GET_CSIZE:
-			ipc_answer_2(callid, EOK, vport->rows, vport->cols);
+			ipc_answer_2(callid, EOK, vport->cols, vport->rows);
 			continue;
 		case FB_SCROLL:
Index: uspace/srv/fb/serial_console.c
===================================================================
--- uspace/srv/fb/serial_console.c	(revision fc0110df7ea7e14571f47118909114c5dbbbd866)
+++ uspace/srv/fb/serial_console.c	(revision 215abc165fc8eda817e4c859ba67ddcadb7c1e64)
@@ -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 @@
 }
 
-/** 
+/**
  * @}
  */
Index: uspace/srv/fb/serial_console.h
===================================================================
--- uspace/srv/fb/serial_console.h	(revision fc0110df7ea7e14571f47118909114c5dbbbd866)
+++ uspace/srv/fb/serial_console.h	(revision 215abc165fc8eda817e4c859ba67ddcadb7c1e64)
@@ -44,5 +44,5 @@
 
 void serial_puts(char *str);
-void serial_goto(const unsigned int row, const unsigned int col);
+void serial_goto(const unsigned int col, const unsigned int row);
 void serial_clrscr(void);
 void serial_scroll(int i);
