Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision fa024ce932aff7f238e5cabadb9fdd510c75fca9)
+++ HelenOS.config	(revision 98a4e76b4160ea2db9e82981125a143f0b747421)
@@ -1,4 +1,5 @@
 #
 # Copyright (c) 2006 Ondrej Palkovsky
+# Copyright (c) 2009 Martin Decky
 # All rights reserved.
 #
@@ -75,4 +76,132 @@
 
 
+## Mapping between platform and kernel architecture
+
+% Kernel architecture
+@ "amd64"
+! [PLATFORM=amd64] KARCH (choice)
+
+% Kernel architecture
+@ "arm32"
+! [PLATFORM=arm32] KARCH (choice)
+
+% Kernel architecture
+@ "ia32"
+! [PLATFORM=ia32] KARCH (choice)
+
+% Kernel architecture
+@ "ia32xen"
+! [PLATFORM=ia32xen] KARCH (choice)
+
+% Kernel architecture
+@ "ia64"
+! [PLATFORM=ia64] KARCH (choice)
+
+% Kernel architecture
+@ "mips32"
+! [PLATFORM=mips32] KARCH (choice)
+
+% Kernel architecture
+@ "ppc32"
+! [PLATFORM=ppc32] KARCH (choice)
+
+% Kernel architecture
+@ "ppc64"
+! [PLATFORM=ppc64] KARCH (choice)
+
+% Kernel architecture
+@ "sparc64"
+! [PLATFORM=sparc64] KARCH (choice)
+
+
+## Mapping between platform and user space architecture
+
+% User space architecture
+@ "amd64"
+! [PLATFORM=amd64] UARCH (choice)
+
+% User space architecture
+@ "arm32"
+! [PLATFORM=arm32] UARCH (choice)
+
+% User space architecture
+@ "ia32"
+! [PLATFORM=ia32|PLATFORM=ia32xen] UARCH (choice)
+
+% User space architecture
+@ "ia64"
+! [PLATFORM=ia64] UARCH (choice)
+
+% User space architecture
+@ "mips32"
+! [PLATFORM=mips32&(MACHINE=msim|MACHINE=simics|MACHINE=lgxemul)] UARCH (choice)
+
+% User space architecture
+@ "mips32eb"
+! [PLATFORM=mips32&(MACHINE=bgxemul)] UARCH (choice)
+
+% User space architecture
+@ "ppc32"
+! [PLATFORM=ppc32] UARCH (choice)
+
+% User space architecture
+@ "ppc64"
+! [PLATFORM=ppc64] UARCH (choice)
+
+% User space architecture
+@ "sparc64"
+! [PLATFORM=sparc64] UARCH (choice)
+
+
+## Mapping between platform and boot architecture
+
+% Boot architecture
+@ "amd64"
+! [PLATFORM=amd64] BARCH (choice)
+
+% Boot architecture
+@ "arm32"
+! [PLATFORM=arm32] BARCH (choice)
+
+% Boot architecture
+@ "ia32"
+! [PLATFORM=ia32] BARCH (choice)
+
+% Boot architecture
+@ "ia32xen"
+! [PLATFORM=ia32xen] BARCH (choice)
+
+% Boot architecture
+@ "ia64"
+! [PLATFORM=ia64] BARCH (choice)
+
+% Boot architecture
+@ "mips32"
+! [PLATFORM=mips32] BARCH (choice)
+
+% Boot architecture
+@ "ppc32"
+! [PLATFORM=ppc32] BARCH (choice)
+
+% Boot architecture
+@ "ppc64"
+! [PLATFORM=ppc64] BARCH (choice)
+
+% Boot architecture
+@ "sparc64"
+! [PLATFORM=sparc64] BARCH (choice)
+
+
+## Mapping between platform and image format
+
+% Image format
+@ "binary"
+! [PLATFORM=mips32&MACHINE=msim] IMAGE (choice)
+
+% Image format
+@ "ecoff"
+! [PLATFORM=mips32&(MACHINE=simics|MACHINE=bgxemul|MACHINE=lgxemul)] IMAGE (choice)
+
+
 ## Compiler options
 
