Index: arch/ppc/Makefile.inc
===================================================================
--- arch/ppc/Makefile.inc	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ arch/ppc/Makefile.inc	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -17,5 +17,4 @@
 arch_sources= \
 	arch/context.S \
-	arch/ppc.c \
 	arch/debug/panic.s \
 	arch/fpu_context.c \
Index: arch/ppc/include/context.h
===================================================================
--- arch/ppc/include/context.h	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ arch/ppc/include/context.h	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -31,6 +31,14 @@
 
 #include <arch/types.h>
+#include <arch/drivers/ofw.h>
 
-#define SP_DELTA	4
+#define SP_DELTA	8
+
+#ifdef context_map_stack
+#undef context_map_stack
+#endif
+
+#define context_map_stack(stack, size) \
+	ofw_claim((void *) stack, size, 0);
 
 struct context {
Index: arch/ppc/include/drivers/ofw.h
===================================================================
--- arch/ppc/include/drivers/ofw.h	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ arch/ppc/include/drivers/ofw.h	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -58,4 +58,5 @@
 extern phandle ofw_find_device(const char *name);
 extern int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen);
+extern void *ofw_claim(const void *addr, const int size, const int align);
 extern void putchar(const char ch);
 
Index: ch/ppc/include/ppc.h
===================================================================
--- arch/ppc/include/ppc.h	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ 	(revision )
@@ -1,34 +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.
- */
-
-#ifndef __ppc_PPC_H__
-#define __ppc_PPC_H__
-
-extern void early_init(int r3, int r4, int r5);
-
-#endif
Index: arch/ppc/src/drivers/ofw.c
===================================================================
--- arch/ppc/src/drivers/ofw.c	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ arch/ppc/src/drivers/ofw.c	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -93,4 +93,9 @@
 }
 
+void *ofw_claim(const void *addr, const int size, const int align)
+{
+	return (void *) ofw_call("claim", 3, 1, addr, size, align);
+}
+
 void putchar(const char ch)
 {
Index: ch/ppc/src/ppc.c
===================================================================
--- arch/ppc/src/ppc.c	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ 	(revision )
@@ -1,37 +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.
- */
-
-#include <arch.h>
-#include <arch/ppc.h>
-#include <arch/drivers/ofw.h>
-
-void early_init(int r3, int r4, int r5)
-{
-	ofw = (ofw_entry) r5;
-	ofw_init();
-}
Index: arch/ppc/src/start.S
===================================================================
--- arch/ppc/src/start.S	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ arch/ppc/src/start.S	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -34,5 +34,7 @@
 
 kernel_image_start:
-	bl early_init
+	lis r4, ofw@ha
+	addi r4, r4, ofw@l
+	stw r5, 0(r4)
 	
 	lis r3, _hardcoded_ktext_size@ha
@@ -54,3 +56,5 @@
 	stw r3, 0(r4)
 	
+	bl ofw_init
+	
 	b main_bsp
Index: include/context.h
===================================================================
--- include/context.h	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ include/context.h	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -39,8 +39,10 @@
 #endif /* context_set */
 
+#ifndef context_map_stack
+#define context_map_stack(stack, size)
+#endif /* context_map_stack */
+
 extern int context_save(context_t *c);
 extern void context_restore(context_t *c) __attribute__ ((noreturn));
 
-
-
 #endif
Index: src/main/main.c
===================================================================
--- src/main/main.c	(revision b9e97fb2772f7c034a63b8c019ca6396de53e556)
+++ src/main/main.c	(revision 8f917297887ddc3e33feb7dbd42d7c10de978bc2)
@@ -119,4 +119,5 @@
 	context_save(&ctx);
 	context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + kernel_size, CONFIG_STACK_SIZE);
+	context_map_stack(config.base + kernel_size, CONFIG_STACK_SIZE);
 	context_restore(&ctx);
 	/* not reached */
@@ -134,5 +135,5 @@
 	task_t *k;
 	thread_t *t;
-
+	
 	the_initialize(THE);
 
