Index: boot/genarch/ofw.c
===================================================================
--- boot/genarch/ofw.c	(revision e731b0db7a19a49197d3ed700a60c8131857f598)
+++ boot/genarch/ofw.c	(revision 67c708ee8972b44bf593cee166f5e18ce89eec48)
@@ -32,4 +32,5 @@
 #include <asm.h>
 #include <types.h>
+#include <string.h>
 
 #define RED(i)    (((i) >> 5) & ((1 << 3) - 1))
@@ -46,5 +47,4 @@
 ihandle ofw_memory_prop;
 phandle ofw_memory;
-phandle ofw_aliases;
 
 void ofw_init(void)
@@ -74,14 +74,8 @@
 		halt();
 	}
-
+	
 	ofw_memory = ofw_find_device("/memory");
 	if (ofw_memory == -1) {
 		puts("\r\nError: Unable to find /memory device, halted.\r\n");
-		halt();
-	}
-	
-	ofw_aliases = ofw_find_device("/aliases");
-	if (ofw_aliases == -1) {
-		puts("\r\nError: Unable to find /aliases device, halted.\r\n");
 		halt();
 	}
@@ -133,6 +127,5 @@
 }
 
-int
-ofw_get_property(const phandle device, const char *name, void *buf,
+int ofw_get_property(const phandle device, const char *name, void *buf,
     const int buflen)
 {
@@ -166,5 +159,4 @@
 	return ret;
 }
-
 
 unsigned int ofw_get_size_cells(const phandle device)
@@ -354,43 +346,89 @@
 }
 
-/**
- * Sets up the palette for the 8-bit color depth configuration so that the
- * 3:2:3 color scheme can be used. Checks that setting the palette makes sense
- * (appropriate nodes exist in the OBP tree and the color depth is not greater
+static void ofw_setup_screen(phandle handle)
+{
+	/* Check for device type */
+	char device_type[OFW_TREE_PROPERTY_MAX_VALUELEN];
+	if (ofw_get_property(handle, "device_type", device_type, OFW_TREE_PROPERTY_MAX_VALUELEN) <= 0)
+		return;
+	
+	device_type[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = '\0';
+	if (strcmp(device_type, "display") != 0)
+		return;
+	
+	/* Check for 8 bit depth */
+	uint32_t depth;
+	if (ofw_get_property(handle, "depth", &depth, sizeof(uint32_t)) <= 0)
+		depth = 0;
+	
+	/* Get device path */
+	static char path[OFW_TREE_PATH_MAX_LEN + 1];
+	size_t len = ofw_package_to_path(handle, path, OFW_TREE_PATH_MAX_LEN);
+	if (len == -1)
+		return;
+	
+	path[len] = '\0';
+	
+	/* Open the display to initialize it */
+	ihandle screen = ofw_open(path);
+	if (screen == -1)
+		return;
+	
+	if (depth == 8) {
+		/* Setup the palette so that the (inverted) 3:2:3 scheme is usable */
+		unsigned int i;
+		for (i = 0; i < 256; i++) {
+			ofw_call("call-method", 6, 1, NULL, "color!", screen,
+			    255 - i, CLIP(BLUE(i) * 37), GREEN(i) * 85, CLIP(RED(i) * 37));
+		}
+	}
+}
+
+static void ofw_setup_screens_internal(phandle current)
+{
+	while ((current != 0) && (current != -1)) {
+		ofw_setup_screen(current);
+		
+		/*
+		 * Recursively process the potential child node.
+		 */
+		phandle child = ofw_get_child_node(current);
+		if ((child != 0) && (child != -1))
+			ofw_setup_screens_internal(child);
+		
+		/*
+		 * Iteratively process the next peer node.
+		 * Note that recursion is a bad idea here.
+		 * Due to the topology of the OpenFirmware device tree,
+		 * the nesting of peer nodes could be to wide and the
+		 * risk of overflowing the stack is too real.
+		 */
+		phandle peer = ofw_get_peer_node(current);
+		if ((peer != 0) && (peer != -1)) {
+			current = peer;
+			/*
+			 * Process the peer in next iteration.
+			 */
+			continue;
+		}
+		
+		/*
+		 * No more peers on this level.
+		 */
+		break;
+	}
+}
+
+/** Setup all screens which can be detected.
+ *
+ * Open all screens which can be detected and set up the palette for the 8-bit
+ * color depth configuration so that the 3:2:3 color scheme can be used.
+ * Check that setting the palette makes sense (the color depth is not greater
  * than 8).
  *
- * @return true if the palette has been set, false otherwise
- *
  */
