Index: boot/Makefile.build
===================================================================
--- boot/Makefile.build	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/Makefile.build	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -34,5 +34,5 @@
 OPTIMIZATION = 3
 
-DEFS = -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
+DEFS = -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
 
 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/Makefile.common	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -162,4 +162,5 @@
 	$(USPACE_PATH)/app/locinfo/locinfo \
 	$(USPACE_PATH)/app/mkfat/mkfat \
+	$(USPACE_PATH)/app/mkexfat/mkexfat \
 	$(USPACE_PATH)/app/mkmfs/mkmfs \
 	$(USPACE_PATH)/app/lsusb/lsusb \
Index: boot/arch/arm32/Makefile.inc
===================================================================
--- boot/arch/arm32/Makefile.inc	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/arch/arm32/Makefile.inc	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -39,4 +39,5 @@
 BITS = 32
 ENDIANESS = LE
+EXTRA_CFLAGS = -march=armv4
 
 RD_SRVS_ESSENTIAL += \
@@ -49,4 +50,5 @@
 SOURCES = \
 	arch/$(BARCH)/src/asm.S \
+	arch/$(BARCH)/src/eabi.S \
 	arch/$(BARCH)/src/main.c \
 	arch/$(BARCH)/src/mm.c \
Index: boot/arch/arm32/src/asm.S
===================================================================
--- boot/arch/arm32/src/asm.S	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/arch/arm32/src/asm.S	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -60,3 +60,3 @@
 	# before passing control to the copied code.
 	#
