Index: arch/ia32/include/boot/boot.h
===================================================================
--- arch/ia32/include/boot/boot.h	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ arch/ia32/include/boot/boot.h	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -34,5 +34,5 @@
 
 #define MULTIBOOT_HEADER_MAGIC	0x1BADB002
-#define MULTIBOOT_HEADER_FLAGS	0x00010003
+#define MULTIBOOT_HEADER_FLAGS	0x0001000B
 
 #define MULTIBOOT_LOADER_MAGIC	0x2BADB002
Index: arch/ia32/include/boot/memmap.h
===================================================================
--- arch/ia32/include/boot/memmap.h	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ arch/ia32/include/boot/memmap.h	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -30,6 +30,24 @@
 #define __ia32_MEMMAP_H__
 
+/* E820h memory range types - other values*/
+	/* Free memory */
+#define MEMMAP_MEMORY_AVAILABLE	1
+	/* Not available for OS */
+#define MEMMAP_MEMORY_RESERVED	2 
+	/* OS may use it after reading ACPI table */
+#define MEMMAP_MEMORY_ACPI	3 
+	/* Unusable, required to be saved and restored across an NVS sleep */
+#define MEMMAP_MEMORY_NVS	4 
+	/* Corrupted memory */
+#define MEMMAP_MEMORY_UNUSABLE	5 
 
-#include <arch/boot/memmapasm.h>
+	 /* size of one entry */
+#define MEMMAP_E820_RECORD_SIZE 20 
+	/* maximum entries */
+#define MEMMAP_E820_MAX_RECORDS 32 
+
+
+#ifndef __ASM__
+
 #include <arch/types.h>
 
@@ -47,2 +65,4 @@
 
 #endif
+
+#endif
Index: ch/ia32/include/boot/memmapasm.h
===================================================================
--- arch/ia32/include/boot/memmapasm.h	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (C) 2005 Josef Cejka
- * 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 __ia32_MEMMAPASM_H__
-#define __ia32_MEMMAPASM_H__
-
-
-/* E820h memory range types - other values*/
-	/* Free memory */
-#define MEMMAP_MEMORY_AVAILABLE	1
-	/* Not available for OS */
-#define MEMMAP_MEMORY_RESERVED	2 
-	/* OS may use it after reading ACPI table */
-#define MEMMAP_MEMORY_ACPI	3 
-	/* Unusable, required to be saved and restored across an NVS sleep */
-#define MEMMAP_MEMORY_NVS	4 
-	/* Corrupted memory */
-#define MEMMAP_MEMORY_UNUSABLE	5 
-
-	 /* size of one entry */
-#define MEMMAP_E820_RECORD_SIZE 20 
-	/* maximum entries */
-#define MEMMAP_E820_MAX_RECORDS 32 
-
-#endif
Index: arch/ia32/src/boot/boot.S
===================================================================
--- arch/ia32/src/boot/boot.S	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ arch/ia32/src/boot/boot.S	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -28,5 +28,5 @@
 
 #include <arch/boot/boot.h>
-#include <arch/boot/memmapasm.h>
+#include <arch/boot/memmap.h>
 #include <arch/mm/page.h>
 #include <arch/pm.h>
@@ -157,4 +157,17 @@
 		movl %ecx, e801memorysize
 		
+		bt $3, %eax								# mbi->flags[3] (mods_count, mods_addr valid)	
+		jc mods_valid
+			
+			xorl %ecx, %ecx
+			xorl %edx, %edx
+			jmp mods_invalid
+		
+		mods_valid:
+		
+		mods_invalid:
+		movl %ecx, init_addr
+		movl %edx, init_size
+		
 		bt $6, %eax								# mbi->flags[6] (mmap_length, mmap_addr valid)	
 		jc mmap_valid
Index: arch/ia32/src/boot/memmap.S
===================================================================
--- arch/ia32/src/boot/memmap.S	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ arch/ia32/src/boot/memmap.S	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -28,5 +28,5 @@
 
 
-#include <arch/boot/memmapasm.h>
+#include <arch/boot/memmap.h>
 
 E820_SMAP = 0x534d4150
Index: arch/mips32/Makefile.inc
===================================================================
--- arch/mips32/Makefile.inc	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ arch/mips32/Makefile.inc	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -42,6 +42,8 @@
 
 KERNEL_LOAD_ADDRESS = 0x80100000
+INIT_ADDRESS = 0x80110000
+INIT_SIZE = 65536
 CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss
-DEFS += -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
+DEFS += -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} -DINIT_ADDRESS=${INIT_ADDRESS} -DINIT_SIZE=${INIT_SIZE}
 
 ## Accepted MACHINEs
Index: contrib/conf/msim.conf
===================================================================
--- contrib/conf/msim.conf	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ contrib/conf/msim.conf	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -8,4 +8,5 @@
 add rwm mainmem		0x00100000	16M	load "kernel.bin"
 add rom startmem	0x1fc00000	1k	load "load.bin" 
+add rwm init		0x00110000	64k	load "init"
 
 add dprinter printer 0x10000000
Index: generic/src/main/main.c
===================================================================
--- generic/src/main/main.c	(revision 7453929d2544639ed584538be3d0bcaa203a825c)
+++ generic/src/main/main.c	(revision aa72859d0c090bdc1ac6daafea576a9d09b51f2c)
@@ -85,4 +85,7 @@
 size_t hardcoded_kdata_size = 0;
 
+__address init_addr = 0;
+size_t init_size = 0;
+
 /*
  * Size of memory in bytes taken by kernel and heap.