-int ofw_setup_palette(void)
-{
-	char device_name[BUF_SIZE];
-	
-	/* Resolve alias */
-	if (ofw_get_property(ofw_aliases, "screen", device_name,
-	    sizeof(device_name)) <= 0)
-		return false;
-	
-	/* For depth greater than 8 it makes no sense to set up the palette */
-	uint32_t depth;
-	phandle device = ofw_find_device(device_name);
-	if (device == -1)
-		return false;
-	if (ofw_get_property(device, "depth", &depth, sizeof(uint32_t)) <= 0)
-		return false;
-	if (depth != 8)
-		return false;
-	
-	/* Required in order to be able to make a method call */
-	ihandle screen = ofw_open(device_name);
-	if (screen == -1)
-		return false;
-	
-	/* Setup the palette so that the (inverted) 3:2:3 scheme is usable */
-	unsigned int i;
-	for (i = 0; i < 256; i++)
-		ofw_call("call-method", 6, 1, NULL, "color!", screen,
-		    255 - i, CLIP(BLUE(i) * 37), GREEN(i) * 85, CLIP(RED(i) * 37));
-	return true;
+void ofw_setup_screens(void)
+{
+	ofw_setup_screens_internal(ofw_root);
 }
 
Index: boot/genarch/ofw.h
===================================================================
--- boot/genarch/ofw.h	(revision e731b0db7a19a49197d3ed700a60c8131857f598)
+++ boot/genarch/ofw.h	(revision 67c708ee8972b44bf593cee166f5e18ce89eec48)
@@ -33,9 +33,10 @@
 #include <stdarg.h>
 
-#define BUF_SIZE  1024
+#define MEMMAP_MAX_RECORDS  32
+#define MAX_OFW_ARGS        12
 
-#define MEMMAP_MAX_RECORDS  32
-
-#define MAX_OFW_ARGS  12
+#define OFW_TREE_PATH_MAX_LEN           256
+#define OFW_TREE_PROPERTY_MAX_NAMELEN   32
+#define OFW_TREE_PROPERTY_MAX_VALUELEN  64
 
 typedef unative_t ofw_arg_t;
@@ -83,5 +84,4 @@
 extern ihandle ofw_mmu;
 extern phandle ofw_memory;
-extern phandle ofw_aliases;
 
 extern void ofw_init(void);
@@ -110,5 +110,5 @@
 extern int ofw_map(const void *phys, const void *virt, const unsigned int size, const int mode);
 extern int ofw_memmap(memmap_t *map);
-extern int ofw_setup_palette(void);
+extern void ofw_setup_screens(void);
 extern void ofw_quiesce(void);
 
Index: boot/genarch/ofw_tree.c
===================================================================
--- boot/genarch/ofw_tree.c	(revision e731b0db7a19a49197d3ed700a60c8131857f598)
+++ boot/genarch/ofw_tree.c	(revision 67c708ee8972b44bf593cee166f5e18ce89eec48)
@@ -35,6 +35,4 @@
 #include <asm.h>
 #include <memstr.h>
-
-#define MAX_PATH_LEN  256
 
 static ofw_tree_node_t *ofw_tree_node_alloc(void)
@@ -101,6 +99,6 @@
 		 * Get the disambigued name.
 		 */
-		static char path[MAX_PATH_LEN + 1];
-		size_t len = ofw_package_to_path(current, path, MAX_PATH_LEN);
+		static char path[OFW_TREE_PATH_MAX_LEN + 1];
+		size_t len = ofw_package_to_path(current, path, OFW_TREE_PATH_MAX_LEN);
 		if (len == -1)
 			return;
@@ -168,5 +166,5 @@
 			memcpy(name, name2, OFW_TREE_PROPERTY_MAX_NAMELEN);
 			memcpy(property[i].name, name, OFW_TREE_PROPERTY_MAX_NAMELEN);
-			property[i].name[OFW_TREE_PROPERTY_MAX_NAMELEN] = '\0';
+			property[i].name[OFW_TREE_PROPERTY_MAX_NAMELEN - 1] = '\0';
 			
 			size_t size = ofw_get_proplen(current, name);
Index: boot/genarch/ofw_tree.h
===================================================================
--- boot/genarch/ofw_tree.h	(revision e731b0db7a19a49197d3ed700a60c8131857f598)
+++ boot/genarch/ofw_tree.h	(revision 67c708ee8972b44bf593cee166f5e18ce89eec48)
@@ -33,5 +33,4 @@
 #include <ofw.h>
 
-#define OFW_TREE_PROPERTY_MAX_NAMELEN  32
 
 /** Memory representation of OpenFirmware device tree node property. */