@@ -108,11 +237,53 @@
 
 
+## Kernel configuration
+
+% Fences
+! [PLATFORM=ia32&(MACHINE=athlon-xp|MACHINE=athlon-mp|MACHINE=pentium3)] CONFIG_FENCES_P3 (y)
+
+% Fences
+! [(PLATFORM=ia32&(MACHINE=pentium4|MACHINE=core))|PLATFORM=amd64] CONFIG_FENCES_P4 (y)
+
+% ACPI support
+! [PLATFORM=ia32|PLATFORM=amd64] CONFIG_ACPI (y)
+
+% Hierarchical page tables support
+! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=arm32|PLATFORM=mips32|PLATFORM=ppc32] CONFIG_PAGE_PT (y)
+
+% Page hash table support
+! [PLATFORM=ia64|PLATFORM=sparc64] CONFIG_PAGE_HT (y)
+
+% i8042 controller support
+! [PLATFORM=ia32|PLATFORM=amd64|(PLATFORM=ia64&MACHINE=i460GX)] CONFIG_I8042 (y)
+
+% Sun keyboard support
+! [PLATFORM=sparc64] CONFIG_SUN_KBD (y)
+
+% EGA support
+! [PLATFORM=ia32|PLATFORM=amd64|(PLATFORM=ia64&MACHINE=i460GX)] CONFIG_EGA (y)
+
+% Software integer division support
+! [PLATFORM=ia32|PLATFORM=arm32|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32] CONFIG_SOFTINT (y)
+
+% ASID support
+! [PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_ASID (y)
+
+% ASID FIFO support
+! [PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_ASID_FIFO (y)
+
+% OpenFirmware tree support
+! [PLATFORM=sparc64] CONFIG_OFW_TREE (y)
+
+% FPU support
+! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=ia64|PLATFORM=sparc64|(PLATFORM=mips32&(MACHINE=lgxemul|MACHINE=bgxemul))] CONFIG_FPU (y)
+
+
 ## Kernel features options
 
 % Support for SMP
-! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=sparc64|PLATFORM=ia64] CONFIG_SMP (y/n)
+! [(PLATFORM=ia32&MACHINE!=athlon-xp)|PLATFORM=amd64|PLATFORM=sparc64|PLATFORM=ia64] CONFIG_SMP (y/n)
 
 % Improved support for hyperthreading
-! [(PLATFORM=ia32|PLATFORM=amd64)&CONFIG_SMP=y] CONFIG_HT (y/n)
+! [((PLATFORM=ia32&MACHINE!=athlon-xp&MACHINE!=athlon-mp&MACHINE!=pentium3)|PLATFORM=amd64)&CONFIG_SMP=y] CONFIG_HT (y/n)
 
 % Simics BIOS AP boot fix
@@ -120,5 +291,5 @@
 
 % Lazy FPU context switching
-! [(PLATFORM=mips32&MACHINE!=msim&MACHINE!=simics)|PLATFORM=amd64|PLATFORM=ia32|PLATFORM=ia64|PLATFORM=sparc64] CONFIG_FPU_LAZY (y/n)
+! [CONFIG_FPU=y] CONFIG_FPU_LAZY (y/n)
 
 % Use VHPT
@@ -134,16 +305,16 @@
 ! [PLATFORM=sparc64|(PLATFORM=ia64&MACHINE!=ski)] CONFIG_NS16550 (n/y)
 
+% IOSapic on default address support
+! [PLATFORM=ia64&MACHINE!=ski] CONFIG_IOSAPIC (y/n)
+
+% Interrupt-driven driver for Legacy Keyboard
+! [CONFIG_NS16550=n&CONFIG_IOSAPIC=y&MACHINE!=ski] CONFIG_I8042_INTERRUPT_DRIVEN (y/n)
+
+% Interrupt-driven driver for NS16550
+! [CONFIG_NS16550=y&((PLATFORM!=ia64)|CONFIG_IOSAPIC=y)&MACHINE!=ski] CONFIG_NS16550_INTERRUPT_DRIVEN (y/n)
+
 % Support for Serengeti console
 ! [PLATFORM=sparc64] CONFIG_SGCN (y/n)
 
-% IOSapic on default address support
-! [PLATFORM=ia64&MACHINE!=ski] CONFIG_IOSAPIC (y/n)
-
-% Interrupt-driven driver for Legacy Keyboard
-! [CONFIG_NS16550=n&CONFIG_IOSAPIC=y&MACHINE!=ski] CONFIG_I8042_INTERRUPT_DRIVEN (y/n)
-
-% Interrupt-driven driver for NS16550
-! [CONFIG_NS16550=y&((PLATFORM!=ia64)|CONFIG_IOSAPIC=y)&MACHINE!=ski] CONFIG_NS16550_INTERRUPT_DRIVEN (y/n)
-
 % Virtually indexed D-cache support
 ! [PLATFORM=sparc64] CONFIG_VIRT_IDX_DCACHE (y/n)
