Index: boot/arch/sparc64/loader/asm.S
===================================================================
--- boot/arch/sparc64/loader/asm.S	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ boot/arch/sparc64/loader/asm.S	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -99,7 +99,9 @@
 
 jump_to_kernel:
-	set ofw_cif, %l0
-	jmp %o0				! jump to kernel
-	ldx [%l0], %o4			! pass OpenFirmware address in %o4
+	mov %o0, %l1
+	mov %o1, %o0
+	mov %o2, %o1
+	jmp %l1				! jump to kernel
+	nop
 
 .global ofw
Index: boot/arch/sparc64/loader/main.c
===================================================================
--- boot/arch/sparc64/loader/main.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ boot/arch/sparc64/loader/main.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -81,13 +81,15 @@
 	printf("\nCopying components\n");
 	unsigned int top = 0;
-	bootinfo.cnt = 0;
+	bootinfo.taskmap.count = 0;
 	for (i = 0; i < COMPONENTS; i++) {
+		void * base = (void *) KERNEL_VIRTUAL_ADDRESS;
+	
 		printf(" %s...", components[i].name);
 		top = ALIGN_UP(top, PAGE_SIZE);
-		memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size);
+		memcpy(base + top, components[i].start, components[i].size);
 		if (i > 0) {
-			bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
-			bootinfo.tasks[bootinfo.cnt].size = components[i].size;
-			bootinfo.cnt++;
+			bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = base + top;
+			bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = components[i].size;
+			bootinfo.taskmap.count++;
 		}
 		top += components[i].size;
Index: boot/arch/sparc64/loader/main.h
===================================================================
--- boot/arch/sparc64/loader/main.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ boot/arch/sparc64/loader/main.h	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -31,4 +31,5 @@
 
 #include <ofw.h>
+#include <types.h>
 
 #define TASKMAP_MAX_RECORDS 32
@@ -36,10 +37,14 @@
 typedef struct {
 	void *addr;
-	unsigned int size;
+	uint32_t size;
 } task_t;
 
 typedef struct {
-	unsigned int cnt;
+	uint32_t count;
 	task_t tasks[TASKMAP_MAX_RECORDS];
+} taskmap_t;
+
+typedef struct {
+	taskmap_t taskmap;
 	memmap_t memmap;
 	screen_t screen;
Index: boot/genarch/ofw.c
===================================================================
--- boot/genarch/ofw.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ boot/genarch/ofw.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -75,5 +75,13 @@
 }
 
