Index: boot/arch/ia64/include/types.h
===================================================================
--- boot/arch/ia64/include/types.h	(revision 547c37ae7e3f52e08f673a6110a86f8cdbac84ac)
+++ boot/arch/ia64/include/types.h	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
@@ -30,7 +30,9 @@
 #define BOOT_ia64_TYPES_H_
 
+#include <arch/common.h>
+
 #define TASKMAP_MAX_RECORDS		32
 #define BOOTINFO_TASK_NAME_BUFLEN	32
-#define MEMMAP_ITEMS			128	
+#define MEMMAP_ITEMS			128
 
 typedef uint64_t size_t;
@@ -53,10 +55,10 @@
 	unsigned long base;
 	unsigned long size;
-} efi_memmap_item_t;
+} memmap_item_t;
 
 typedef struct {
 	binit_t taskmap;
 
-	efi_memmap_item_t memmap[MEMMAP_ITEMS];
+	memmap_item_t memmap[MEMMAP_ITEMS];
 	unsigned int memmap_items;
 
@@ -65,6 +67,14 @@
 	unsigned long freq_scale;
 	unsigned int wakeup_intno;
-	int hello_configured;
 } bootinfo_t;
 
+/** This is a minimal ELILO-compatible boot parameter structure. */
+typedef struct {
+	uint64_t cmd_line;
+	uint64_t efi_system_table;
+	uint64_t efi_memmap;
+	uint64_t efi_memmap_sz;
+	uint64_t efi_memdesc_sz;
+} boot_param_t;
+
 #endif
Index: boot/arch/ia64/src/boot.S
===================================================================
--- boot/arch/ia64/src/boot.S	(revision 547c37ae7e3f52e08f673a6110a86f8cdbac84ac)
+++ boot/arch/ia64/src/boot.S	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
@@ -37,4 +37,11 @@
 
 	#
+	# Save the boot parameter structure address passed from the
+	# ELILO-compatible EFI loader.
+	#
+	movl r8 = bootpar ;;
+	st8 [r8] = r28
+
+	#
 	# Initialize the register stack to some sane value.
 	#
@@ -62,4 +69,8 @@
 .bss
 
+.global bootpar
+bootpar:
+	.quad 0
+
 .align STACK_SIZE
 initial_stack:
Index: boot/arch/ia64/src/main.c
===================================================================
--- boot/arch/ia64/src/main.c	(revision 547c37ae7e3f52e08f673a6110a86f8cdbac84ac)
+++ boot/arch/ia64/src/main.c	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
@@ -30,7 +30,9 @@
 
 #include <arch/main.h>
+#include <arch/types.h>
 #include <arch/arch.h>
 #include <arch/asm.h>
 #include <arch/_components.h>
+#include <genarch/efi.h>
 #include <halt.h>
 #include <printf.h>
@@ -51,9 +53,80 @@
 #define DEFAULT_SYS_FREQ		100000000ULL		/* 100MHz */
 
-#define EFI_MEMMAP_FREE_MEM		0
-#define EFI_MEMMAP_IO			1
-#define EFI_MEMMAP_IO_PORTS		2
+#define MEMMAP_FREE_MEM		0
+#define MEMMAP_IO		1
+#define MEMMAP_IO_PORTS		2
+
+extern boot_param_t *bootpar;
 
 static bootinfo_t bootinfo;
+
+static void read_efi_memmap(void)
+{
+	memmap_item_t *memmap = bootinfo.memmap;
+	size_t items = 0;
+	
+	if (!bootpar) {
+		/* Fake-up a memory map for simulators. */
+		memmap[items].base = DEFAULT_MEMORY_BASE;
+		memmap[items].size = DEFAULT_MEMORY_SIZE;
+		memmap[items].type = MEMMAP_FREE_MEM;
+		items++;
+
+		memmap[items].base = DEFAULT_LEGACY_IO_BASE;
+		memmap[items].size = DEFAULT_LEGACY_IO_SIZE;
+		memmap[items].type = MEMMAP_IO_PORTS;
+		items++;		 
+	} else {
+		char *cur, *mm_base = (char *) bootpar->efi_memmap;
+		size_t mm_size = bootpar->efi_memmap_sz;
+		size_t md_size = bootpar->efi_memdesc_sz;
+		
+		/*
+		 * Walk the EFI memory map using the V1 memory descriptor
+		 * format. The actual memory descriptor can use newer format,
+		 * but it must always be backwards compatible with the V1
+		 * format.
+		 */
+		for (cur = mm_base;
+		    (cur < mm_base + (mm_size - md_size)) &&
+		    (items < MEMMAP_ITEMS);
+		    cur += md_size) {
+			efi_v1_memdesc_t *md = (efi_v1_memdesc_t *) cur;
+
+			switch ((efi_memory_type_t) md->type) {
+			case EFI_CONVENTIONAL_MEMORY:
+				memmap[items].type = MEMMAP_FREE_MEM;
+				break;
+			case EFI_MEMORY_MAPPED_IO:
+				memmap[items].type = MEMMAP_IO;
+				break;
+			case EFI_MEMORY_MAPPED_IO_PORT_SPACE:
+				memmap[items].type = MEMMAP_IO_PORTS;
+				break;
+			default:
+				continue;
+			}
+			
+			memmap[items].base = md->phys_start;
+			memmap[items].size = md->pages * EFI_PAGE_SIZE;
+			items++;
+		}
+	}
+	
+	bootinfo.memmap_items = items;
+}
+
+static void read_sal_configuration(void)
+{
+	if (!bootpar) {
+		/* Configure default values for simulators. */
+		bootinfo.freq_scale = DEFAULT_FREQ_SCALE;
+		bootinfo.sys_freq = DEFAULT_SYS_FREQ;
+	} else {
+		/* TODO: read the real values from SAL */
+		bootinfo.freq_scale = DEFAULT_FREQ_SCALE;
+		bootinfo.sys_freq = DEFAULT_SYS_FREQ;
+	}
+}
 
 void bootstrap(void)
