Index: arch/amd64/Makefile.inc
===================================================================
--- arch/amd64/Makefile.inc	(revision 2f08a55d1a22c7eb9b7ef8e5958444279c506fc7)
+++ arch/amd64/Makefile.inc	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
@@ -6,6 +6,7 @@
 AS=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-as
 LD=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-ld
-
-
+OBJCOPY=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-objcopy
+BFD_NAME=elf64-x86-64
+BFD_ARCH=i386:x86-64
 
 DEFS=-DARCH=$(ARCH)
@@ -47,3 +48,12 @@
 	arch/cpu/cpu.c \
 	arch/proc/scheduler.c \
-	arch/userspace.c
+	arch/userspace.c \
+	arch/acpi/acpi.c \
+	arch/acpi/madt.c
+
+ifdef SMP
+arch_sources += arch/smp/apic.c \
+		arch/smp/ipi.c \
+		arch/smp/mps.c \
+		arch/smp/smp.c
+endif
Index: arch/amd64/_link.ld
===================================================================
--- arch/amd64/_link.ld	(revision 2f08a55d1a22c7eb9b7ef8e5958444279c506fc7)
+++ arch/amd64/_link.ld	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
@@ -32,5 +32,4 @@
 		*(.data);		/* initialized data */
 		*(.rodata*);		/* string literals */
-		*(COMMON);		/* global variables */
 		hardcoded_load_address = .;
 		QUAD(0xffffffff80008000);
@@ -39,7 +38,15 @@
 		hardcoded_kdata_size = .;
 		QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
+		*(COMMON);		/* global variables */
+
+
+
 		*(.eh_frame);
 		*(.bss);		/* uninitialized static variables */
 		*(K_DATA_END);
+
+		symbol_table = .;
+		*(symtab.*);            /* Symbol table, must be LAST symbol!*/
+
 		kdata_end = .;
 	}
Index: arch/amd64/include/asm.h
===================================================================
--- arch/amd64/include/asm.h	(revision 2f08a55d1a22c7eb9b7ef8e5958444279c506fc7)
+++ arch/amd64/include/asm.h	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
@@ -166,4 +166,22 @@
 
 
+/** Enable local APIC
+ *
+ * Enable local APIC in MSR.
+ */
+static inline void enable_l_apic_in_msr()
+{
+	__asm__ volatile (
+		"movl $0x1b, %%ecx;"
+		"rdmsr;"
+		"orl $(1<<11),%%eax;"
+		"orl $(0xfee00000),%%eax;"
+		"wrmsr;"
+		:
+		:
+		:"%eax","%ecx","%edx"
+		);
+}
+
 extern size_t interrupt_handler_size;
 extern void interrupt_handlers(void);
Index: arch/amd64/include/boot/boot.h
===================================================================
--- arch/amd64/include/boot/boot.h	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
+++ arch/amd64/include/boot/boot.h	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2005 Ondrej Palkovsky
+ * 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 __amd64_BOOT_H__
+#define __amd64_BOOT_H__
+
+#define BOOTSTRAP_OFFSET			0x8000
+#define BOOT_OFFSET				0x0
+
+#define MULTIBOOT_HEADER_MAGIC		0x1BADB002
+#define MULTIBOOT_HEADER_FLAGS		0x00010003
+
+#endif
Index: arch/amd64/src/dummy.s
===================================================================
--- arch/amd64/src/dummy.s	(revision 2f08a55d1a22c7eb9b7ef8e5958444279c506fc7)
+++ arch/amd64/src/dummy.s	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
@@ -29,4 +29,6 @@
 .text
 
-0:
+.global ap_boot
+	
+ap_boot:	
 	ret
Index: arch/amd64/src/interrupt.c
===================================================================
--- arch/amd64/src/interrupt.c	(revision 2f08a55d1a22c7eb9b7ef8e5958444279c506fc7)
+++ arch/amd64/src/interrupt.c	(revision ab08b4244b9dfd556f4d25b75dd22cb1192d66b9)
@@ -37,4 +37,22 @@
 #include <mm/tlb.h>
 #include <arch.h>
+#include <symtab.h>
+
+#define PRINT_INFO_ERRCODE(x) { \
+	char *symbol = get_symtab_entry(stack[1]); \
+	if (!symbol) \
+		symbol = ""; \
+	printf("----------------EXCEPTION OCCURED----------------\n"); \
+	printf("%%rip: %Q (%s)\n",x[1],symbol); \
+	printf("ERROR_WORD=%Q\n", x[0]); \
+	printf("%%rcs=%Q,flags=%Q\n", x[2], x[3]); \
+	printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",x[-1],x[-2],x[-3]); \
+	printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",x[-4],x[-5],x[-6]); \
+	printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",x[-7],x[-8],x[-9]); \
+	printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",x[-10],x[-11],x[-12]); \
+	printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",x[-13],x[-14],x); \
+	printf("stack: %Q, %Q, %Q\n", x[5], x[6], x[7]); \
+	printf("       %Q, %Q, %Q\n", x[8], x[9], x[10]); \
+        }
 
 /*
@@ -73,4 +91,5 @@
 void null_interrupt(__u8 n, __native stack[])
 {
+	printf("----------------EXCEPTION OCCURED----------------\n");
 	printf("int %d: null_interrupt\n", n);
 	printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]);
@@ -80,7 +99,5 @@
 void gp_fault(__u8 n, __native stack[])
 {
-	printf("ERROR_WORD=%X, %%eip=%X, %%cs=%X, flags=%X\n", stack[0], stack[1], stack[2], stack[3]);
-	printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack);
-	printf("stack: %X, %X, %X, %X\n", stack[4], stack[5], stack[6], stack[7]);
+	PRINT_INFO_ERRCODE(stack);
 	panic("general protection fault\n");
 }
@@ -88,7 +105,5 @@
 void ss_fault(__u8 n, __native stack[])
 {
-	printf("ERROR_WORD=%X, %%eip=%X, %%cs=%X, flags=%X\n", stack[0], stack[1], stack[2], stack[3]);
-	printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack);
-	printf("stack: %X, %X, %X, %X\n", stack[4], stack[5], stack[6], stack[7]);
+	PRINT_INFO_ERRCODE(stack);
 	panic("stack fault\n");
 }
@@ -111,10 +126,6 @@
 void page_fault(__u8 n, __native stack[])
 {
-	printf("page fault address: %Q\n", read_cr2());
-	printf("ERROR_WORD=%Q, %%rip=%Q, %%rcs=%Q, flags=%Q\n", stack[0], stack[1], stack[2], stack[3]);
-	printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q, %%rdx=%Q,\n%%rsi=%Q, %%rdi=%Q\n",
-	       stack[-1], stack[-2], stack[-3], stack[-4], stack[-5], stack[-6]);
-
-	printf("stack: %X, %X, %X, %X\n", stack[5], stack[6], stack[7], stack[8]);
+	PRINT_INFO_ERRCODE(stack);
+	printf("Page fault address: %Q\n", read_cr2());
 	panic("page fault\n");
 }
