Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/Makefile	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -377,4 +377,8 @@
 GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
 
+GENARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(GENARCH_AUTOGENS_AG)))
+GENARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(GENARCH_AUTOGENS_AG)))
+GENARCH_AUTOGENS_PROBE_S := $(addsuffix .ag.probe.s,$(basename $(GENARCH_AUTOGENS_AG)))
+
 ARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(ARCH_AUTOGENS_AG)))
 ARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(ARCH_AUTOGENS_AG)))
@@ -460,5 +464,5 @@
 	$(GENMAP) $(MAP_PREV) $(DUMP) $@
 
-$(DEPEND): $(COMMON_HEADER_ARCH) $(ARCH_AUTOGENS_H)
+$(DEPEND): $(COMMON_HEADER_ARCH) $(ARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_H)
 	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
 	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
@@ -469,2 +473,3 @@
 autogen_clean:
 	-rm $(ARCH_AUTOGENS_H) $(ARCH_AUTOGENS_PROBE_C) $(ARCH_AUTOGENS_PROBE_S)
+	-rm $(GENARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_PROBE_C) $(GENARCH_AUTOGENS_PROBE_S)
Index: kernel/arch/amd64/Makefile.inc
===================================================================
--- kernel/arch/amd64/Makefile.inc	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/arch/amd64/Makefile.inc	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -93,3 +93,4 @@
 	arch/$(KARCH)/include/arch/istate_struct.ag \
 	arch/$(KARCH)/include/arch/context_struct.ag \
-	arch/$(KARCH)/include/arch/kseg_struct.ag
+	arch/$(KARCH)/include/arch/kseg_struct.ag \
+	arch/$(KARCH)/include/arch/boot/memmap_struct.ag
Index: kernel/arch/amd64/include/arch/boot/memmap_struct.ag
===================================================================
--- kernel/arch/amd64/include/arch/boot/memmap_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
+++ kernel/arch/amd64/include/arch/boot/memmap_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -0,0 +1,1 @@
+../../../../ia32/include/arch/boot/memmap_struct.ag
Index: kernel/arch/ia32/Makefile.inc
===================================================================
--- kernel/arch/ia32/Makefile.inc	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/arch/ia32/Makefile.inc	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -110,4 +110,5 @@
 ARCH_AUTOGENS_AG = \
 	arch/$(KARCH)/include/arch/istate_struct.ag \
-	arch/$(KARCH)/include/arch/context_struct.ag
+	arch/$(KARCH)/include/arch/context_struct.ag \
+	arch/$(KARCH)/include/arch/boot/memmap_struct.ag
 
Index: kernel/arch/ia32/include/arch/boot/memmap.h
===================================================================
--- kernel/arch/ia32/include/arch/boot/memmap.h	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/arch/ia32/include/arch/boot/memmap.h	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -36,4 +36,6 @@
 #define KERN_ia32_MEMMAP_H_
 
+#include <arch/boot/memmap_struct.h>
+
 /* E820h memory range types */
 
@@ -63,10 +65,4 @@
 #include <typedefs.h>
 
-typedef struct {
-	uint64_t base_address;
-	uint64_t size;
-	uint32_t type;
-} __attribute__ ((packed)) e820memmap_t;
-
 extern e820memmap_t e820table[MEMMAP_E820_MAX_RECORDS];
 extern uint8_t e820counter;
Index: kernel/arch/ia32/include/arch/boot/memmap_struct.ag
===================================================================
--- kernel/arch/ia32/include/arch/boot/memmap_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
+++ kernel/arch/ia32/include/arch/boot/memmap_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -0,0 +1,52 @@
+# Copyright (c) 2016 Jakub Jermar 
+# 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.
+#
+
+{
+        name : e820memmap,
+        packed : true,
+
+        includes : [
+                {
+                        include : <typedefs.h>
+                },
+        ],
+
+        members : [
+                {
+                        name : base_address,
+                        type : uint64_t
+                },
+                {
+                        name : size,
+                        type : uint64_t
+                },
+                {
+                        name : type,
+                        type : uint32_t
+                }
+        ]
+}
Index: kernel/arch/ia32/src/boot/multiboot.S
===================================================================
--- kernel/arch/ia32/src/boot/multiboot.S	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/arch/ia32/src/boot/multiboot.S	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -31,4 +31,5 @@
 #include <abi/asmtool.h>
 #include <arch/boot/boot.h>
