Index: boot/arch/mips32/include/types.h
===================================================================
--- boot/arch/mips32/include/types.h	(revision 295732b939193c726eec72dc703411ec78b675ff)
+++ boot/arch/mips32/include/types.h	(revision bcad855c010b3c34d90af0e20b0fb4bbff0f638c)
@@ -47,4 +47,7 @@
 
 typedef struct {
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+	uint32_t sdram_size;
+#endif
 	uint32_t cpumap;
 	size_t cnt;
Index: boot/arch/mips32/src/asm.S
===================================================================
--- boot/arch/mips32/src/asm.S	(revision 295732b939193c726eec72dc703411ec78b675ff)
+++ boot/arch/mips32/src/asm.S	(revision bcad855c010b3c34d90af0e20b0fb4bbff0f638c)
@@ -51,4 +51,12 @@
 	and $a0, $a1, $a0
 	mtc0 $a0, $status
+
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+	/*
+	 * Remember the size of the SDRAM in bootinfo.
+	 */
+	la $a0, PA2KA(BOOTINFO_OFFSET)
+	sw $a3, 0($a0)
+#endif
 	
 	/*
Index: kernel/arch/mips32/include/arch.h
===================================================================
--- kernel/arch/mips32/include/arch.h	(revision 295732b939193c726eec72dc703411ec78b675ff)
+++ kernel/arch/mips32/include/arch.h	(revision bcad855c010b3c34d90af0e20b0fb4bbff0f638c)
@@ -44,4 +44,8 @@
 extern size_t cpu_count;
 
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+extern size_t sdram_size;
+#endif
+
 typedef struct {
 	void *addr;
@@ -51,4 +55,7 @@
 
 typedef struct {
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+	uint32_t sdram_size;
+#endif
 	uint32_t cpumap;
 	size_t cnt;
Index: kernel/arch/mips32/src/mips32.c
===================================================================
--- kernel/arch/mips32/src/mips32.c	(revision 295732b939193c726eec72dc703411ec78b675ff)
+++ kernel/arch/mips32/src/mips32.c	(revision bcad855c010b3c34d90af0e20b0fb4bbff0f638c)
@@ -71,4 +71,8 @@
 size_t cpu_count = 0;
 
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+size_t sdram_size = 0;
+#endif
+
 /** Performs mips32-specific initialization before main_bsp() is called. */
 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)
@@ -88,4 +92,8 @@
 			cpu_count++;
 	}
+
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+	sdram_size = bootinfo->sdram_size;
+#endif
 }
 
Index: kernel/arch/mips32/src/mm/frame.c
===================================================================
--- kernel/arch/mips32/src/mm/frame.c	(revision 295732b939193c726eec72dc703411ec78b675ff)
+++ kernel/arch/mips32/src/mm/frame.c	(revision bcad855c010b3c34d90af0e20b0fb4bbff0f638c)
@@ -41,4 +41,5 @@
 #include <config.h>
 #include <arch/drivers/msim.h>
+#include <arch/arch.h>
 #include <print.h>
 
@@ -82,4 +83,9 @@
 	/* MSIM device (dkeyboard) */
 	if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
+		return false;
+#endif
+
+#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
+	if (frame >= (sdram_size >> ZERO_PAGE_WIDTH))
 		return false;
 #endif