@@ -175,4 +346,7 @@
 % Framebuffer support
 ! [(PLATFORM=mips32&MACHINE=lgxemul)|(PLATFORM=mips32&MACHINE=bgxemul)|(PLATFORM=ia32)|(PLATFORM=amd64)|(PLATFORM=arm32)|(PLATFORM=sparc64&MACHINE=us3)] CONFIG_FB (y/n)
+
+% Framebuffer support
+! [PLATFORM=ppc32|(PLATFORM=sparc64&MACHINE=us)] CONFIG_FB (y)
 
 % Framebuffer width
Index: Makefile
===================================================================
--- Makefile	(revision fa024ce932aff7f238e5cabadb9fdd510c75fca9)
+++ Makefile	(revision 98a4e76b4160ea2db9e82981125a143f0b747421)
@@ -32,80 +32,4 @@
 -include Makefile.config
 
-## Setup platform configuration
-#
-
-ifeq ($(PLATFORM),amd64)
-	KARCH = amd64
-	UARCH = amd64
-	BARCH = amd64
-endif
-
-ifeq ($(PLATFORM),arm32)
-	KARCH = arm32
-	UARCH = arm32
-	BARCH = arm32
-endif
-
-ifeq ($(PLATFORM),ia32)
-	KARCH = ia32
-	UARCH = ia32
-	BARCH = ia32
-endif
-
-ifeq ($(PLATFORM),ia64)
-	KARCH = ia64
-	UARCH = ia64
-	BARCH = ia64
-endif
-
-ifeq ($(PLATFORM),mips32)
-	KARCH = mips32
-	BARCH = mips32
-	
-	ifeq ($(MACHINE),msim)
-		UARCH = mips32
-		IMAGE = binary
-	endif
-	
-	ifeq ($(MACHINE),simics)
-		UARCH = mips32
-		IMAGE = ecoff
-	endif
-	
-	ifeq ($(MACHINE),bgxemul)
-		UARCH = mips32eb
-		IMAGE = ecoff
-	endif
-	
-	ifeq ($(MACHINE),lgxemul)
-		UARCH = mips32
-		IMAGE = ecoff
-	endif
-endif
-
-ifeq ($(PLATFORM),ppc32)
-	KARCH = ppc32
-	UARCH = ppc32
-	BARCH = ppc32
-endif
-
-ifeq ($(PLATFORM),ppc64)
-	KARCH = ppc64
-	UARCH = ppc64
-	BARCH = ppc64
-endif
-
-ifeq ($(PLATFORM),sparc64)
-	KARCH = sparc64
-	UARCH = sparc64
-	BARCH = sparc64
-endif
-
-ifeq ($(PLATFORM),ia32xen)
-	KARCH = ia32xen
-	UARCH = ia32
-	BARCH = ia32xen
-endif
-
 .PHONY: all build config distclean clean cscope
 
@@ -114,8 +38,8 @@
 	$(MAKE) -C . build
 
-build: Makefile.config
-	$(MAKE) -C kernel ARCH=$(KARCH)
-	$(MAKE) -C uspace ARCH=$(UARCH)
-	$(MAKE) -C boot ARCH=$(BARCH) IMAGE=$(IMAGE)
+build: Makefile.config config.h config.defs
+	$(MAKE) -C kernel
+	$(MAKE) -C uspace
+	$(MAKE) -C boot
 
 config: HelenOS.config
@@ -123,10 +47,10 @@
 
 distclean: clean