-
+/** Perform a call to OpenFirmware client interface.
+ *
+ * @param service String identifying the service requested.
+ * @param nargs Number of input arguments.
+ * @param nret Number of output arguments. This includes the return value.
+ * @param rets Buffer for output arguments or NULL. The buffer must accommodate nret - 1 items.
+ *
+ * @return Return value returned by the client interface.
+ */
 static unsigned long ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...)
 {
@@ -82,5 +90,5 @@
 	int i;
 	
-	args.service = service;
+	args.service = (ofw_arg_t) service;
 	args.nargs = nargs;
 	args.nret = nret;
Index: boot/genarch/ofw.h
===================================================================
--- boot/genarch/ofw.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ boot/genarch/ofw.h	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -47,18 +47,18 @@
  */
 typedef struct {
-	const char *service;		/**< Command name */
-	unsigned long nargs;		/**< Number of in arguments */
-	unsigned long nret;		/**< Number of out arguments */
-	ofw_arg_t args[MAX_OFW_ARGS];	/**< List of arguments */
+	ofw_arg_t service;		/**< Command name. */
+	ofw_arg_t nargs;		/**< Number of in arguments. */
+	ofw_arg_t nret;			/**< Number of out arguments. */
+	ofw_arg_t args[MAX_OFW_ARGS];	/**< List of arguments. */
 } ofw_args_t;
 
 typedef struct {
 	void *start;
-	unsigned int size;
+	uint32_t size;
 } memzone_t;
 
 typedef struct {
-	unsigned int total;
-	unsigned int count;
+	uint32_t total;
+	uint32_t count;
 	memzone_t zones[MEMMAP_MAX_RECORDS];
 } memmap_t;
@@ -66,25 +66,25 @@
 typedef struct {
 	void *addr;
-	unsigned int width;
-	unsigned int height;
-	unsigned int bpp;
-	unsigned int scanline;
+	uint32_t width;
+	uint32_t height;
+	uint32_t bpp;
+	uint32_t scanline;
 } screen_t;
 
 typedef struct {
 	void *addr;
-	unsigned int size;
+	uint32_t size;
 } keyboard_t;
 
 typedef struct {
-	unsigned int info;
-	unsigned int addr_hi;
-	unsigned int addr_lo;
+	uint32_t info;
+	uint32_t addr_hi;
+	uint32_t addr_lo;
 } pci_addr_t;
 
 typedef struct {
 	pci_addr_t addr;
-	unsigned int size_hi;
-	unsigned int size_lo;
+	uint32_t size_hi;
+	uint32_t size_lo;
 } pci_reg_t;
 
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
 
Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/genarch/Makefile.inc	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -29,9 +29,4 @@
 #
 
-ifeq ($(CONFIG_OFW),y)
-	GENARCH_SOURCES += \
-		genarch/src/ofw/ofw.c \
-		genarch/src/ofw/memory_init.c
-endif
 ifeq ($(CONFIG_ACPI),y)
 	GENARCH_SOURCES += \
Index: rnel/genarch/include/ofw/memory_init.h
===================================================================
--- kernel/genarch/include/ofw/memory_init.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (C) 2006 Jakub Jermar
- * 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
- */
-
-#ifndef __OFW_MEMORY_INIT_H__
-#define __OFW_MEMORY_INIT_H__
-
-#include <typedefs.h>
-
-extern void ofw_init_memmap(void);
-extern size_t ofw_get_memory_size(void);
-extern void ofw_init_zones(void);
-
-#endif
-
-/** @}
- */
-
Index: rnel/genarch/include/ofw/ofw.h
===================================================================
--- kernel/genarch/include/ofw/ofw.h	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ 	(revision )
@@ -1,70 +1,0 @@
-/*
- * Copyright (C) 2005 Martin Decky
- * 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
- */
-
-#ifndef KERN_OFW_H_
-#define KERN_OFW_H_
-
-#include <arch/types.h>
-
-#define MAX_OFW_ARGS	12
-
-typedef unative_t ofw_arg_t;
-typedef unsigned int ihandle;
-typedef unsigned int phandle;
-
-/** OpenFirmware command structure
- *
- */
-typedef struct {
-	const char *service;		/**< Command name */
-	unative_t nargs;		/**< Number of in arguments */
-	unative_t nret;			/**< Number of out arguments */
-	ofw_arg_t args[MAX_OFW_ARGS];	/**< Buffer for in and out arguments */
-} ofw_args_t;
-
-extern int ofw(ofw_args_t *);		/**< OpenFirmware Client Interface entry point. */
-
-extern void ofw_init(void);
-extern void ofw_done(void);
-extern ofw_arg_t ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...);
-extern void ofw_putchar(const char ch);
-extern phandle ofw_find_device(const char *name);
-extern int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen);
-extern void *ofw_translate(const void *addr);
-extern void *ofw_claim(const void *addr, const int size, const int align);
-
-#endif
-
-/** @}
- */
Index: kernel/genarch/src/fb/fb.c
===================================================================
--- kernel/genarch/src/fb/fb.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/genarch/src/fb/fb.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -27,5 +27,5 @@
  */
 
- /** @addtogroup genarch	
+/** @addtogroup genarch	
  * @{
  */
@@ -420,5 +420,4 @@
 }
 
