Index: kernel/arch/ia32/src/mm/frame.c
===================================================================
--- kernel/arch/ia32/src/mm/frame.c	(revision 7943c43ec7446695410d2e5521eb8121555e8c0c)
+++ kernel/arch/ia32/src/mm/frame.c	(revision c1f27f1dbf37189072fbb9a7e7902ee64baca85e)
@@ -46,4 +46,6 @@
 #include <print.h>
 
+#define PHYSMEM_LIMIT32  UINT64_C(0x100000000)
+
 size_t hardcoded_unmapped_ktext_size = 0;
 size_t hardcoded_unmapped_kdata_size = 0;
@@ -56,15 +58,16 @@
 		uint64_t base64 = e820table[i].base_address;
 		uint64_t size64 = e820table[i].size;
-
+		
 #ifdef KARCH_ia32
 		/*
 		 * Restrict the e820 table entries to 32-bits.
 		 */
-		if (base64 >= 0x100000000ULL)
+		if (base64 >= PHYSMEM_LIMIT32)
 			continue;
-		if (base64 + size64 > 0x100000000ULL)
-			size64 -= base64 + size64 - 0x100000000ULL;
+		
+		if (base64 + size64 > PHYSMEM_LIMIT32)
+			size64 = PHYSMEM_LIMIT32 - base64;
 #endif
-
+		
 		uintptr_t base = (uintptr_t) base64;
 		size_t size = (size_t) size64;
