Index: kernel/arch/ppc32/src/ppc32.c
===================================================================
--- kernel/arch/ppc32/src/ppc32.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/ppc32/src/ppc32.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -71,5 +71,5 @@
 {
 	if (config.cpu_active == 1) {
-		fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline);	
+		fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline);
 	
 		/* Initialize PIC */
Index: kernel/arch/sparc64/Makefile.inc
===================================================================
--- kernel/arch/sparc64/Makefile.inc	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/Makefile.inc	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -47,6 +47,4 @@
 #
 
-CONFIG_OFW = y
-
 ## Compile with page hash table support.
 #
Index: kernel/arch/sparc64/_link.ld.in
===================================================================
--- kernel/arch/sparc64/_link.ld.in	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/_link.ld.in	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -7,5 +7,5 @@
  */
 
-#define __ASM__
+#define __LINKER__
 #include <arch/boot/boot.h>
 
Index: kernel/arch/sparc64/include/boot/boot.h
===================================================================
--- kernel/arch/sparc64/include/boot/boot.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/include/boot/boot.h	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -33,9 +33,63 @@
  */
 
-#ifndef __sparc64_BOOT_H__
-#define __sparc64_BOOT_H__
+#ifndef KERN_sparc64_BOOT_H_
+#define KERN_sparc64_BOOT_H_
+
 
 #define VMA			0x400000
 #define LMA			VMA
+
+#ifndef __LINKER__
+
+#include <arch/types.h>
+#include <typedefs.h>
+
+#define TASKMAP_MAX_RECORDS	32
+#define MEMMAP_MAX_RECORDS	32
+
+typedef struct {
+	void * addr;
+	uint32_t size;
+} utask_t;
+
+typedef struct {
+	uint32_t count;
+	utask_t tasks[TASKMAP_MAX_RECORDS];
+} taskmap_t;
+
+typedef struct {
+	uintptr_t start;
+	uint32_t size;
+} memzone_t;
+
+typedef struct {
+	uint32_t total;
+	uint32_t count;
+	memzone_t zones[MEMMAP_MAX_RECORDS];
+} memmap_t;
+
+typedef struct {
+	uintptr_t addr;
+	uint32_t width;
+	uint32_t height;
+	uint32_t bpp;
+	uint32_t scanline;
+} screen_t;
+
+typedef struct {
+	uintptr_t addr;
+	uint32_t size;
+} keyboard_t;
+
+typedef struct {
+	taskmap_t taskmap;
+	memmap_t memmap;
+	screen_t screen;
+	keyboard_t keyboard;
+} bootinfo_t;
+
+extern bootinfo_t bootinfo;
+
+#endif
 
 #endif
Index: kernel/arch/sparc64/include/drivers/fb.h
===================================================================
--- kernel/arch/sparc64/include/drivers/fb.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/include/drivers/fb.h	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -36,11 +36,4 @@
 #define KERN_sparc64_FB_H_
 
-#define FB_PHYS_ADDRESS		0x1c901000000ULL
-
-#define FB_X_RES		1152
-#define FB_Y_RES		900
-
-#define FB_COLOR_DEPTH		8
-
 #endif
 
Index: kernel/arch/sparc64/include/drivers/i8042.h
===================================================================
--- kernel/arch/sparc64/include/drivers/i8042.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/include/drivers/i8042.h	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -38,6 +38,4 @@
 #include <arch/types.h>
 
-#define KBD_PHYS_ADDRESS	0x1fff8904000ULL
-
 #define STATUS_REG	4
 #define COMMAND_REG	4
Index: kernel/arch/sparc64/include/drivers/tick.h
===================================================================
--- kernel/arch/sparc64/include/drivers/tick.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/include/drivers/tick.h	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -27,5 +27,5 @@
  */
 
- /** @addtogroup sparc64	
+/** @addtogroup sparc64	
  * @{
  */
@@ -45,5 +45,4 @@
 #endif
 
- /** @}
+/** @}
  */
-
Index: kernel/arch/sparc64/src/asm.S
===================================================================
--- kernel/arch/sparc64/src/asm.S	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/asm.S	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -43,32 +43,66 @@
 memcpy_from_uspace:
 memcpy_to_uspace:
