Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ HelenOS.config	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -387,5 +387,5 @@
 % Output device class
 @ "generic" Monitor or serial line
-! [PLATFORM=arm32&MACHINE=integratorcp] CONFIG_HID_OUT (choice)
+! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp)] CONFIG_HID_OUT (choice)
 
 % Output device class
@@ -434,4 +434,7 @@
 % Support for NS16550 controller
 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=serial)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_NS16550 (y/n)
+
+% Support for Samsung S3C24XX on-chip UART
+! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_UART (y/n)
 
 % Support for Z8530 controller
Index: boot/arch/arm32/include/main.h
===================================================================
--- boot/arch/arm32/include/main.h	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ boot/arch/arm32/include/main.h	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -42,5 +42,5 @@
 /** GTA02 serial console UART register addresses.
  *
- * This is UART channel 2 of the S3C244x CPU
+ * This is UART channel 2 of the S3C24xx CPU
  */
 #define GTA02_SCONS_UTRSTAT	0x50008010
@@ -48,5 +48,5 @@
 
 /* Bits in UTXH register */
-#define S3C244X_UTXH_TX_EMPTY	0x00000004
+#define S3C24XX_UTXH_TX_EMPTY	0x00000004
 
 
Index: boot/arch/arm32/src/putchar.c
===================================================================
--- boot/arch/arm32/src/putchar.c	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ boot/arch/arm32/src/putchar.c	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -56,5 +56,5 @@
 
 	/* Wait until transmitter is empty. */
-	while ((*utrstat & S3C244X_UTXH_TX_EMPTY) == 0)
+	while ((*utrstat & S3C24XX_UTXH_TX_EMPTY) == 0)
 		;
 
Index: defaults/arm32/gta02/Makefile.config
===================================================================
--- defaults/arm32/gta02/Makefile.config	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ defaults/arm32/gta02/Makefile.config	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -8,10 +8,4 @@
 CONFIG_UDEBUG = n
 
-# Kernel console support
-CONFIG_KCONSOLE = n
-
-# Kernel symbol information
-CONFIG_SYMTAB = n
-
 # Compile kernel tests
 CONFIG_TEST = n
Index: kernel/arch/arm32/src/mach/gta02/gta02.c
===================================================================
--- kernel/arch/arm32/src/mach/gta02/gta02.c	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ kernel/arch/arm32/src/mach/gta02/gta02.c	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -37,8 +37,13 @@
 #include <arch/mach/gta02/gta02.h>
 #include <arch/mm/page.h>
+#include <mm/page.h>
+#include <genarch/drivers/s3c24xx_uart/s3c24xx_uart.h>
 
 #define GTA02_MEMORY_START	0x30000000	/* physical */
 #define GTA02_MEMORY_SIZE	0x08000000	/* 128 MB */
-#define GTA02_MEMORY_SKIP	0x8000		/* 2 pages */
+#define GTA02_MEMORY_SKIP	0x8000
+
+/** GTA02 serial console UART address (UART S3C24XX CPU UART channel 2). */
+#define GTA02_SCONS_BASE	0x50008000
 
 static void gta02_init(void);
@@ -50,4 +55,6 @@
 static void gta02_output_init(void);
 static void gta02_input_init(void);
+
+static void *gta02_scons_out;
 
 struct arm_machine_ops gta02_machine_ops = {
@@ -64,4 +71,5 @@
 static void gta02_init(void)
 {
+	gta02_scons_out = (void *) hw_map(GTA02_SCONS_BASE, PAGE_SIZE);
 }
 
@@ -95,4 +103,9 @@
 static void gta02_output_init(void)
 {
+	outdev_t *scons_dev;
+
+	scons_dev = s3c24xx_uart_init((ioport8_t *) gta02_scons_out);
+	if (scons_dev)
+		stdout_wire(scons_dev);
 }
 
Index: kernel/arch/arm32/src/mm/page.c
===================================================================
--- kernel/arch/arm32/src/mm/page.c	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ kernel/arch/arm32/src/mm/page.c	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -68,4 +68,6 @@
 #error "Only high exception vector supported now"
 #endif
+	cur = ALIGN_DOWN(0x50008010, FRAME_SIZE);
+	page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
 
 	page_table_unlock(AS_KERNEL, true);
Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision 6250c37234323890b9e9a2f06fea02651a75d6c2)
+++ kernel/genarch/Makefile.inc	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -90,4 +90,9 @@
 endif
 
+ifeq ($(CONFIG_S3C24XX_UART),y)
+	GENARCH_SOURCES += \
+		genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c
+endif
+
 ifeq ($(CONFIG_Z8530),y)
 	GENARCH_SOURCES += \