- /** @}
- */
-
+/** @}
+ */
Index: rnel/genarch/src/ofw/memory_init.c
===================================================================
--- kernel/genarch/src/ofw/memory_init.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ 	(revision )
@@ -1,97 +1,0 @@
-/*
- * Copyright (C) 2005 Martin Decky
- * 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
- */
-
-#include <genarch/ofw/memory_init.h>
-#include <genarch/ofw/ofw.h>
-#include <panic.h>
-#include <mm/frame.h>
-#include <align.h>
-#include <arch/types.h>
-#include <typedefs.h>
-
-#define MEMMAP_MAX_RECORDS 32
-
-typedef struct {
-	uintptr_t start;
-	size_t size;
-} memmap_t;
-
-static memmap_t memmap[MEMMAP_MAX_RECORDS];
-size_t total_mem = 0;
-
-void ofw_init_memmap(void)
-{
-	int i;
-	int ret;
-
-	phandle handle = ofw_find_device("/memory");
-	if (handle == -1)
-		panic("No RAM\n");
-	
-	ret = ofw_get_property(handle, "reg", &memmap, sizeof(memmap));
-	if (ret == -1)
-		panic("Device /memory has no reg property\n");
-	
-	
-	for (i = 0; i < MEMMAP_MAX_RECORDS; i++) {
-		if (memmap[i].size == 0)
-			break;
-		total_mem += memmap[i].size;
-	}
-}
-
-size_t ofw_get_memory_size(void) 
-{
-	return total_mem;
-}
-
-void ofw_init_zones(void)
-{
-	int i;
-	pfn_t confdata;
-
-	for (i = 0; i < MEMMAP_MAX_RECORDS; i++) {
-		if (memmap[i].size == 0)
-			break;
-		confdata = ADDR2PFN(memmap[i].start);
-		if (confdata == 0)
-			confdata = 2;
-		zone_create(ADDR2PFN(memmap[i].start),
-			    SIZE2FRAMES(ALIGN_DOWN(memmap[i].size,PAGE_SIZE)),
-			    confdata, 0);
-	}
-}
-
-/** @}
- */
Index: rnel/genarch/src/ofw/ofw.c
===================================================================
--- kernel/genarch/src/ofw/ofw.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ 	(revision )
@@ -1,154 +1,0 @@
-/*
- * Copyright (C) 2005 Martin Decky
- * 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
- */
-
-#include <genarch/ofw/ofw.h>
-#include <arch/asm.h>
-#include <stdarg.h>
-#include <cpu.h>
-#include <arch/types.h>
-
-uintptr_t ofw_cif;	/**< OpenFirmware Client Interface address. */
-
-phandle ofw_chosen;
-ihandle ofw_stdout;
-ihandle ofw_mmu;
-
-void ofw_init(void)
-{
-	ofw_chosen = ofw_find_device("/chosen");
-	if (ofw_chosen == -1)
-		ofw_done();
-	
-	if (ofw_get_property(ofw_chosen, "stdout",  &ofw_stdout, sizeof(ofw_stdout)) <= 0)
-		ofw_stdout = 0;	
-
-	if (ofw_get_property(ofw_chosen, "mmu",  &ofw_mmu, sizeof(ofw_mmu)) <= 0)
-		ofw_mmu = 0;
-}
-
-void ofw_done(void)
-{
-	(void) ofw_call("exit", 0, 1, NULL);
-	cpu_halt();
-}
-
-/** Perform a call to OpenFirmware client interface.
- *
- * @param service String identifying the service requested.
- * @param nargs Number of input arguments.
- * @param nret Number of output arguments. This includes the return value.
- * @param rets Buffer for output arguments or NULL. The buffer must accomodate nret - 1 items.
- *
- * @return Return value returned by the client interface.
- */
-ofw_arg_t ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...)
-{
-	va_list list;
-	ofw_args_t args;
-	int i;
-	
-	args.service = service;
-	args.nargs = nargs;
-	args.nret = nret;
-	
-	va_start(list, rets);
-	for (i = 0; i < nargs; i++)
-		args.args[i] = va_arg(list, ofw_arg_t);
-	va_end(list);
-	
-	for (i = 0; i < nret; i++)
-		args.args[i + nargs] = 0;
-	
-	(void) ofw(&args);
-
-	for (i = 1; i < nret; i++)
-		rets[i - 1] = args.args[i + nargs];
-
-	return args.args[nargs];
-}
-
-void ofw_putchar(const char ch)
-{
-	if (ofw_stdout == 0)
-		return;
-	
-	(void) ofw_call("write", 3, 1, NULL, ofw_stdout, &ch, 1);
-}
-
-phandle ofw_find_device(const char *name)
-{
-	return (phandle) ofw_call("finddevice", 1, 1, NULL, name);
-}
-
-int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen)
-{
-	return (int) ofw_call("getprop", 4, 1, NULL, device, name, buf, buflen);
-}
-
-/** Translate virtual address to physical address using OpenFirmware.
- *
- * Use this function only when OpenFirmware is in charge.
- *
- * @param virt Virtual address.
- * @return NULL on failure or physical address on success.
- */
-void *ofw_translate(const void *virt)
-{
-	ofw_arg_t result[4];
-	int shift;
-	
-	if (!ofw_mmu)
-		return NULL;
-	
-	if (ofw_call("call-method", 3, 5, result, "translate", ofw_mmu, virt) != 0)
-		return NULL;
-
-	if (result[0] != -1)
-		return NULL;
-								
-	if (sizeof(unative_t) == 8)
-		shift = 32;
-	else
-		shift = 0;
-	
-	return (void *) ((result[2]<<shift)|result[3]);
-}
-
-void *ofw_claim(const void *addr, const int size, const int align)
-{
-	return (void *) ofw_call("claim", 3, 1, NULL, addr, size, align);
-}
-
-/** @}
- */
Index: kernel/generic/src/mm/frame.c
===================================================================
--- kernel/generic/src/mm/frame.c	(revision 63cda71efb0a2f95861470401dbc781d7f284896)
+++ kernel/generic/src/mm/frame.c	(revision 94d614ef2057652d47a2a1df5f4c4809bbe31b2f)
@@ -1078,5 +1078,5 @@
 
 		/* Black list first frame, as allocating NULL would
-		 * fail on some places */
+		 * fail in some places */
 		frame_mark_unavailable(0, 1);
 	}