+#include <arch/boot/memmap.h>
 #include <arch/mm/page.h>
 #include <arch/pm.h>
@@ -315,5 +316,5 @@
 		/* Check if memory map flag is present */
 		movl (%ebx), %edx
-		andl $(1 << 6), %edx
+		andl $MULTIBOOT_INFO_FLAGS_MMAP, %edx
 		jnz use_multiboot_map
 			
@@ -323,8 +324,8 @@
 		
 		/* Copy address of the memory map to edx */
-		movl 48(%ebx), %edx
+		movl MULTIBOOT_INFO_OFFSET_MMAP_ADDR(%ebx), %edx
 		movl %edx, %ecx
 		
-		addl 44(%ebx), %ecx
+		addl MULTIBOOT_INFO_OFFSET_MMAP_LENGTH(%ebx), %ecx
 		
 		/* Find a free region at least 2M in size */
@@ -332,15 +333,14 @@
 			
 			/* Is this a free region? */
-			cmp $1, 20(%edx)
+			cmpl $MEMMAP_MEMORY_AVAILABLE, MULTIBOOT_MEMMAP_OFFSET_MM_INFO + E820MEMMAP_OFFSET_TYPE(%edx)
 			jnz next_region
 			
 			/* Check size */
-			cmp $0, 16(%edx)
+			cmpl $0, MULTIBOOT_MEMMAP_OFFSET_MM_INFO + E820MEMMAP_OFFSET_SIZE + 4(%edx)
 			jnz next_region
-			
-			cmpl $(2 * 1024 * 1024 + 4 * 1024), 12(%edx)
+			cmpl $(2 * 1024 * 1024 + PAGE_SIZE), MULTIBOOT_MEMMAP_OFFSET_MM_INFO + E820MEMMAP_OFFSET_SIZE(%edx)
 			jbe next_region
 			
-			cmp $0, 8(%edx)
+			cmpl $0, MULTIBOOT_MEMMAP_OFFSET_MM_INFO + E820MEMMAP_OFFSET_BASE_ADDRESS + 4(%edx)
 			jz found_region
 		
@@ -354,6 +354,6 @@
 		next_region_do:
 			
-			addl (%edx), %edx
-			addl $4, %edx
+			addl MULTIBOOT_MEMMAP_OFFSET_SIZE(%edx), %edx
+			addl $MULTIBOOT_MEMMAP_SIZE_SIZE, %edx
 			jmp check_memmap_loop
 			
@@ -361,6 +361,6 @@
 			
 			/* Use end of the found region */
-			mov 4(%edx), %ecx
-			add 12(%edx), %ecx
+			mov MULTIBOOT_MEMMAP_OFFSET_MM_INFO + E820MEMMAP_OFFSET_BASE_ADDRESS(%edx), %ecx
+			add MULTIBOOT_MEMMAP_OFFSET_MM_INFO + E820MEMMAP_OFFSET_SIZE(%edx), %ecx
 			sub $(2 * 1024 * 1024), %ecx
 			mov %ecx, free_area
Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/genarch/Makefile.inc	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -30,164 +30,173 @@
 
 ifeq ($(CONFIG_ACPI),y)
-	GENARCH_SOURCES += \
-		genarch/src/acpi/acpi.c \
-		genarch/src/acpi/madt.c
+GENARCH_SOURCES += \
+	genarch/src/acpi/acpi.c \
+	genarch/src/acpi/madt.c
 endif
 
 ifeq ($(CONFIG_PAGE_PT),y)
-	GENARCH_SOURCES += \
-		genarch/src/mm/page_pt.c \
-		genarch/src/mm/as_pt.c
+GENARCH_SOURCES += \
+	genarch/src/mm/page_pt.c \
+	genarch/src/mm/as_pt.c
 endif
 
 ifeq ($(CONFIG_PAGE_HT),y)