-	rm -f Makefile.config tools/*.pyc
+	rm -f Makefile.config config.h config.defs tools/*.pyc
 
 clean:
-	-$(MAKE) -C kernel clean ARCH=$(KARCH)
-	-$(MAKE) -C uspace clean ARCH=$(UARCH)
-	-$(MAKE) -C boot clean ARCH=$(BARCH) IMAGE=$(IMAGE)
+	-$(MAKE) -C kernel clean
+	-$(MAKE) -C uspace clean
+	-$(MAKE) -C boot clean
 
 cscope:
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision fa024ce932aff7f238e5cabadb9fdd510c75fca9)
+++ kernel/Makefile	(revision 98a4e76b4160ea2db9e82981125a143f0b747421)
@@ -33,19 +33,23 @@
 include ../version
 -include ../Makefile.config
+-include ../config.defs
 
 INCLUDES = generic/include
 OPTIMIZATION = 3
 
+ifndef CROSS_PREFIX
+	CROSS_PREFIX = /usr/local
+endif
+
 ## Common compiler flags
 #
 
-DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" \
-	-DKERNEL
-
-GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \
+DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
+
+GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
 	-fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \
 	-nostdlib -nostdinc -pipe
 
-ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \
+ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
 	-fno-builtin -Wall -Wmissing-prototypes -Werror \
 	-nostdlib -nostdinc \
@@ -59,13 +63,5 @@
 AFLAGS =
 
-ifdef REVISION
-	DEFS += "-DREVISION=\"$(REVISION)\""
-endif
-
-ifdef TIMESTAMP
-	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
-endif
-
--include arch/$(ARCH)/Makefile.inc
+-include arch/$(KARCH)/Makefile.inc
 -include genarch/Makefile.inc
 
@@ -84,90 +80,4 @@
 #
 SYMTAB_SECTION=".section symtab.data, \"a\", $(ATSIGN)progbits;"
-
-## Setup kernel configuration
-#
-ifeq ($(CONFIG_DEBUG),y)
-	DEFS += -DCONFIG_DEBUG
-endif
-
-ifeq ($(CONFIG_LOG),y)
-	DEFS += -DCONFIG_LOG
-endif
-
-ifeq ($(CONFIG_KCONSOLE),y)
-	DEFS += -DCONFIG_KCONSOLE
-endif
-
-ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
-	DEFS += -DCONFIG_DEBUG_SPINLOCK
-endif
-
-ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y)
-	DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT
-endif
-
-ifeq ($(CONFIG_FPU_LAZY),y)
-	DEFS += -DCONFIG_FPU_LAZY
-endif
-
-ifeq ($(CONFIG_DEBUG_ALLREGS),y)
-	DEFS += -DCONFIG_DEBUG_ALLREGS
-endif
-
-ifeq ($(CONFIG_VHPT),y)
-	DEFS += -DCONFIG_VHPT
-endif
-
-ifeq ($(CONFIG_TSB),y)
-	DEFS += -DCONFIG_TSB
-endif
-
-ifeq ($(CONFIG_Z8530),y)
-	DEFS += -DCONFIG_Z8530
-endif
-
-ifeq ($(CONFIG_NS16550),y)
-	DEFS += -DCONFIG_NS16550
-endif
-
-ifeq ($(CONFIG_I8042_INTERRUPT_DRIVEN),y)
-	DEFS += -DCONFIG_I8042_INTERRUPT_DRIVEN
-endif
-
-ifeq ($(CONFIG_NS16550_INTERRUPT_DRIVEN),y)
-	DEFS += -DCONFIG_NS16550_INTERRUPT_DRIVEN
-endif
-
-ifeq ($(CONFIG_IOSAPIC),y)
-	DEFS += -DCONFIG_IOSAPIC
-endif
-
-ifeq ($(CONFIG_VIRT_IDX_DCACHE),y)
-	DEFS += -DCONFIG_VIRT_IDX_DCACHE
-endif
-
-ifeq ($(CONFIG_FB),y)
-	ifeq ($(ARCH),ia32)
-		DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)
-		DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)
-		DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)
-	endif
-	
-	ifeq ($(ARCH),amd64)
-		DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)
-		DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)
-		DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)
-	endif
-	
-	ifeq ($(ARCH),ia32xen)
-		DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)
-		DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)
-		DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)
-	endif
-endif
-
-ifeq ($(CONFIG_UDEBUG),y)
-	DEFS += -DCONFIG_UDEBUG
-endif
 
 ## Simple detection for the type of the host system
@@ -195,4 +105,5 @@
 	LIBDIR = /usr/lib
 	CFLAGS = $(GCC_CFLAGS)
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
 
@@ -206,4 +117,5 @@
 	LIBDIR = /usr/lib
 	CFLAGS = $(ICC_CFLAGS)
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
 
@@ -217,4 +129,6 @@
 	LIBDIR = /usr/lib
 	CFLAGS = $(SUNCC_CFLAGS)
+	DEFS += $(CONFIG_DEFS)
+	DEPEND_DEFS = $(DEFS)
 endif
 
@@ -228,4 +142,5 @@
 	LIBDIR = $(TOOLCHAIN_DIR)/lib
 	CFLAGS = $(GCC_CFLAGS)
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
 
@@ -326,5 +241,4 @@
 
 ifeq ($(CONFIG_TEST),y)
-	DEFS += -DCONFIG_TEST
 	CFLAGS += -Itest/
 	GENERIC_SOURCES += \
@@ -335,7 +249,4 @@
 		test/debug/mips1.c \
 		test/fault/fault1.c \
-		test/fpu/fpu1.c \
-		test/fpu/sse1.c \
-		test/fpu/mips2.c \
 		test/mm/falloc1.c \
 		test/mm/falloc2.c \
@@ -354,4 +265,43 @@
 		test/thread/thread1.c \
 		test/sysinfo/sysinfo1.c
+	
+	ifeq ($(CONFIG_FPU),y)
+		ifeq ($(KARCH),ia32)
+			TEST_FPU1 = y
+			TEST_SSE1 = y
+		endif
+		
+		ifeq ($(KARCH),amd64)
+			TEST_FPU1 = y
+			TEST_SSE1 = y
+		endif
+		
+		ifeq ($(KARCH),ia64)
+			TEST_FPU1 = y
+		endif
+		
+		ifeq ($(KARCH),mips32)
+			TEST_MIPS2 = y
+		endif
+	endif
+	
+	ifeq ($(TEST_FPU1),y)
+		GENERIC_SOURCES += test/fpu/fpu1.c
+	else
+		GENERIC_SOURCES += test/fpu/fpu1_skip.c
+	endif
+	
+	ifeq ($(TEST_SSE1),y)
+		GENERIC_SOURCES += test/fpu/sse1.c
+	else
+		GENERIC_SOURCES += test/fpu/sse1_skip.c
+	endif
+	
+	ifeq ($(TEST_MIPS2),y)
+		GENERIC_SOURCES += test/fpu/mips2.c
+	else
+		GENERIC_SOURCES += test/fpu/mips2_skip.c
+	endif
+	
 endif
 
@@ -362,5 +312,5 @@
 .PHONY: all build clean archlinks depend disasm
 
-all: ../Makefile.config
+all: ../Makefile.config ../config.h ../config.defs
 	-rm Makefile.depend
 	$(MAKE) -C . build
@@ -371,5 +321,5 @@
 
 clean:
-	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
+	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(KARCH)/_link.ld
 	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
 	for arch in arch/* ; do \
@@ -378,16 +328,16 @@
 
 archlinks:
-	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
+	ln -sfn ../../arch/$(KARCH)/include/ generic/include/arch
 	ln -sfn ../../genarch/include/ generic/include/genarch
 
 depend: archlinks
-	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
-
-arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
+	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
+
+arch/$(KARCH)/_link.ld: arch/$(KARCH)/_link.ld.in
 	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
 
-generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
+generic/src/debug/real_map.bin: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
 	echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o generic/src/debug/empty_map.o
-	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o  -o $@ -Map kernel.map.pre
+	$(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o  -o $@ -Map kernel.map.pre
 	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
 	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
@@ -395,5 +345,5 @@
 	# on architectures, that have bss after symtab
 	echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o generic/src/debug/sizeok_map.o
-	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre
+	$(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre
 	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
 	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
@@ -402,6 +352,6 @@
 	echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 
 
-kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
-	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
+kernel.raw: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
+	$(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
 
 kernel.bin: kernel.raw
Index: version
===================================================================
--- version	(revision fa024ce932aff7f238e5cabadb9fdd510c75fca9)
+++ version	(revision 98a4e76b4160ea2db9e82981125a143f0b747421)
@@ -1,7 +1,41 @@
+#
+# Copyright (c) 2006 Martin Decky
+# 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.
+#
+
+## This file defines the release information of HelenOS.
+#
+# The release string RELEASE consists of three or four components
+# (version, patch level, sublevel and optionally an extra level).
+#
+# The NAME string is the code name of the given release.
+#
+
 VERSION = 0
 PATCHLEVEL = 3
 SUBLEVEL = 0
-#EXTRAVERSION = 0
-NAME = Tartare
 
 ifdef EXTRAVERSION
@@ -10,2 +44,4 @@
 	RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)
 endif
+
+NAME = Tartare
