Index: kernel/generic/src/lib/rd.c
===================================================================
--- kernel/generic/src/lib/rd.c	(revision 058b021e12166270a97cf3aaf8f91a30aedc513c)
+++ kernel/generic/src/lib/rd.c	(revision 7bf7ef77b559bde9e785ddbc26c19e06dd0ff54c)
@@ -40,6 +40,8 @@
 #include <lib/rd.h>
 #include <arch/byteorder.h>
+#include <mm/frame.h>
+#include <sysinfo/sysinfo.h>
 
-int init_rd(rd_header * header)
+int init_rd(rd_header * header, size_t size)
 {
 	/* Identify RAM disk */
@@ -51,16 +53,31 @@
 		return RE_UNSUPPORTED;
 	
-	uint64_t hsize;
+	uint32_t hsize;
+	uint64_t dsize;
 	switch (header->data_type) {
 	case RD_DATA_LSB:
-		hsize = uint64_t_le2host(header->header_size);
+		hsize = uint32_t_le2host(header->header_size);
+		dsize = uint64_t_le2host(header->data_size);
 		break;
-//	case RD_DATA_MSB:
-//		hsize = uint64_t_be2host(header->header_size);
-//		break;
+	case RD_DATA_MSB:
+		hsize = uint32_t_be2host(header->header_size);
+		dsize = uint64_t_le2host(header->data_size);
+		break;
 	default:
 		return RE_UNSUPPORTED;
 	}
-		
+	
+	if ((hsize % FRAME_SIZE) || (dsize % FRAME_SIZE))
+		return RE_UNSUPPORTED;
+	
+	if (hsize > size)
+		return RE_INVALID;
+	
+	if ((uint64_t) hsize + dsize > size)
+		dsize = size - hsize;
+	
+	sysinfo_set_item_val("rd", NULL, true);
+	sysinfo_set_item_val("rd.size", NULL, dsize);
+	sysinfo_set_item_val("rd.address.physical", NULL, (unative_t) KA2PA((void *) header + hsize));
 
 	return RE_OK;