+	.register       %g2, #scratch
+        .register       %g3, #scratch
+	add	%o1, 7, %g1
+	and	%g1, -8, %g1
+	cmp	%o1, %g1
+	be,pn	%xcc, 3f
+	add	%o0, 7, %g1
+	mov	0, %g3
+0:
+	brz,pn	%o2, 2f
+	mov	0, %g2
+1:
+	ldub	[%g3 + %o1], %g1
+	add	%g2, 1, %g2
+	cmp	%o2, %g2
+	stb	%g1, [%g3 + %o0]
+	bne,pt	%xcc, 1b
+	mov	%g2, %g3
+2:
+	jmp	%o7 + 8			! exit point
+	mov	%o1, %o0
+3:
+	and	%g1, -8, %g1
+	cmp	%o0, %g1
+	bne,pt	%xcc, 0b
+	mov	0, %g3
+	srlx	%o2, 3, %g4
+	brz,pn	%g4, 5f
+	mov	0, %g5
+4:
+	sllx	%g3, 3, %g2
+	add	%g5, 1, %g3
+	ldx	[%o1 + %g2], %g1
+	mov	%g3, %g5
+	cmp	%g4, %g3
+	bne,pt	%xcc, 4b
+	stx	%g1, [%o0 + %g2]
+5:
+	and	%o2, 7, %o2
+	brz,pn	%o2, 2b
+	sllx	%g4, 3, %g1
+	mov	0, %g2
+	add	%g1, %o0, %o0
+	add	%g1, %o1, %g4
+	mov	0, %g3
+6:
+	ldub	[%g2 + %g4], %g1
+	stb	%g1, [%g2 + %o0]
+	add	%g3, 1, %g2
+	cmp	%o2, %g2
+	bne,pt	%xcc, 6b
+	mov	%g2, %g3
 
-	b _memcpy
-	nop
+	jmp	%o7 + 8			! exit point
+	mov	%o1, %o0
 
 memcpy_from_uspace_failover_address:
 memcpy_to_uspace_failover_address:
-	b memcpy_from_uspace_failover_address
-	nop
+	jmp	%o7 + 8			! exit point
+	mov	%g0, %o0		! return 0 on failure
 
 memsetb:
 	b _memsetb
 	nop
-
-.global ofw
-ofw:
-	save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
-	set ofw_cif, %l0
-	ldx [%l0], %l0
-
-	rdpr  %pstate, %l1
-	and  %l1, ~PSTATE_AM_BIT, %l2
-	wrpr  %l2, 0, %pstate
-	    
-	jmpl %l0, %o7
-	mov %i0, %o0
-	
-	wrpr  %l1, 0, %pstate
-
-	ret
-	restore %o0, 0, %o0
Index: kernel/arch/sparc64/src/console.c
===================================================================
--- kernel/arch/sparc64/src/console.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/console.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -40,5 +40,4 @@
 #include <arch/drivers/i8042.h>
 #include <genarch/i8042/i8042.h>
-#include <genarch/ofw/ofw.h>
 #include <console/chardev.h>
 #include <console/console.h>
@@ -46,47 +45,17 @@
 #include <arch/register.h>
 #include <proc/thread.h>
-#include <synch/mutex.h>
 #include <arch/mm/tlb.h>
+#include <arch/boot/boot.h>
 
 #define KEYBOARD_POLL_PAUSE	50000	/* 50ms */
-
-static void ofw_sparc64_putchar(chardev_t *d, const char ch);
-
-static volatile int ofw_console_active;
-
-static chardev_t ofw_sparc64_console;
-static chardev_operations_t ofw_sparc64_console_ops = {
-	.write = ofw_sparc64_putchar,
-};
-
-/** Initialize kernel console to use OpenFirmware services. */
-void ofw_sparc64_console_init(void)
-{
-	chardev_initialize("ofw_sparc64_console", &ofw_sparc64_console, &ofw_sparc64_console_ops);
-	stdin = NULL;
-	stdout = &ofw_sparc64_console;
-	ofw_console_active = 1;
-}
 
 /** Initialize kernel console to use framebuffer and keyboard directly. */
 void standalone_sparc64_console_init(void)
 {
-	ofw_console_active = 0;
 	stdin = NULL;
 
 	kbd_init();
-	fb_init(FB_PHYS_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH, FB_X_RES * FB_COLOR_DEPTH / 8);
-}
-
-/** Write one character using OpenFirmware.
- *
- * @param d Character device (ignored).
- * @param ch Character to be written.
- */
-void ofw_sparc64_putchar(chardev_t *d, const char ch)
-{
-	if (ch == '\n')
-		ofw_putchar('\r');
-	ofw_putchar(ch);
+	fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height,
+		bootinfo.screen.bpp, bootinfo.screen.scanline);
 }
 
Index: kernel/arch/sparc64/src/drivers/i8042.c
===================================================================
--- kernel/arch/sparc64/src/drivers/i8042.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/drivers/i8042.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -35,4 +35,5 @@
 #include <arch/drivers/i8042.h>
 #include <genarch/i8042/i8042.h>