Index: kernel/genarch/include/drivers/s3c24xx_uart/s3c24xx_uart.h
===================================================================
--- kernel/genarch/include/drivers/s3c24xx_uart/s3c24xx_uart.h	(revision f1fc83a94680102dc08796c15aa408745db97104)
+++ kernel/genarch/include/drivers/s3c24xx_uart/s3c24xx_uart.h	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010 Jiri Svoboda
+ * 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 genarch
+ * @{
+ */
+/**
+ * @file
+ * @brief Samsung S3C24xx on-chip UART driver.
+ */
+
+#ifndef KERN_S3C24XX_UART_H_
+#define KERN_S3C24XX_UART_H_
+
+#include <typedefs.h>
+#include <console/chardev.h>
+
+extern outdev_t *s3c24xx_uart_init(ioport8_t *);
+
+#endif
+
+/** @}
+ */
Index: kernel/genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c
===================================================================
--- kernel/genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c	(revision f1fc83a94680102dc08796c15aa408745db97104)
+++ kernel/genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c	(revision f1fc83a94680102dc08796c15aa408745db97104)
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2009 Martin Decky
+ * Copyright (c) 2010 Jiri Svoboda
+ * 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 genarch
+ * @{
+ */
+/**
+ * @file
+ * @brief Samsung S3C24xx on-chip UART driver.
+ *
+ * This UART is present on the Samsung S3C24xx CPU (on the gta02 platform).
+ */
+
+#include <genarch/drivers/s3c24xx_uart/s3c24xx_uart.h>
+#include <console/chardev.h>
+#include <arch/asm.h>
+#include <mm/slab.h>
+#include <console/console.h>
+#include <sysinfo/sysinfo.h>
+#include <str.h>
+
+/** S3C24xx UART register offsets */
+#define S3C24XX_UTRSTAT		0x10
+#define S3C24XX_UTXH		0x20
+
+/* Bits in UTXH register */
+#define S3C24XX_UTXH_TX_EMPTY	0x4
+
+typedef struct {
+	ioport8_t *base;
+} s3c24xx_uart_instance_t;
+
+static void s3c24xx_uart_sendb(outdev_t *dev, uint8_t byte)
+{
+	s3c24xx_uart_instance_t *instance =
+	    (s3c24xx_uart_instance_t *) dev->data;
+	ioport32_t *utrstat, *utxh;
+
+	utrstat = (ioport32_t *) (instance->base + S3C24XX_UTRSTAT);
+	utxh = (ioport32_t *) (instance->base + S3C24XX_UTXH);
+
+	/* Wait for transmitter to be empty. */
+	while ((pio_read_32(utrstat) & S3C24XX_UTXH_TX_EMPTY) == 0)
+		;
+
+	pio_write_32(utxh, byte);
+}
+
+static void s3c24xx_uart_putchar(outdev_t *dev, wchar_t ch, bool silent)
+{
+	if (!silent) {
+		if (!ascii_check(ch)) {
+			s3c24xx_uart_sendb(dev, U_SPECIAL);
+		} else {
+    			if (ch == '\n')
+				s3c24xx_uart_sendb(dev, (uint8_t) '\r');
+			s3c24xx_uart_sendb(dev, (uint8_t) ch);
+		}
+	}
+}
+
+static outdev_operations_t s3c24xx_uart_ops = {
+	.write = s3c24xx_uart_putchar,
+	.redraw = NULL
+};
+
+outdev_t *s3c24xx_uart_init(ioport8_t *base)
+{
+	outdev_t *uart_dev = malloc(sizeof(outdev_t), FRAME_ATOMIC);
+	if (!uart_dev)
+		return NULL;
+
+	s3c24xx_uart_instance_t *instance =
+	    malloc(sizeof(s3c24xx_uart_instance_t), FRAME_ATOMIC);
+	if (!instance) {
+		free(uart_dev);
+		return NULL;
+	}
+
+	outdev_initialize("s3c24xx_uart_dev", uart_dev, &s3c24xx_uart_ops);
+	uart_dev->data = instance;
+
+	instance->base = base;
+
+	if (!fb_exported) {
+		/*
+		 * This is the necessary evil until the userspace driver is entirely
+		 * self-sufficient.
+		 */
+		sysinfo_set_item_val("fb", NULL, true);
+		sysinfo_set_item_val("fb.kind", NULL, 3);
+		sysinfo_set_item_val("fb.address.physical", NULL, KA2PA(base));
+
+		fb_exported = true;
+	}
+
+	return uart_dev;
+}
+
+/** @}
+ */