-	bx r0
+	mov pc, r0
Index: boot/arch/arm32/src/eabi.S
===================================================================
--- boot/arch/arm32/src/eabi.S	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
+++ boot/arch/arm32/src/eabi.S	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -0,0 +1,92 @@
+#
+# Copyright (c) 2012 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.
+#
+
+.text
+
+.global __aeabi_idiv
+.global __aeabi_uidiv
+
+.global __aeabi_idivmod
+.global __aeabi_uidivmod
+
+.global __aeabi_ldivmod
+.global __aeabi_uldivmod
+
+__aeabi_idiv:
+	push {lr}
+	bl __divsi3
+	pop {lr}
+	mov pc, lr
+
+__aeabi_uidiv:
+	push {lr}
+	bl __udivsi3
+	pop {lr}
+	mov pc, lr
+
+__aeabi_idivmod:
+	push {lr}
+	sub sp, sp, #12
+	add r2, sp, #4
+	bl __udivmodsi3
+	ldr r1, [sp, #4]
+	add sp, sp, #12
+	pop {lr}
+	mov pc, lr
+
+__aeabi_uidivmod:
+	push {lr}
+	sub sp, sp, #12
+	add r2, sp, #4
+	bl __udivmodsi3
+	ldr r1, [sp, #4]
+	add sp, sp, #12
+	pop {lr}
+	mov pc, lr
+
+__aeabi_ldivmod:
+	push {lr}
+	sub sp, sp, #24
+	push {sp}
+	bl __divmoddi3
+	add sp, sp, #4
+	pop {r2, r3}
+	add sp, sp, #16
+	pop {lr}
+	mov pc, lr
+
+__aeabi_uldivmod:
+	push {lr}
+	sub sp, sp, #24
+	push {sp}
+	bl __udivmoddi3
+	add sp, sp, #4
+	pop {r2, r3}
+	add sp, sp, #16
+	pop {lr}
+	mov pc, lr
Index: boot/arch/ia64/src/main.c
===================================================================
--- boot/arch/ia64/src/main.c	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/arch/ia64/src/main.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -189,8 +189,20 @@
 	printf("\nInflating components ... ");
 	
+	/*
+	 * We will use the next available address for a copy of each component to
+	 * make sure that inflate() works with disjunctive memory regions.
+	 */
+	top = ALIGN_UP(top, PAGE_SIZE);
+
 	for (i = cnt; i > 0; i--) {
 		printf("%s ", components[i - 1].name);
 		
-		int err = inflate(components[i - 1].start, components[i - 1].size,
+		/*
+		 * Copy the component to a location which is guaranteed not to
+		 * overlap with the destination for inflate().
+		 */
+		memmove((void *) top, components[i - 1].start, components[i - 1].size);
+		
+		int err = inflate((void *) top, components[i - 1].size,
 		    dest[i - 1], components[i - 1].inflated);
 		
Index: boot/arch/ia64/src/pal_asm.S
===================================================================
--- boot/arch/ia64/src/pal_asm.S	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/arch/ia64/src/pal_asm.S	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -32,11 +32,16 @@
 
 pal_static_call:
-	alloc loc0 = ar.pfs, 7, 5, 0, 0
+	alloc loc0 = ar.pfs, 7, 6, 0, 0
+
+	mov loc1 = psr ;;
+	mov psr.l = r0 ;;
+	srlz.i
+	srlz.d
 	
-	mov loc1 = gp
-	mov loc2 = rp
+	mov loc2 = gp
+	mov loc3 = rp
 	
-	addl loc3 = @gprel(pal_proc), gp
-	
+	addl loc4 = @gprel(pal_proc), gp
+
 	mov r28 = in0
 	mov r29 = in1
@@ -44,12 +49,16 @@
 	mov r31 = in3 ;;
 	
-	ld8 loc3 = [loc3]
-	movl loc4 = 0f ;;
+	ld8 loc4 = [loc4]
+	movl loc5 = 0f ;;
 
-	mov b6 = loc3
-	mov rp = loc4 ;;
+	mov b6 = loc4
+	mov rp = loc5 ;;
 	br.cond.sptk.many b6
 
 0:
+	mov psr.l = loc1 ;;
+	srlz.i
+	srlz.d
+
 	cmp.ne p7,p0 = 0, in4
 	cmp.ne p8,p0 = 0, in5
@@ -60,6 +69,6 @@
 (p9)	st8 [in6] = r11
 	
-	mov gp = loc1
-	mov rp = loc2 ;;
+	mov gp = loc2
+	mov rp = loc3 ;;
 	
 	mov ar.pfs = loc0
Index: boot/arch/ia64/src/sal_asm.S
===================================================================
--- boot/arch/ia64/src/sal_asm.S	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/arch/ia64/src/sal_asm.S	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -29,4 +29,9 @@
 .explicit
 
+#define STACK_SCRATCH_AREA	16
+#define STACK_IN8		(0 + STACK_SCRATCH_AREA)
+#define STACK_IN9		(8 + STACK_SCRATCH_AREA)
+#define STACK_IN10		(16 + STACK_SCRATCH_AREA)
+
 .global sal_call
 
@@ -39,6 +44,8 @@
 #
 sal_call:
-	alloc loc0 = ar.pfs, 11, 5, 8, 0
+	alloc loc0 = ar.pfs, 8, 8, 8, 0
 	
+	adds sp = -STACK_SCRATCH_AREA, sp
+
 	mov loc1 = gp
 	mov loc2 = rp
@@ -57,20 +64,31 @@
 	
 	ld8 loc3 = [loc3]
-	ld8 gp = [loc4] ;;
+	ld8 gp = [loc4]
+
+	adds r14 = STACK_IN8 + STACK_SCRATCH_AREA, sp
+	adds r15 = STACK_IN9 + STACK_SCRATCH_AREA, sp
+	adds r16 = STACK_IN10 + STACK_SCRATCH_AREA, sp ;;
+
+	ld8 loc5 = [r14]
+	ld8 loc6 = [r15]
+	ld8 loc7 = [r16]
 	
 	mov b6 = loc3 ;;
 	br.call.sptk.many rp = b6
 	
-	cmp.ne p7,p0 = 0, in8
-	cmp.ne p8,p0 = 0, in9
-	cmp.ne p9,p0 = 0, in10 ;;
+	cmp.ne p7,p0 = 0, loc5 
+	cmp.ne p8,p0 = 0, loc6 
+	cmp.ne p9,p0 = 0, loc7 ;;
 	
-(p7)	st8 [in8] = r9
-(p8)	st8 [in9] = r10
-(p9)	st8 [in10] = r11
+(p7)	st8 [loc5] = r9
+(p8)	st8 [loc6] = r10
+(p9)	st8 [loc7] = r11
 	
 	mov gp = loc1
-	mov rp = loc2 ;;
+	mov rp = loc2
+
+	adds sp = STACK_SCRATCH_AREA, sp ;;
 	
 	mov ar.pfs = loc0
 	br.ret.sptk.many rp
+
Index: boot/genarch/include/division.h
===================================================================
--- boot/genarch/include/division.h	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/genarch/include/division.h	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -33,28 +33,20 @@
 #define BOOT_DIVISION_H_
 
-/* 32bit integer division */
 extern int __divsi3(int, int);
-
-/* 64bit integer division */
 extern long long __divdi3(long long, long long);
 
-/* 32bit unsigned integer division */
 extern unsigned int __udivsi3(unsigned int, unsigned int);
-
-/* 64bit unsigned integer division */
 extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
 
-/* 32bit remainder of the signed division */
 extern int __modsi3(int, int);
-
-/* 64bit remainder of the signed division */
 extern long long __moddi3(long long, long long);
 
-/* 32bit remainder of the unsigned division */
 extern unsigned int __umodsi3(unsigned int, unsigned int);
-
-/* 64bit remainder of the unsigned division */
 extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
 
+extern int __divmodsi3(int, int, int *);
+extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
+
+extern long long __divmoddi3(long long, long long, long long *);
 extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
     unsigned long long *);
Index: boot/genarch/src/division.c
===================================================================
--- boot/genarch/src/division.c	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/genarch/src/division.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -73,5 +73,5 @@
 {
 	unsigned long long result;
-	int steps = sizeof(unsigned long long) * 8; 
+	int steps = sizeof(unsigned long long) * 8;
 	
 	*remainder = 0;
@@ -104,5 +104,5 @@
 
 /* 32bit integer division */
-int __divsi3(int a, int b) 
+int __divsi3(int a, int b)
 {
 	unsigned int rem;
@@ -116,5 +116,5 @@
 
 /* 64bit integer division */
-long long __divdi3(long long a, long long b) 
+long long __divdi3(long long a, long long b)
 {
 	unsigned long long rem;
@@ -155,5 +155,5 @@
 
 /* 64bit remainder of the signed division */
-long long __moddi3(long long a,long  long b)
+long long __moddi3(long long a, long long b)
 {
 	unsigned long long rem;
@@ -183,4 +183,38 @@
 }
 
+int __divmodsi3(int a, int b, int *c)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
+unsigned int __udivmodsi3(unsigned int a, unsigned int b,
+    unsigned int *c)
+{
+	return divandmod32(a, b, c);
+}
+
+long long __divmoddi3(long long a, long long b, long long *c)
+{
+	unsigned long long rem;
+	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
     unsigned long long *c)
Index: boot/generic/include/memstr.h
===================================================================
--- boot/generic/include/memstr.h	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/generic/include/memstr.h	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -36,4 +36,5 @@
 
 extern void *memcpy(void *, const void *, size_t);
+extern void *memmove(void *, const void *, size_t);
 
 #endif
Index: boot/generic/src/memstr.c
===================================================================
--- boot/generic/src/memstr.c	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/generic/src/memstr.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -51,4 +51,49 @@
 }
 
+/** Move memory block with possible overlapping.
+ *
+ * Copy cnt bytes from src address to dst address. The source
+ * and destination memory areas may overlap.
+ *
+ * @param dst Destination address to copy to.
+ * @param src Source address to copy from.
+ * @param cnt Number of bytes to copy.
+ *
+ * @return Destination address.
+ *
+ */
+void *memmove(void *dst, const void *src, size_t cnt)
+{
+	/* Nothing to do? */
+	if (src == dst)
+		return dst;
+	
+	/* Non-overlapping? */
+	if ((dst >= src + cnt) || (src >= dst + cnt))
+		return memcpy(dst, src, cnt);
+	
+	uint8_t *dp;
+	const uint8_t *sp;
+	
+	/* Which direction? */
+	if (src > dst) {
+		/* Forwards. */
+		dp = dst;
+		sp = src;
+		
+		while (cnt-- != 0)
+			*dp++ = *sp++;
+	} else {
+		/* Backwards. */
+		dp = dst + (cnt - 1);
+		sp = src + (cnt - 1);
+		
+		while (cnt-- != 0)
+			*dp-- = *sp--;
+	}
+	
+	return dst;
+}
+
 /** @}
  */
Index: boot/generic/src/str.c
===================================================================
--- boot/generic/src/str.c	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/generic/src/str.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -100,4 +100,11 @@
 #include <str.h>
 #include <errno.h>
+
+/** Check the condition if wchar_t is signed */
+#ifdef WCHAR_IS_UNSIGNED
+	#define WCHAR_SIGNED_CHECK(cond)  (true)
+#else
+	#define WCHAR_SIGNED_CHECK(cond)  (cond)
+#endif
 
 /** Byte mask consisting of lowest @n bits (out of 8) */
@@ -198,5 +205,5 @@
  *         code was invalid.
  */
-int chr_encode(wchar_t ch, char *str, size_t *offset, size_t size)
+int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)
 {
 	if (*offset >= size)
@@ -325,5 +332,5 @@
 bool ascii_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 127))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
 		return true;
 	
@@ -338,5 +345,5 @@
 bool chr_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 1114111))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
 		return true;
 	
Index: boot/generic/src/version.c
===================================================================
--- boot/generic/src/version.c	(revision 69a93df73c1354a0d5b5d6a1278f8d030537f534)
+++ boot/generic/src/version.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
@@ -32,5 +32,5 @@
 
 static const char *project = "HelenOS bootloader";
-static const char *copyright = "Copyright (c) 2001-2011 HelenOS project";
+static const char *copyright = STRING(COPYRIGHT);
 static const char *release = STRING(RELEASE);
 static const char *name = STRING(NAME);