+#include <arch/boot/boot.h>
 #include <arch/types.h>
 #include <arch/mm/page.h>
@@ -42,5 +43,5 @@
 void kbd_init()
 {
-	kbd_virt_address = (uint8_t *) hw_map(KBD_PHYS_ADDRESS, LAST_REG);
+	kbd_virt_address = (uint8_t *) hw_map(bootinfo.keyboard.addr, LAST_REG);
 	i8042_init();
 }
Index: kernel/arch/sparc64/src/mm/frame.c
===================================================================
--- kernel/arch/sparc64/src/mm/frame.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/mm/frame.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -34,20 +34,35 @@
 
 #include <arch/mm/frame.h>
-#include <genarch/ofw/memory_init.h>
 #include <mm/frame.h>
+#include <arch/boot/boot.h>
 #include <config.h>
 #include <align.h>
 
+/** Create memory zones according to information stored in bootinfo.
+ *
+ * Walk the bootinfo memory map and create frame zones according to it.
+ * The first frame is not blacklisted here as it is done in generic
+ * frame_init().
+ */
 void frame_arch_init(void)
 {
-	ofw_init_zones();
+	int i;
+	pfn_t confdata;
 
-	/*
-	 * Workaround to prevent slab allocator from allocating frame 0.
-	 * Frame 0 is
-	 * a) not mapped by OFW
-	 * b) would be confused with NULL error return code
-	 */
-	frame_mark_unavailable(0, 1);
+	for (i = 0; i < bootinfo.memmap.count; i++) {
+
+		/*
+		 * The memmap is created by HelenOS boot loader.
+		 * It already contains no holes.
+		 */
+	
+		confdata = ADDR2PFN(bootinfo.memmap.zones[i].start);
+		if (confdata == 0)
+			confdata = 2;
+		zone_create(ADDR2PFN(bootinfo.memmap.zones[i].start),
+			SIZE2FRAMES(ALIGN_DOWN(bootinfo.memmap.zones[i].size, PAGE_SIZE)),
+			confdata, 0);
+	}
+
 }
 
Index: kernel/arch/sparc64/src/mm/memory_init.c
===================================================================
--- kernel/arch/sparc64/src/mm/memory_init.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/mm/memory_init.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -34,13 +34,16 @@
 
 #include <arch/mm/memory_init.h>
-#include <genarch/ofw/memory_init.h>
+#include <arch/boot/boot.h>
 #include <typedefs.h>
 
+/** Return total size of available memory in bytes.
+ *
+ * @return Size of available memory in bytes.
+ */
 size_t get_memory_size(void)
 {
-	return ofw_get_memory_size();
+	return bootinfo.memmap.total;
 }
 
 /** @}
  */
-
Index: kernel/arch/sparc64/src/sparc64.c
===================================================================
--- kernel/arch/sparc64/src/sparc64.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/sparc64.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -40,14 +40,10 @@
 #include <proc/thread.h>
 #include <console/console.h>
+#include <arch/boot/boot.h>
 
-#include <print.h>
-#include <genarch/ofw/ofw.h>
-#include <arch/asm.h>
-#include <arch/register.h>
+bootinfo_t bootinfo;
+
 void arch_pre_mm_init(void)
 {
-	interrupts_disable();
-	ofw_sparc64_console_init();
-
 	trap_init();
 	tick_init();
Index: kernel/arch/sparc64/src/start.S
===================================================================
--- kernel/arch/sparc64/src/start.S	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/arch/sparc64/src/start.S	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -27,5 +27,4 @@
 #
 
-#include <arch/boot/boot.h>
 #include <arch/regdef.h>
 
@@ -40,4 +39,8 @@
  * Here is where the kernel is passed control
  * from the boot loader.
+ * 
+ * The registers are expected to be in this state:
+ * %o0 bootinfo structure address
+ * %o1 bootinfo structure size
  */
 
@@ -46,14 +49,19 @@
 	flushw				! flush all but the active register window
 
+	/*
+	 * Disable interrupts and disable 32-bit address masking.
+	 */
 	rdpr %pstate, %l0
-	and %l0, ~PSTATE_AM_BIT, %l0
+	and %l0, ~(PSTATE_AM_BIT|PSTATE_IE_BIT), %l0
 	wrpr %l0, 0, %pstate
 
-	set ofw_cif, %l0
-
-	call ofw_init
-	stx %o4, [%l0]
-
-	call ofw_init_memmap
+	/*
+	 * Copy the bootinfo structure passed from the boot loader
+	 * to the kernel bootinfo structure.
+	 */
+	mov %o1, %o2
+	mov %o0, %o1
+	set bootinfo, %o0
+	call memcpy
 	nop
 