-	GENARCH_SOURCES += \
-		genarch/src/mm/page_ht.c \
-		genarch/src/mm/as_ht.c
+GENARCH_SOURCES += \
+	genarch/src/mm/page_ht.c \
+	genarch/src/mm/as_ht.c
 endif
 
 ifeq ($(CONFIG_ASID),y)
-	GENARCH_SOURCES += \
-		genarch/src/mm/asid.c
+GENARCH_SOURCES += \
+	genarch/src/mm/asid.c
 endif
 
 ifeq ($(CONFIG_ASID_FIFO),y)
-	GENARCH_SOURCES += \
-		genarch/src/mm/asid_fifo.c
+GENARCH_SOURCES += \
+	genarch/src/mm/asid_fifo.c
 endif
 
 ifeq ($(CONFIG_SOFTINT),y)
-	GENARCH_SOURCES += \
-		genarch/src/softint/division.c \
-		genarch/src/softint/multiplication.c
+GENARCH_SOURCES += \
+	genarch/src/softint/division.c \
+	genarch/src/softint/multiplication.c
 endif
 
 ifeq ($(CONFIG_FB),y)
-	GENARCH_SOURCES += \
-		genarch/src/fb/font-8x16.c \
-		genarch/src/fb/fb.c \
-		genarch/src/fb/bfb.c
+GENARCH_SOURCES += \
+	genarch/src/fb/font-8x16.c \
+	genarch/src/fb/fb.c \
+	genarch/src/fb/bfb.c
 endif
 
 ifeq ($(CONFIG_DSRLNIN),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/dsrln/dsrlnin.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/dsrln/dsrlnin.c
 endif
 
 ifeq ($(CONFIG_DSRLNOUT),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/dsrln/dsrlnout.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/dsrln/dsrlnout.c
 endif
 
 ifeq ($(CONFIG_I8042),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/i8042/i8042.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/i8042/i8042.c
 endif
 
 ifeq ($(CONFIG_NS16550),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/ns16550/ns16550.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/ns16550/ns16550.c
 endif
 
 ifeq ($(CONFIG_PL011_UART),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/pl011/pl011.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/pl011/pl011.c
 endif
 
 ifeq ($(CONFIG_S3C24XX_IRQC),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/s3c24xx/irqc.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/s3c24xx/irqc.c
 endif
 
 ifeq ($(CONFIG_S3C24XX_UART),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/s3c24xx/uart.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/s3c24xx/uart.c
 endif
 
 ifeq ($(CONFIG_OMAP_UART),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/omap/uart.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/omap/uart.c
 endif
 
 ifeq ($(CONFIG_GRLIB_UART),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/grlib/uart.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/grlib/uart.c
 endif
 
 ifeq ($(CONFIG_GRLIB_IRQMP),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/grlib/irqmp.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/grlib/irqmp.c
 endif
 
 ifeq ($(CONFIG_AM335X_TIMERS),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/am335x/timer.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/am335x/timer.c
 endif
 
 ifeq ($(CONFIG_BCM2835_MAILBOX),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/bcm2835/mbox.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/bcm2835/mbox.c
 endif
 
 ifeq ($(CONFIG_VIA_CUDA),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/via-cuda/cuda.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/via-cuda/cuda.c
 endif
 
 ifeq ($(CONFIG_PC_KBD),y)
-	GENARCH_SOURCES += \
-		genarch/src/kbrd/kbrd.c \
-		genarch/src/kbrd/scanc_pc.c
+GENARCH_SOURCES += \
+	genarch/src/kbrd/kbrd.c \
+	genarch/src/kbrd/scanc_pc.c
 endif
 
 ifeq ($(CONFIG_SUN_KBD),y)
-	GENARCH_SOURCES += \
-		genarch/src/kbrd/kbrd.c \
-		genarch/src/kbrd/scanc_sun.c
+GENARCH_SOURCES += \
+	genarch/src/kbrd/kbrd.c \
+	genarch/src/kbrd/scanc_sun.c
 endif
 
 ifeq ($(CONFIG_MAC_KBD),y)
-	GENARCH_SOURCES += \
-		genarch/src/kbrd/kbrd.c \
-		genarch/src/kbrd/scanc_mac.c
+GENARCH_SOURCES += \
+	genarch/src/kbrd/kbrd.c \
+	genarch/src/kbrd/scanc_mac.c
 endif
 
 ifeq ($(CONFIG_SRLN),y)
-	GENARCH_SOURCES += \
-		genarch/src/srln/srln.c
+GENARCH_SOURCES += \
+	genarch/src/srln/srln.c
 endif
 
 ifeq ($(CONFIG_OFW_TREE),y)
-	GENARCH_SOURCES += \
-		genarch/src/ofw/ofw_tree.c
+GENARCH_SOURCES += \
+	genarch/src/ofw/ofw_tree.c
 endif
 
 ifeq ($(CONFIG_OFW_PCI),y)
-	GENARCH_SOURCES += \
-		genarch/src/ofw/ebus.c \
-		genarch/src/ofw/pci.c  \
-		genarch/src/ofw/sbus.c \
-		genarch/src/ofw/upa.c
+GENARCH_SOURCES += \
+	genarch/src/ofw/ebus.c \
+	genarch/src/ofw/pci.c  \
+	genarch/src/ofw/sbus.c \
+	genarch/src/ofw/upa.c
 endif
 
 ifeq ($(CONFIG_MULTIBOOT), y)
-	GENARCH_SOURCES += \
-		genarch/src/multiboot/multiboot.c \
-		genarch/src/multiboot/multiboot2.c
+GENARCH_SOURCES += \
+	genarch/src/multiboot/multiboot.c \
+	genarch/src/multiboot/multiboot2.c
+GENARCH_AUTOGENS_AG += \
+	genarch/include/genarch/multiboot/multiboot_memmap_struct.ag \
+	genarch/include/genarch/multiboot/multiboot_info_struct.ag 
+
+#
+# Currently there is no automated way to describe dependencies between two autogenerated headers,
+# so we need to do it manually
+genarch/include/genarch/multiboot/multiboot_memmap_struct.h: arch/$(KARCH)/include/arch/boot/memmap_struct.h
+
 endif
 
 ifeq ($(CONFIG_EGA), y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/ega/ega.c
+GENARCH_SOURCES += \
+	genarch/src/drivers/ega/ega.c
 endif
 
 ifeq ($(CONFIG_IOMAP_BITMAP), y)
-	GENARCH_SOURCES += \
-		genarch/src/ddi/ddi-bitmap.c
+GENARCH_SOURCES += \
+	genarch/src/ddi/ddi-bitmap.c
 endif
 
 ifeq ($(CONFIG_IOMAP_DUMMY), y)
-	GENARCH_SOURCES += \
-		genarch/src/ddi/ddi-dummy.c
-endif
-
+GENARCH_SOURCES += \
+	genarch/src/ddi/ddi-dummy.c
+endif
+
Index: kernel/genarch/include/genarch/multiboot/multiboot.h
===================================================================
--- kernel/genarch/include/genarch/multiboot/multiboot.h	(revision 0637ddb37d7e3d5dd0479648840f57e5a3cce14a)
+++ kernel/genarch/include/genarch/multiboot/multiboot.h	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -36,8 +36,19 @@
 #define KERN_MULTIBOOT_H_
 
+#include <genarch/multiboot/multiboot_memmap_struct.h>
+#include <genarch/multiboot/multiboot_info_struct.h>
+
 #define MULTIBOOT_HEADER_MAGIC  0x1badb002
 #define MULTIBOOT_HEADER_FLAGS  0x00010003
 
 #define MULTIBOOT_LOADER_MAGIC  0x2badb002
+
+#define MULTIBOOT_INFO_FLAGS_MEM	0x01
+#define MULTIBOOT_INFO_FLAGS_BOOT	0x02
+#define MULTIBOOT_INFO_FLAGS_CMDLINE	0x04
+#define MULTIBOOT_INFO_FLAGS_MODS	0x08
+#define MULTIBOOT_INFO_FLAGS_SYMS1	0x10
+#define MULTIBOOT_INFO_FLAGS_SYMS2	0x20
+#define MULTIBOOT_INFO_FLAGS_MMAP	0x40
 
 #ifndef __ASM__
@@ -60,42 +71,4 @@
 } __attribute__((packed)) multiboot_module_t;
 
-/** Multiboot mmap structure */
-typedef struct {
-	uint32_t size;
-	e820memmap_t mm_info;
-} __attribute__((packed)) multiboot_memmap_t;
-
-/** Multiboot information structure */
-typedef struct {
-	uint32_t flags;
-	uint32_t mem_lower;
-	uint32_t mem_upper;
-	
-	uint32_t boot_device;
-	uint32_t cmdline;
-	
-	uint32_t mods_count;
-	mbaddr_t mods_addr;
-	
-	uint32_t syms[4];
-	
-	uint32_t mmap_length;
-	mbaddr_t mmap_addr;
-	
-	/* ... */
-} __attribute__((packed)) multiboot_info_t;
-
-enum multiboot_info_flags {
-	MULTIBOOT_INFO_FLAGS_MEM     = 0x01,
-	MULTIBOOT_INFO_FLAGS_BOOT    = 0x02,
-	MULTIBOOT_INFO_FLAGS_CMDLINE = 0x04,
-	MULTIBOOT_INFO_FLAGS_MODS    = 0x08,
-	MULTIBOOT_INFO_FLAGS_SYMS1   = 0x10,
-	MULTIBOOT_INFO_FLAGS_SYMS2   = 0x20,
-	MULTIBOOT_INFO_FLAGS_MMAP    = 0x40
-	
-	/* ... */
-};
-
 extern void multiboot_extract_command(char *, size_t, const char *);
 extern void multiboot_extract_argument(char *, size_t, const char *);
Index: kernel/genarch/include/genarch/multiboot/multiboot_info_struct.ag
===================================================================
--- kernel/genarch/include/genarch/multiboot/multiboot_info_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
+++ kernel/genarch/include/genarch/multiboot/multiboot_info_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -0,0 +1,81 @@
+# Copyright (c) 2016 Jakub Jermar 
+# 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.
+#
+
+{
+        name : multiboot_info,
+        packed : true,
+
+        includes : [
+                {
+                        include : <typedefs.h>
+                },
+        ],
+
+        members : [
+                {
+                        name : flags,
+                        type : uint32_t
+                },
+                {
+                        name : mem_lower,
+                        type : uint32_t
+                },
+                {
+                        name : mem_upper,
+                        type : uint32_t
+                },
+                {
+                        name : boot_device,
+                        type : uint32_t
+                },
+                {
+                        name : cmd_line,
+                        type : uint32_t
+                },
+                {
+                        name : mods_count,
+                        type : uint32_t
+                },
+                {
+                        name : mods_addr,
+                        type : uint32_t
+                },
+                {
+                        name : syms,
+                        type : uint32_t,
+                        elements : 4,
+                },
+                {
+                        name : mmap_length,
+                        type : uint32_t,
+                },
+                {
+                        name : mmap_addr,
+                        type : uint32_t,
+                }
+        ]
+}
Index: kernel/genarch/include/genarch/multiboot/multiboot_memmap_struct.ag
===================================================================
--- kernel/genarch/include/genarch/multiboot/multiboot_memmap_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
+++ kernel/genarch/include/genarch/multiboot/multiboot_memmap_struct.ag	(revision 7ba16eb2305f77c05ab9260d09fae55d5c25fa4f)
@@ -0,0 +1,51 @@
+# Copyright (c) 2016 Jakub Jermar 
+# 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.
+#
+
+{
+        name : multiboot_memmap,
+        packed : true,
+
+        includes : [
+                {
+                        include : <typedefs.h>
+                },
+                {
+                        include : <arch/boot/memmap_struct.h>
+                }
+        ],
+
+        members : [
+                {
+                        name : size,
+                        type : uint32_t
+                },
+                {
+                        name : mm_info,
+                        type : e820memmap_t
+                }
+        ]
+}