@@ -113,31 +186,7 @@
 	
 	printf(".\n");
-	
-	if (!bootinfo.hello_configured) {	/* XXX */
-		/*
-		 * Load configuration defaults for simulators.
-		 */
-		 bootinfo.memmap_items = 0;
-		 
-		 bootinfo.memmap[bootinfo.memmap_items].base =
-		     DEFAULT_MEMORY_BASE;
-		 bootinfo.memmap[bootinfo.memmap_items].size =
-		     DEFAULT_MEMORY_SIZE;
-		 bootinfo.memmap[bootinfo.memmap_items].type =
-		     EFI_MEMMAP_FREE_MEM;
-		 bootinfo.memmap_items++;
 
-		 bootinfo.memmap[bootinfo.memmap_items].base =
-		     DEFAULT_LEGACY_IO_BASE;
-		 bootinfo.memmap[bootinfo.memmap_items].size =
-		     DEFAULT_LEGACY_IO_SIZE;
-		 bootinfo.memmap[bootinfo.memmap_items].type =
-		     EFI_MEMMAP_IO_PORTS;
-		 bootinfo.memmap_items++;
-		 
-		 bootinfo.freq_scale = DEFAULT_FREQ_SCALE;
-		 bootinfo.sys_freq = DEFAULT_SYS_FREQ;
-	}
-	
+	read_efi_memmap();
+	read_sal_configuration();
 	
 	printf("Booting the kernel ...\n");
Index: boot/genarch/include/efi.h
===================================================================
--- boot/genarch/include/efi.h	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
+++ boot/genarch/include/efi.h	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011 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.
+ */
+
+#ifndef BOOT_EFI_H_
+#define BOOT_EFI_H_
+
+typedef enum {
+	EFI_RESERVED,
+	EFI_LOADER_CODE,
+	EFI_LOADER_DATA,
+	EFI_BOOT_SERVICES_CODE,
+	EFI_BOOT_SERVICES_DATA,
+	EFI_RUNTIME_SERVICES_CODE,
+	EFI_RUNTIME_SERVICES_DATA,
+	EFI_CONVENTIONAL_MEMORY,
+	EFI_UNUSABLE_MEMORY,
+	EFI_ACPI_RECLAIM_MEMORY,
+	EFI_ACPI_MEMORY_NVS,
+	EFI_MEMORY_MAPPED_IO,
+	EFI_MEMORY_MAPPED_IO_PORT_SPACE,
+	EFI_PAL_CODE
+} efi_memory_type_t;
+
+typedef struct {
+	uint32_t type;
+	uint64_t phys_start;
+	uint64_t virt_start;
+	uint64_t pages;
+	uint64_t attribute;
+} efi_v1_memdesc_t;
+
+#define EFI_PAGE_SIZE	4096
+
+#endif
Index: kernel/arch/ia64/include/bootinfo.h
===================================================================
--- kernel/arch/ia64/include/bootinfo.h	(revision 547c37ae7e3f52e08f673a6110a86f8cdbac84ac)
+++ kernel/arch/ia64/include/bootinfo.h	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
@@ -34,5 +34,5 @@
 #define MEMMAP_ITEMS 128
 
-#define EFI_MEMMAP_FREE_MEM 0
+#define MEMMAP_FREE_MEM 0
 
 /** Size of buffer for storing task name in binit_task_t. */
@@ -54,10 +54,10 @@
 	unsigned long base;
 	unsigned long size;
-} efi_memmap_item_t;
+} memmap_item_t;
 
 typedef struct {
 	binit_t taskmap;
 	
-	efi_memmap_item_t memmap[MEMMAP_ITEMS];
+	memmap_item_t memmap[MEMMAP_ITEMS];
 	unsigned int memmap_items;
 	
@@ -66,5 +66,4 @@
 	unsigned long freq_scale;
 	unsigned int wakeup_intno;
-	int hello_configured;
 } bootinfo_t;
 
Index: kernel/arch/ia64/src/mm/frame.c
===================================================================
--- kernel/arch/ia64/src/mm/frame.c	(revision 547c37ae7e3f52e08f673a6110a86f8cdbac84ac)
+++ kernel/arch/ia64/src/mm/frame.c	(revision bbe4828a2a07a9586dbf2f4b406cecb747e28b50)
@@ -58,5 +58,5 @@
 		unsigned int i;
 		for (i = 0; i < bootinfo->memmap_items; i++) {
-			if (bootinfo->memmap[i].type == EFI_MEMMAP_FREE_MEM) {
+			if (bootinfo->memmap[i].type == MEMMAP_FREE_MEM) {
 				uint64_t base = bootinfo->memmap[i].base;
 				uint64_t size = bootinfo->memmap[i].size;
