The unified diff between revisions [58cb6f08..] and [da9f7de4..] is displayed below. It can also be downloaded as a raw diff.

#
#
# delete "patches/sinit_adb_patch"
#
# rename "patches"
#     to "debian/patches"
#
# add_dir "debian"
#
# add_file "copyright"
#  content [c4dee32ae2bd32f01f0bcfee3a63f694ae24ec6b]
#
# add_file "src/boards/x86/asm.h"
#  content [8e853dd43deadc1eb35418ceb27ab845d67ba866]
#
# add_file "src/boards/x86/memcpy.S"
#  content [595cc0953a5d440151a741cf2a0a3a40ece0b82b]
#
# add_file "src/boards/x86/memmove.S"
#  content [e435d69c0347c37c5661fbeff85f2c116b327834]
#
# patch "GNUmakefile"
#  from [bbacd3ff8a5a68eb9b3fed61f73d2bcbd00bdb62]
#    to [14f1ec653513305be713b2be6ebdc0d935c2d43f]
#
# patch "README"
#  from [ffeafe1ac0f670c581f1181b077a24552251862f]
#    to [54226516dc08edfd84bc64243fac6bafd11bc531]
#
# patch "config/GNUmakefile.mk"
#  from [e0fff022f9133c0b476ffc01375857ad8f33775e]
#    to [4636d4b5b3f55a9837e296f458a271b688099fed]
#
# patch "config/boards/qemu_x86.mk"
#  from [32b6bcf67b1264e9d272a87465e7ae617716fc5e]
#    to [6097eed67c4af06d357fa271715d4fb7ed7b5b0b]
#
# patch "debian/patches/runtime_base_patch"
#  from [638622cad3c99b6ca792fac4e3f16118c68968e2]
#    to [f473d9dfc96e1bbd530d4b7d4c1d975859bf7b33]
#
# patch "debian/patches/series"
#  from [78f582efdf1b69bce6dd87cabc1c2041f438c79d]
#    to [11364ff22585a5fb2fb0749c78418624336b2357]
#
# patch "lovelace.gpr"
#  from [63d191f736553b6888957712e18edd751417721e]
#    to [21e695313b4f9b2ff43cbf68c82bf32cc970b530]
#
# patch "runtime_kernel/GNUmakefile"
#  from [bd08153776a006bbf32a9f43c6eeaee87ec45127]
#    to [8c324a732540f697d90d44b968e7202ee7e62147]
#
# patch "src/boards/qemu_x86/bootstrap_common.adb"
#  from [c949b0ae464b4115b73b0c1d2aba86d6284e8645]
#    to [d65d3611e483ee5c292533675f3df6b9ac636441]
#
# patch "src/boards/qemu_x86/lovelace-stage1-interrupts.adb"
#  from [0938e42e6d33e10ace5279df59d0029adcfc7b31]
#    to [fd3646103658cba82153f3e37f1b0a22eb06c4b6]
#
# patch "src/boards/qemu_x86/lovelace-stage1-interrupts.ads"
#  from [5c26577fd3457fccaa7d3f70a42509becc68fb79]
#    to [e8c965ff2f0af8d47437e0ffbfe4494ac90a698e]
#
# patch "src/boards/x86/lovelace-stage1-memory-paging.adb"
#  from [a569fe074d23e8add107f1298851c9fbccd710ef]
#    to [1fb73b86a3074feabd4a09f37335fce12806c348]
#
# patch "src/boards/x86/multiboot.adb"
#  from [6223ed83ffc59a40bf0da315ca227bf7a39f4221]
#    to [21c9a78a5ea903f35944a12f6c16e0808b8a38d0]
#
# patch "src/core/lovelace-cpu_context.ads"
#  from [3c0d1efcbe412dde803090d3563ca1a64e0a8aca]
#    to [65f53013e271221cbdbd4597e8fcdcb08eb12945]
#
# patch "src/core/lovelace-signals.adb"
#  from [3d294b5da2326da2691ea7ec8759ea105f2bda2f]
#    to [7242686a1e1f5b8436667ee185d32f94d5266ed0]
#
# patch "src/core/lovelace-signals.ads"
#  from [f26c304e7b99b5ca70e67348e70bfedc5c139d63]
#    to [948df8f8eacc4161fc4d259c070d474629237c7e]
#
# patch "src/core/lovelace-stage1-memory-generic_allocation.adb"
#  from [66320ef2373f1395355264287785354d66d53973]
#    to [82c5486d3218ec633680497e548d3e79f091e051]
#
# patch "src/core/lovelace-tasking-threads.adb"
#  from [8c79d813e2a1b3343b2feb6aaf1a5a01ca658ed6]
#    to [f70a4e2e02df3396d10b1b3ce632c950e479a522]
#
# patch "src/core/lovelace-tasking-threads.ads"
#  from [d20cedc048fc86ae3769ea9c0ad804436b09eb99]
#    to [a2108ac0d31696cc408d65041153b53579596189]
#
# patch "src/core/lovelace-time.adb"
#  from [850de3b3dfdcb15d1f0db786c7b8d057e9366694]
#    to [963f8adff3cc8cf062eea17cfb321da68955d4ff]
#
# patch "src/core/lovelace-time.ads"
#  from [8d5807dcf495eb90e5d25fb4d133b143f1608558]
#    to [42e1e7508058b8177c8421b8dd6f60dab9c4ea15]
#
============================================================
--- copyright	c4dee32ae2bd32f01f0bcfee3a63f694ae24ec6b
+++ copyright	c4dee32ae2bd32f01f0bcfee3a63f694ae24ec6b
@@ -0,0 +1,73 @@
+All Ada files are under GPL v2. See AUTHORS files for authors
+and COPYING for the content of GPL v2.
+src/boars/x86/memcpy.S and src/boars/x86/asm.h have a different copyright :
+/*      $NetBSD: memcpy.S,v 1.3 2007/11/12 18:41:59 ad Exp $    */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from locore.s.
+ * Optimised by David Laight 2003
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ */
+and
+/*      $NetBSD: asm.h,v 1.38 2008/05/03 05:54:52 yamt Exp $    */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *      @(#)asm.h       5.5 (Berkeley) 5/7/91
+ */
+one modification was done to memcpy.S machine/asm.h becomes asm.h
============================================================
--- src/boards/x86/asm.h	8e853dd43deadc1eb35418ceb27ab845d67ba866
+++ src/boards/x86/asm.h	8e853dd43deadc1eb35418ceb27ab845d67ba866
@@ -0,0 +1,220 @@
+/*	$NetBSD: asm.h,v 1.38 2008/05/03 05:54:52 yamt Exp $	*/
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)asm.h	5.5 (Berkeley) 5/7/91
+ */
+
+#ifndef _I386_ASM_H_
+#define _I386_ASM_H_
+
+#ifdef _KERNEL_OPT
+#include "opt_multiprocessor.h"
+#endif
+
+#ifdef PIC
+#define PIC_PROLOGUE	\
+	pushl	%ebx;	\
+	call	1f;	\
+1:			\
+	popl	%ebx;	\
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+#define PIC_EPILOGUE	\
+	popl	%ebx
+#define PIC_PLT(x)	x@PLT
+#define PIC_GOT(x)	x@GOT(%ebx)
+#define PIC_GOTOFF(x)	x@GOTOFF(%ebx)
+#else
+#define PIC_PROLOGUE
+#define PIC_EPILOGUE
+#define PIC_PLT(x)	x
+#define PIC_GOT(x)	x
+#define PIC_GOTOFF(x)	x
+#endif
+
+#ifdef __ELF__
+# define _C_LABEL(x)	x
+#else
+# ifdef __STDC__
+#  define _C_LABEL(x)	_ ## x
+# else
+#  define _C_LABEL(x)	_/**/x
+# endif
+#endif
+#define	_ASM_LABEL(x)	x
+
+#define CVAROFF(x, y)		_C_LABEL(x) + y
+
+#ifdef __STDC__
+# define __CONCAT(x,y)	x ## y
+# define __STRING(x)	#x
+#else
+# define __CONCAT(x,y)	x/**/y
+# define __STRING(x)	"x"
+#endif
+
+/* let kernels and others override entrypoint alignment */
+#if !defined(_ALIGN_TEXT) && !defined(_KERNEL)
+# ifdef _STANDALONE
+#  define _ALIGN_TEXT .align 4
+# elif defined __ELF__
+#  define _ALIGN_TEXT .align 16
+# else
+#  define _ALIGN_TEXT .align 4
+# endif
+#endif
+
+#define _ENTRY(x) \
+	.text; _ALIGN_TEXT; .globl x; .type x,@function; x:
+#define _LABEL(x) \
+	.globl x; x:
+
+#ifdef _KERNEL
+
+#define CPUVAR(off) %fs:__CONCAT(CPU_INFO_,off)
+
+/* XXX Can't use __CONCAT() here, as it would be evaluated incorrectly. */
+#ifdef __ELF__
+#ifdef __STDC__
+#define	IDTVEC(name) \
+	ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:
+#define	IDTVEC_END(name) \
+	.size X ## name, . - X ## name
+#else
+#define	IDTVEC(name) \
+	ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:
+#define	IDTVEC_END(name) \
+	.size X/**/name, . - X/**/name
+#endif /* __STDC__ */
+#else
+#ifdef __STDC__
+#define	IDTVEC(name) \
+	ALIGN_TEXT; .globl _X ## name; .type _X ## name,@function; _X ## name:
+#define	IDTVEC_END(name) \
+	.size _X ## name, . - _X ## name
+#else
+#define	IDTVEC(name) \
+	ALIGN_TEXT; .globl _X/**/name; .type _X/**/name,@function; _X/**/name:
+#define	IDTVEC_END(name) \
+	.size _X/**/name, . - _X/**/name
+#endif /* __STDC__ */
+#endif /* __ELF__ */
+
+#ifdef _STANDALONE
+#define ALIGN_DATA	.align	4
+#define ALIGN_TEXT	.align	4	/* 4-byte boundaries */
+#define SUPERALIGN_TEXT	.align	16	/* 15-byte boundaries */
+#elif defined __ELF__
+#define ALIGN_DATA	.align	4
+#define ALIGN_TEXT	.align	16	/* 16-byte boundaries */
+#define SUPERALIGN_TEXT	.align	16	/* 16-byte boundaries */
+#else
+#define ALIGN_DATA	.align	2
+#define ALIGN_TEXT	.align	4	/* 16-byte boundaries */
+#define SUPERALIGN_TEXT	.align	4	/* 16-byte boundaries */
+#endif /* __ELF__ */
+
+#define _ALIGN_TEXT ALIGN_TEXT
+
+#ifdef GPROF
+#ifdef __ELF__
+#define	MCOUNT_ASM	call	_C_LABEL(__mcount)
+#else /* __ELF__ */
+#define	MCOUNT_ASM	call	_C_LABEL(mcount)
+#endif /* __ELF__ */
+#else /* GPROF */
+#define	MCOUNT_ASM	/* nothing */
+#endif /* GPROF */
+
+#endif /* _KERNEL */
+
+
+
+#ifdef GPROF
+# ifdef __ELF__
+#  define _PROF_PROLOGUE	\
+	pushl %ebp; movl %esp,%ebp; call PIC_PLT(__mcount); popl %ebp
+# else
+#  define _PROF_PROLOGUE	\
+	pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp
+# endif
+#else
+# define _PROF_PROLOGUE
+#endif
+
+#define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#define	NENTRY(y)	_ENTRY(_C_LABEL(y))
+#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+#define	LABEL(y)	_LABEL(_C_LABEL(y))
+#define	END(y)		.size y, . - y
+
+#define	ASMSTR		.asciz
+
+#ifdef __ELF__
+#define RCSID(x)	.pushsection ".ident"; .asciz x; .popsection
+#else
+#define RCSID(x)	.text; .asciz x
+#endif
+
+#ifdef NO_KERNEL_RCSIDS
+#define	__KERNEL_RCSID(_n, _s)	/* nothing */
+#else
+#define	__KERNEL_RCSID(_n, _s)	RCSID(_s)
+#endif
+
+#ifdef __ELF__
+#define	WEAK_ALIAS(alias,sym)						\
+	.weak alias;							\
+	alias = sym
+#endif
+/*
+ * STRONG_ALIAS: create a strong alias.
+ */
+#define STRONG_ALIAS(alias,sym)						\
+	.globl alias;							\
+	alias = sym
+
+#ifdef __STDC__
+#define	WARN_REFERENCES(sym,msg)					\
+	.stabs msg ## ,30,0,0,0 ;					\
+	.stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
+#elif defined(__ELF__)
+#define	WARN_REFERENCES(sym,msg)					\
+	.stabs msg,30,0,0,0 ;						\
+	.stabs __STRING(sym),1,0,0,0
+#else
+#define	WARN_REFERENCES(sym,msg)					\
+	.stabs msg,30,0,0,0 ;						\
+	.stabs __STRING(_/**/sym),1,0,0,0
+#endif /* __STDC__ */
+
+#endif /* !_I386_ASM_H_ */
============================================================
--- src/boards/x86/memcpy.S	595cc0953a5d440151a741cf2a0a3a40ece0b82b
+++ src/boards/x86/memcpy.S	595cc0953a5d440151a741cf2a0a3a40ece0b82b
@@ -0,0 +1,133 @@
+/*	$NetBSD: memcpy.S,v 1.3 2007/11/12 18:41:59 ad Exp $	*/
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from locore.s.
+ * Optimised by David Laight 2003
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ */
+
+#include <asm.h>
+
+#if defined(LIBC_SCCS)
+	RCSID("$NetBSD: memcpy.S,v 1.3 2007/11/12 18:41:59 ad Exp $")
+#endif
+
+	/*
+	 * (ov)bcopy (src,dst,cnt)
+	 *  ws@tools.de     (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
+	 */
+
+#ifdef BCOPY
+ENTRY(bcopy)
+#else
+#ifdef MEMMOVE
+ENTRY(memmove)
+#else
+#define MEMCPY
+#define NO_OVERLAP
+ENTRY(memcpy)
+#endif
+#endif
+	push	%esi
+	mov	%edi,%edx
+#if defined(MEMCPY) || defined(MEMMOVE)
+	movl	8(%esp),%edi
+	movl	12(%esp),%esi
+#else
+	movl	8(%esp),%esi
+	movl	12(%esp),%edi
+#endif
+	movl	16(%esp),%ecx
+#if defined(NO_OVERLAP)
+	movl	%ecx,%eax
+#else
+	movl	%edi,%eax
+	subl	%esi,%eax
+	cmpl	%ecx,%eax	/* overlapping? */
+	movl	%ecx,%eax
+	jb	.Lbackwards
+#endif
+	/* nope, copy forwards. */
+	shrl	$2,%ecx		/* copy by words */
+	rep
+	movsl
+	and	$3,%eax		/* any bytes left? */
+	jnz	.Ltrailing
+.Ldone:
+#if defined(MEMCPY) || defined(MEMMOVE)
+	movl	8(%esp),%eax
+#endif
+	mov	%edx,%edi
+	pop	%esi
+	ret
+
+.Ltrailing:
+	cmp	$2,%eax
+	jb	1f
+	movw	(%esi),%ax
+	movw	%ax,(%edi)
+	je	.Ldone
+	movb	2(%esi),%al
+	movb	%al,2(%edi)
+	jmp	.Ldone
+1:	movb	(%esi),%al
+	movb	%al,(%edi)
+	jmp	.Ldone
+
+#if !defined(NO_OVERLAP)
+.Lbackwards:
+	addl	%ecx,%edi	/* copy backwards. */
+	addl	%ecx,%esi
+	and	$3,%eax		/* any fractional bytes? */
+	jnz	.Lback_align
+.Lback_aligned:
+	shrl	$2,%ecx
+	subl	$4,%esi
+	subl	$4,%edi
+	std
+	rep
+	movsl
+	cld
+	jmp	.Ldone
+
+.Lback_align:
+	sub	%eax,%esi
+	sub	%eax,%edi
+	cmp	$2,%eax
+	jb	1f
+	je	2f
+	movb	2(%esi),%al
+	movb	%al,2(%edi)
+2:	movw	(%esi),%ax
+	movw	%ax,(%edi)
+	jmp	.Lback_aligned
+1:	movb	(%esi),%al
+	movb	%al,(%edi)
+	jmp	.Lback_aligned
+#endif
============================================================
--- src/boards/x86/memmove.S	e435d69c0347c37c5661fbeff85f2c116b327834
+++ src/boards/x86/memmove.S	e435d69c0347c37c5661fbeff85f2c116b327834
@@ -0,0 +1,4 @@
+/*      $NetBSD: memmove.S,v 1.1 2005/12/20 19:28:49 christos Exp $     */
+
+#define MEMMOVE
+#include "memcpy.S"
============================================================
--- GNUmakefile	bbacd3ff8a5a68eb9b3fed61f73d2bcbd00bdb62
+++ GNUmakefile	14f1ec653513305be713b2be6ebdc0d935c2d43f
@@ -3,7 +3,7 @@ OBJ_DIR=$(LOVELACE_TOPDIR)/obj
 CONFIG_FILES=$(wildcard config/*.mk)
 CLEAN=
 OBJ_DIR=$(LOVELACE_TOPDIR)/obj
-LIBGCC2_INCLUDES=-I. -I../../src/include -I../../src/gcc
+LIBGCC2_INCLUDES=-I. -I../build/gcc -I../src/include -I../src/gcc
 LIBGCC2_FLAGS=-O2 -B. -m32 -fexceptions -fnon-call-exceptions
 LIBGCC2_DEFINES=-DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
 -DLIBGCC2_UNITS_PER_WORD=4 -DL_divdi3 -DL_udivdi3 -DL_clz -DIN_LIBGCC2 \
@@ -78,8 +78,31 @@ cleansource:
 force:

 cleansource:
-	rm -Rf gnatsources gccsrc
+	rm -Rf gnatsources gccsrc gnatsources_32

+INCLUDES_32=-I../build/gcc -I../src/gcc -I../src/include
+OBJS_32=init.o tracebak.o our_libgcc2.o raise.o
+
+gnatsources_32:gnatsources
+	mkdir -p gccsrc/gnat-4.4-4.4.4/lovelace;
+	cd gccsrc/gnat-4.4-4.4.4/lovelace; \
+	gnatgcc -c -m32 -g -fkeep-inline-functions -DIN_GCC -W -Wall \
+	-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual \
+	-DHAVE_CONFIG_H $(INCLUDES_32) \
+	../build/gcc/ada/gnatlib-sources-sjlj/init.c -o init.o && \
+	gnatgcc -c -m32 -g -fkeep-inline-functions -DIN_GCC -W -Wall \
+	-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual \
+	-DHAVE_CONFIG_H $(INCLUDES_32) \
+	../build/gcc/ada/gnatlib-sources-sjlj/tracebak.c -o tracebak.o && \
+	gnatgcc $(LIBGCC2_FLAGS) $(LIBGCC2_INCLUDES) $(LIBGCC2_DEFINES) \
+	-c ../src/gcc/libgcc2.c -o our_libgcc2.o && \
+	gnatgcc -c -m32 -g -fkeep-inline-functions -DIN_GCC -W -Wall \
+	-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual \
+	-DHAVE_CONFIG_H $(INCLUDES_32) \
+	../build/gcc/ada/gnatlib-sources-sjlj/raise.c -o raise.o && \
+	ar r for_lovelace.a $(OBJS_32) && \
+	touch ../../../gnatsources_32
+
 gnatsources:
 	rm -f gnatsources
 	mkdir -p gccsrc
============================================================
--- README	ffeafe1ac0f670c581f1181b077a24552251862f
+++ README	54226516dc08edfd84bc64243fac6bafd11bc531
@@ -89,10 +89,10 @@

 *** Compiler

-Lovelace is known to compile and work with GNAT GPL 2007; you may be
+Lovelace is known to compile and work with GNAT 4.4 from Debian Squeeze; you may be
 lucky with other versions.  Please report if that is the case.

-You can obtain GNAT GPL 2007 from http://libre.adacore.com.
+You can obtain GNAT 4.4 from Debian.

 To make sure the compiler works and is the correct version, try:

@@ -101,52 +101,25 @@
 which should reply:

 Using built-in specs.
-Target: i686-pc-linux-gnu
-Configured with:
-/cardhu.b/gnatmail/release-gpl/build-cardhu/src/configure
---prefix=/usr/gnat --enable-languages=c,ada --disable-nls
---disable-libada --target=i686-pc-linux-gnu --host=i686-pc-linux-gnu
---build=i686-pc-linux-gnu --enable-checking=release --enable-threads=posix
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.4-1' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
 Thread model: posix
-gcc version 4.1.3 20070403 for GNAT GPL 2007 (20070402)
+gcc version 4.4.4 (Debian 4.4.4-1)

 Lovelace requires that the compiler use the setjump/longjump (aka
 SJLJ) mechanism for exception handling, as opposed to the default
-zero-cost (aka ZCX) mechanism.  To use the SJLJ mechanism:
+zero cost mechanism.

-$ cd $(gcc -print-file-name=adainclude)/..
-$ rm adainclude adalib
-$ ln -s rts-sjlj/adainclude .
-$ ln -s rts-sjlj/adalib .
-$ cd -
-
 For more information about the two exception handling mechanisms, see
 the GNAT user's guide.

 *** GNAT run-time library sources

 Lovelace contains a minimal Ada run-time library which is derived from
-that of GNAT GPL.  The Lovelace build machinery unpacks the GNAT GPL
+that of GNAT 4.4.  The Lovelace build machinery unpacks the GNAT 4.4
 sources, patches them, and then builds the run-time library into the
-Lovelace image.  This requires that you have the sources for GNAT GPL
-on your system.
+Lovelace image.

-At this time, Lovelace requires GNAT GPL 2007; please report any
-problems or success you have with other versions.
-
-Specifically, you need two files which are both part of the GNAT GPL
-2007 source distribution available from http://libre.adacore.com; they
-must be somewhere on your machine:
-
-gnat-gpl-2007-src.tgz
-gcc-4_1-branch-20070403-src.tar.gz
-
-Then, set the following environment variables to point to the two
-files:
-
-$ export GNATSOURCES=/full/path/to/gnat-gpl-2007-src.tgz
-$ export GCCSOURCES=/full/path/to/gcc-4_1-branch-20070403-src.tar.gz
-
 *** SOS (Simple Operating System) sources

 On x86 targets, Lovelace builds on parts of SOS and requires the
============================================================
--- config/GNUmakefile.mk	e0fff022f9133c0b476ffc01375857ad8f33775e
+++ config/GNUmakefile.mk	4636d4b5b3f55a9837e296f458a271b688099fed
@@ -1,4 +1,4 @@
-GNAT_FILES=$(shell gcc -print-file-name=adainclude)
+GNAT_FILES=$(shell gcc -print-file-name=rts-sjlj/adainclude)
 RUNTIME_KERNEL_DIR=$(LOVELACE_TOPDIR)/runtime_kernel
 RUNTIME_USER_DIR=$(LOVELACE_TOPDIR)/runtime_user
 KERNEL_INCLUDES=-I$(RUNTIME_KERNEL_DIR)
============================================================
--- config/boards/qemu_x86.mk	32b6bcf67b1264e9d272a87465e7ae617716fc5e
+++ config/boards/qemu_x86.mk	6097eed67c4af06d357fa271715d4fb7ed7b5b0b
@@ -1,7 +1,8 @@ BASE_OBJ=$(OBJ_DIR)/asm_multiboot.o $(OB
 GCC=gcc
 KERNEL_INCLUDES+=-Isrc/boards/qemu_x86 -Isrc/boards/x86/
 BASE_OBJ=$(OBJ_DIR)/asm_multiboot.o $(OBJ_DIR)/irq_wrappers.o \
-$(OBJ_DIR)/exception_wrappers.o $(OBJ_DIR)/cpu_context_switch.o
+$(OBJ_DIR)/exception_wrappers.o $(OBJ_DIR)/cpu_context_switch.o \
+$(OBJ_DIR)/memmove.o
 OBJS=$(OBJ_DIR)/b~bootstrap.o $(BASE_OBJ)
 OBJS_ALTERNATIVES=$(OBJ_DIR)/b~bootstrap_alternative.o $(BASE_OBJ)
 SOS=http://sos.enix.org/wiki-fr/upload/SOSDownload/sos-code-art6.5-lm69.tgz
@@ -19,17 +20,15 @@ all_sources:runtime_files sos_sources
 	quilt push -a
 	touch all_sources

-fd.img:gnatsources all_sources sos_sources $(OBJS) \
-$(OBJ_DIR)/multiboot.o $(OBJ_DIR) module.elf
+fd.img:gnatsources_32 all_sources sos_sources $(OBJS) \
+$(OBJ_DIR)/multiboot.o $(OBJ_DIR)
 	ld --warn-common -T \
 	$(LOVELACE_TOPDIR)/src/boards/qemu_x86/support/sos.lds \
-	-o lovelace.elf $(OBJS) \
-	gccsrc/obj/gcc/ada/tracebak.o gccsrc/obj/gcc/ada/raise.o \
-	gccsrc/obj/gcc/our_libgcc2.o \
-	$(shell cat list_obj_bootstrap)
-	./build_image.sh fd.img lovelace.elf dummy_options module.elf
+	-o lovelace.elf $(OBJS) $(shell cat list_obj_bootstrap) \
+	gccsrc/gnat-4.4-4.4.4/lovelace/for_lovelace.a
+	./build_image.sh fd.img lovelace.elf dummy_options

-fd_alternative.img:gnatsources runtime_files sos_sources \
+fd_alternative.img:gnatsources_32 runtime_files sos_sources \
 $(OBJS_ALTERNATIVES) $(OBJ_DIR)/multiboot.o $(OBJ_DIR)
 	ld --warn-common -T \
 	$(LOVELACE_TOPDIR)/src/boards/qemu_x86/support/sos.lds \
@@ -52,25 +51,29 @@ $(OBJ_DIR)/asm_multiboot.o:sos_sources
 	-o $(OBJ_DIR)/module.o $(LOVELACE_TOPDIR)/src/modules/module.adb

 $(OBJ_DIR)/asm_multiboot.o:sos_sources
-	$(GCC) -Wall -nostdlib -nostdinc -ffreestanding -c \
+	$(GCC) -m32 -Wall -nostdlib -nostdinc -ffreestanding -c \
 	$(SRC_DIST)/multiboot.S -I$(SRC_DIST) -DASM_SOURCE=1 \
 	-o $(OBJ_DIR)/asm_multiboot.o

 $(OBJ_DIR)/irq_wrappers.o:sos_sources
-	$(GCC) -Wall -nostdlib -nostdinc -ffreestanding -c \
+	$(GCC) -m32 -Wall -nostdlib -nostdinc -ffreestanding -c \
 	$(SRC_DIST)/irq_wrappers.S -I$(SRC_DIST) -DASM_SOURCE=1 \
 	-o $(OBJ_DIR)/irq_wrappers.o

 $(OBJ_DIR)/exception_wrappers.o:sos_sources
-	$(GCC) -Wall -nostdlib -nostdinc -ffreestanding -c \
+	$(GCC) -m32 -Wall -nostdlib -nostdinc -ffreestanding -c \
 	$(SRC_DIST)/exception_wrappers.S -I$(SRC_DIST) -DASM_SOURCE=1 \
 	-o $(OBJ_DIR)/exception_wrappers.o

 $(OBJ_DIR)/cpu_context_switch.o:sos_sources
-	$(GCC) -Wall -nostdlib -nostdinc -ffreestanding -c \
+	$(GCC) -m32 -Wall -nostdlib -nostdinc -ffreestanding -c \
 	$(SRC_DIST)/cpu_context_switch.S -I$(SRC_DIST) -DASM_SOURCE=1 \
 	-o $(OBJ_DIR)/cpu_context_switch.o

+$(OBJ_DIR)/memmove.o:
+	$(GCC) -c -m32 -Wall -nostdlib -nostdinc src/boards/x86/memmove.S \
+	-Isrc/boards/x86/ -o $(OBJ_DIR)/memmove.o
+
 sos_sources:$(SRC_DIST)
 ifndef LOCAL_SOS
 	wget -O $(SRC_DIST)/sos.tgz $(SOS)
@@ -100,7 +103,7 @@ $(OBJ_DIR)/b~bootstrap.o:$(OBJ_DIR)/b~bo
 	gnatmake -j$(PROCS_NUMBER) -a -c -P lovelace.gpr

 $(OBJ_DIR)/b~bootstrap.o:$(OBJ_DIR)/b~bootstrap.adb
-	$(GCC) -c -gnatL -nostdinc -nostdlib $(KERNEL_INCLUDES) \
+	$(GCC) -m32 -c -gnatL -nostdinc -nostdlib $(KERNEL_INCLUDES) \
 	$(OBJ_DIR)/b~bootstrap.adb -o $(OBJ_DIR)/b~bootstrap.o

 $(OBJ_DIR)/b~bootstrap.adb $(OBJ_DIR)/b~bootstrap_alternative.adb: \
@@ -112,7 +115,7 @@ $(OBJ_DIR)/b~bootstrap_alternative.o:$(O
 	awk '{print $$2}' > list_obj_bootstrap_alternative

 $(OBJ_DIR)/b~bootstrap_alternative.o:$(OBJ_DIR)/b~bootstrap_alternative.adb
-	$(GCC) -c -gnatL -nostdinc -nostdlib $(KERNEL_INCLUDES) \
+	$(GCC) -m32 -c -gnatL -nostdinc -nostdlib $(KERNEL_INCLUDES) \
 	$(OBJ_DIR)/b~bootstrap_alternative.adb \
 	-o $(OBJ_DIR)/b~bootstrap_alternative.o

@@ -121,3 +124,4 @@ board_clean:

 board_clean:
 	-quilt pop -a
+	rm -Rf .pc
============================================================
--- debian/patches/runtime_base_patch	638622cad3c99b6ca792fac4e3f16118c68968e2
+++ debian/patches/runtime_base_patch	f473d9dfc96e1bbd530d4b7d4c1d975859bf7b33
@@ -1,10 +1,8 @@
-Index: org.os-lovelace/runtime_kernel/a-elchha.adb
-===================================================================
---- org.os-lovelace.orig/runtime_kernel/a-elchha.adb	2008-06-29 17:03:42.000000000 +0200
-+++ org.os-lovelace/runtime_kernel/a-elchha.adb	2008-06-29 17:04:39.000000000 +0200
-@@ -40,12 +40,18 @@
- --  Used for Task_Termination_Handler
- --           Task_Termination_NT
+--- a/runtime_kernel/a-elchha.adb
++++ b/runtime_kernel/a-elchha.adb
+@@ -38,12 +38,18 @@
+ with System.Standard_Library; use System.Standard_Library;
+ with System.Soft_Links;

 +with Lovelace.Os_Exit;
 +
@@ -22,20 +20,20 @@ Index: org.os-lovelace/runtime_kernel/a-
     --  Perform system dependent shutdown code

     function Exception_Message_Length
-Index: org.os-lovelace/runtime_kernel/a-except.adb
-===================================================================
---- org.os-lovelace.orig/runtime_kernel/a-except.adb	2008-06-29 17:03:48.000000000 +0200
-+++ org.os-lovelace/runtime_kernel/a-except.adb	2008-06-29 17:04:39.000000000 +0200
-@@ -55,6 +55,8 @@
+--- a/runtime_kernel/a-except.adb
++++ b/runtime_kernel/a-except.adb
+@@ -51,6 +51,10 @@
  with System.WCh_Con;          use System.WCh_Con;
  with System.WCh_StW;          use System.WCh_StW;

++pragma Warnings (Off);
 +with Lovelace.Stage1.Console;
++pragma Warnings (On);
 +
  package body Ada.Exceptions is

     pragma Suppress (All_Checks);
-@@ -1331,14 +1333,8 @@
+@@ -1327,14 +1331,8 @@
     ---------------

     procedure To_Stderr (C : Character) is
@@ -51,11 +49,9 @@ Index: org.os-lovelace/runtime_kernel/a-
     end To_Stderr;

     procedure To_Stderr (S : String) is
-Index: org.os-lovelace/runtime_kernel/s-memory.adb
-===================================================================
---- org.os-lovelace.orig/runtime_kernel/s-memory.adb	2008-06-29 17:03:53.000000000 +0200
-+++ org.os-lovelace/runtime_kernel/s-memory.adb	2008-06-29 17:04:39.000000000 +0200
-@@ -33,7 +33,7 @@
+--- a/runtime_kernel/s-memory.adb
++++ b/runtime_kernel/s-memory.adb
+@@ -31,7 +31,7 @@

  --  This is the default implementation of this package

@@ -64,7 +60,7 @@ Index: org.os-lovelace/runtime_kernel/s-
  --  implementation is thread safe, and thus, no additional lock is required.
  --  Note that we still need to defer abort because on most systems, an
  --  asynchronous signal (as used for implementing asynchronous abort of
-@@ -46,22 +46,18 @@
+@@ -48,22 +48,18 @@
  with Ada.Exceptions;
  with System.Soft_Links;
  with System.Parameters;
@@ -91,7 +87,7 @@ Index: org.os-lovelace/runtime_kernel/s-

     -----------
     -- Alloc --
-@@ -86,10 +82,10 @@
+@@ -88,10 +84,10 @@
        end if;

        if Parameters.No_Abort then
@@ -104,7 +100,7 @@ Index: org.os-lovelace/runtime_kernel/s-
           Abort_Undefer.all;
        end if;

-@@ -115,36 +111,4 @@
+@@ -117,36 +113,4 @@
        end if;
     end Free;

@@ -141,18 +137,28 @@ Index: org.os-lovelace/runtime_kernel/s-
 -   end Realloc;
 -
  end System.Memory;
-Index: org.os-lovelace/runtime_kernel/s-memory.ads
-===================================================================
---- org.os-lovelace.orig/runtime_kernel/s-memory.ads	2008-06-29 17:04:33.000000000 +0200
-+++ org.os-lovelace/runtime_kernel/s-memory.ads	2008-06-29 17:04:39.000000000 +0200
-@@ -73,36 +73,11 @@
+--- a/runtime_kernel/system.ads
++++ b/runtime_kernel/system.ads
+@@ -66,8 +66,8 @@
+    Null_Address : constant Address;
+
+    Storage_Unit : constant := 8;
+-   Word_Size    : constant := 64;
+-   Memory_Size  : constant := 2 ** 64;
++   Word_Size    : constant := 32;
++   Memory_Size  : constant := 2 ** 32;
+
+    --  Address comparison
+
+--- a/runtime_kernel/s-memory.ads
++++ b/runtime_kernel/s-memory.ads
+@@ -75,35 +75,11 @@
     --  Note: this is roughly equivalent to the standard C free call
     --  with the additional semantics as described above.

 -   function Realloc
 -     (Ptr  : System.Address;
--      Size : size_t)
--      return System.Address;
+-      Size : size_t) return System.Address;
 -   --  This is the low level reallocation routine. It takes an existing
 -   --  block address returned by a previous call to Alloc or Realloc,
 -   --  and reallocates the block. The size can either be increased or
============================================================
--- debian/patches/series	78f582efdf1b69bce6dd87cabc1c2041f438c79d
+++ debian/patches/series	11364ff22585a5fb2fb0749c78418624336b2357
@@ -1,3 +1,2 @@ build_image_patch
 build_image_patch
-sinit_adb_patch
 runtime_base_patch
============================================================
--- lovelace.gpr	63d191f736553b6888957712e18edd751417721e
+++ lovelace.gpr	21e695313b4f9b2ff43cbf68c82bf32cc970b530
@@ -15,11 +15,11 @@ project Lovelace is
    package Compiler is
       for Default_Switches ("ada") use
          ("-O2", "-gnaty", "-gnatf", "-gnatL", "-nostdinc", "-nostdlib",
-          "-gnat05", "-gnatwae", "-gnato");
+          "-gnat05", "-gnatwae", "-gnato", "-m32");
    end Compiler;

    package Binder is
       for Default_Switches ("ada") use ("-nostdinc", "-nostdlib", "-n");
    end Binder;

-end Lovelace;
\ No newline at end of file
+end Lovelace;
============================================================
--- runtime_kernel/GNUmakefile	bd08153776a006bbf32a9f43c6eeaee87ec45127
+++ runtime_kernel/GNUmakefile	8c324a732540f697d90d44b968e7202ee7e62147
@@ -1,16 +1,17 @@ include ../config/GNUmakefile.mk
 include ../config/GNUmakefile.mk
-GNAT_SRC_DIR=../gccsrc/src/gcc/ada
 FILES=s-stoele s-stalib s-soflin s-memory s-restri a-except s-parame s-traent \
 s-stache s-secsta s-wchcon s-wchstw s-exctab a-elchha s-htable \
 s-wchcnv s-wchjis s-traceb s-except s-strops s-sopco3 s-sopco4 s-sopco5 \
 a-tags s-valuns s-finroo a-filico a-finali s-finimp s-stratt s-valuti \
-s-casuti i-c a-convec s-addima a-cgarso a-cgcaso s-arit64 s-osinte s-imgbiu
+s-casuti i-c a-convec s-addima a-cgarso a-cgcaso s-arit64 s-osinte s-imgbiu \
+s-valllu
 ADS_FILES=$(addsuffix .ads,$(FILES))
 ADB_FILES=$(addsuffix .adb,$(FILES))
 ADB_FILES_TO_COMPILE=$(ADB_FILES)
 ADS_FILES_TO_COMPILE=system.ads interfac.ads unchconv.ads ada.ads \
 s-rident.ads a-unccon.ads unchdeal.ads a-uncdea.ads s-purexc.ads \
-s-maccod.ads s-unstyp.ads a-stream.ads a-ioexce.ads a-contai.ads s-unstyp.ads
+s-maccod.ads s-unstyp.ads a-stream.ads a-ioexce.ads a-contai.ads s-unstyp.ads \
+s-linux.ads
 ADS_FILES+=$(ADS_FILES_TO_COMPILE)
 FULL_ADS_FILES=$(addprefix $(GNAT_FILES)/,$(ADS_FILES))
 FULL_ADB_FILES=$(addprefix $(GNAT_FILES)/,$(ADB_FILES) a-excpol.adb \
@@ -21,9 +22,6 @@ all:
 all:
 	cp $(FULL_ADS_FILES) .
 	cp $(FULL_ADB_FILES) .
-	cp $(GNAT_SRC_DIR)/2sinit.ad? .
-	mv 2sinit.ads s-init.ads; \
-	mv 2sinit.adb s-init.adb

 clean:
 	rm -f *.ads *.adb *.o *.ali *~
============================================================
--- src/boards/qemu_x86/bootstrap_common.adb	c949b0ae464b4115b73b0c1d2aba86d6284e8645
+++ src/boards/qemu_x86/bootstrap_common.adb	d65d3611e483ee5c292533675f3df6b9ac636441
@@ -15,7 +15,6 @@ pragma Warnings (Off);

 with Multiboot;
 pragma Warnings (Off);
-with System.Init;
 with Display_Fatal_Error;
 pragma Warnings (On);

============================================================
--- src/boards/qemu_x86/lovelace-stage1-interrupts.adb	0938e42e6d33e10ace5279df59d0029adcfc7b31
+++ src/boards/qemu_x86/lovelace-stage1-interrupts.adb	fd3646103658cba82153f3e37f1b0a22eb06c4b6
@@ -55,7 +55,7 @@ package body Lovelace.Stage1.Interrupts
            Volatile => True);
    end Save_Flags;

-   procedure Restore_Flags (Flags : in out Unsigned_32) is
+   procedure Restore_Flags (Flags : in Unsigned_32) is
       use System.Machine_Code;
    begin
       Asm ("push %0; popfl",
@@ -71,7 +71,7 @@ package body Lovelace.Stage1.Interrupts
       System.Machine_Code.Asm ("cli" & ASCII.LF, Volatile => True);
    end Disable_IRQs;

-   procedure Restore_IRQs (Flags : in out Unsigned_32) is
+   procedure Restore_IRQs (Flags : in Unsigned_32) is
    begin
       Restore_Flags (Flags);
    end Restore_IRQs;
============================================================
--- src/boards/qemu_x86/lovelace-stage1-interrupts.ads	5c26577fd3457fccaa7d3f70a42509becc68fb79
+++ src/boards/qemu_x86/lovelace-stage1-interrupts.ads	e8c965ff2f0af8d47437e0ffbfe4494ac90a698e
@@ -6,11 +6,11 @@ package Lovelace.Stage1.Interrupts is
                           Interrupt_Handler : X86_Types.Interrupt_Handler_Ptr);
    procedure Disable_IRQs (Flags : in out Unsigned_32);
    pragma Inline (Disable_IRQs);
-   procedure Restore_IRQs (Flags : in out Unsigned_32);
+   procedure Restore_IRQs (Flags : in Unsigned_32);
    pragma Inline (Restore_IRQs);
    procedure Save_Flags (Flags : in out Unsigned_32);
    pragma Inline (Save_Flags);
-   procedure Restore_Flags (Flags : in out Unsigned_32);
+   procedure Restore_Flags (Flags : in Unsigned_32);
    pragma Inline (Restore_Flags);
    procedure Setup;
    procedure Start;
============================================================
--- src/boards/x86/lovelace-stage1-memory-paging.adb	a569fe074d23e8add107f1298851c9fbccd710ef
+++ src/boards/x86/lovelace-stage1-memory-paging.adb	1fb73b86a3074feabd4a09f37335fce12806c348
@@ -29,7 +29,7 @@ package body Lovelace.Stage1.Memory.Pagi
       Data : Unsigned_32;
       for Data'Address use Address;
    begin
-      System.Machine_Code.Asm (Template => "invlpg %0" & ASCII.Lf,
+      System.Machine_Code.Asm (Template => "invlpg %0" & ASCII.LF,
                                Inputs => Unsigned_32'Asm_Input ("m", Data),
                                Volatile => True);
    end Invlpg;
@@ -224,15 +224,15 @@ package body Lovelace.Stage1.Memory.Pagi
       Cr3.Pd_Paddr := Shift_Right (To_Physical_Address (Pd), 12);

       System.Machine_Code.Asm
-        ("movl %0, %%cr3" & ASCII.Lf & ASCII.Ht &
-         "movl %%cr0, %%eax" & ASCII.Lf & ASCII.Ht &
-         "orl $0x80010000,  %%eax" & ASCII.Lf & ASCII.Ht &
-         "movl %%eax, %%cr0" & ASCII.Lf & ASCII.Ht &
-         "jmp 1f" & ASCII.Lf & ASCII.Ht &
-         "1:" & ASCII.Lf & ASCII.Ht &
-         "movl $2f,  %%eax" & ASCII.Lf & ASCII.Ht &
-         "jmp  * %%eax" & ASCII.Lf & ASCII.Ht &
-         "2:" & ASCII.Lf & ASCII.Ht,
+        ("movl %0, %%cr3" & ASCII.LF & ASCII.HT &
+         "movl %%cr0, %%eax" & ASCII.LF & ASCII.HT &
+         "orl $0x80010000,  %%eax" & ASCII.LF & ASCII.HT &
+         "movl %%eax, %%cr0" & ASCII.LF & ASCII.HT &
+         "jmp 1f" & ASCII.LF & ASCII.HT &
+         "1:" & ASCII.LF & ASCII.HT &
+         "movl $2f,  %%eax" & ASCII.LF & ASCII.HT &
+         "jmp  * %%eax" & ASCII.LF & ASCII.HT &
+         "2:" & ASCII.LF & ASCII.HT,
          Inputs => X86_Pdbr'Asm_Input ("r", Cr3),
          Volatile => True,
          Clobber => "memory, eax");
@@ -373,7 +373,9 @@ package body Lovelace.Stage1.Memory.Pagi
       end if;
       Physical.Unreference_Page_At (Shift_Left (Pt_Incremente.Paddr, 12),
                                     Ref_Count_Null);
-
+      if Ref_Count_Null then
+         null;
+      end if;
       Pt_Incremente.Present := False;
       Pt_Incremente.Write := False;
       Pt_Incremente.User := False;
============================================================
--- src/boards/x86/multiboot.adb	6223ed83ffc59a40bf0da315ca227bf7a39f4221
+++ src/boards/x86/multiboot.adb	21c9a78a5ea903f35944a12f6c16e0808b8a38d0
@@ -34,7 +34,7 @@ package body Multiboot is
                C : Character;
                for C'Address use Cmdline_Addr;
             begin
-               exit when C = ASCII.Nul;
+               exit when C = ASCII.NUL;
                Lovelace.Stage1.Console.Put (C);
             end;
             Cmdline_Base := Cmdline_Base + 1;
============================================================
--- src/core/lovelace-cpu_context.ads	3c0d1efcbe412dde803090d3563ca1a64e0a8aca
+++ src/core/lovelace-cpu_context.ads	65f53013e271221cbdbd4597e8fcdcb08eb12945
@@ -20,6 +20,7 @@ package Lovelace.Cpu_Context is
    package Switch is
       type Cpu_Kstate_Function_Arg1_T_Ptr is access
         procedure (Arg1 : in out Item);
+      pragma Convention (C, Cpu_Kstate_Function_Arg1_T_Ptr);
       procedure Kstate_Init
         (Ctxt : in out Cpu_Kstate_Ptr;
          Start_Func : Cpu_Kstate_Function_Arg1_T_Ptr;
============================================================
--- src/core/lovelace-signals.adb	3d294b5da2326da2691ea7ec8759ea105f2bda2f
+++ src/core/lovelace-signals.adb	7242686a1e1f5b8436667ee185d32f94d5266ed0
@@ -121,4 +121,20 @@ package body Lovelace.Signals is
       return 0;
    end pthread_sigmask;

+   -----------------
+   -- sigaltstack --
+   -----------------
+
+   function sigaltstack
+     (ss  : not null access stack_t;
+      oss : access stack_t) return Interfaces.C.int is
+      pragma Unreferenced (ss);
+      pragma Unreferenced (oss);
+   begin
+      --  since in the kernel I don't know how to do this...
+      --  need to discuss this with somebody in front of a beer
+      --  (belgian one)
+      return 0;
+   end sigaltstack;
+
 end Lovelace.Signals;
============================================================
--- src/core/lovelace-signals.ads	f26c304e7b99b5ca70e67348e70bfedc5c139d63
+++ src/core/lovelace-signals.ads	948df8f8eacc4161fc4d259c070d474629237c7e
@@ -47,4 +47,12 @@ package Lovelace.Signals is
       set  : sigset_t_ptr;
       oset : sigset_t_ptr) return Interfaces.C.int;
    pragma Export (C, pthread_sigmask, "pthread_sigmask");
+
+   subtype stack_t is System.OS_Interface.stack_t;
+
+   function sigaltstack
+     (ss  : not null access stack_t;
+      oss : access stack_t) return Interfaces.C.int;
+   pragma Export (C, sigaltstack, "sigaltstack");
+
 end Lovelace.Signals;
============================================================
--- src/core/lovelace-stage1-memory-generic_allocation.adb	66320ef2373f1395355264287785354d66d53973
+++ src/core/lovelace-stage1-memory-generic_allocation.adb	82c5486d3218ec633680497e548d3e79f091e051
@@ -160,7 +160,10 @@ package body Lovelace.Stage1.Memory.Gene
       end if;
       Paging.Unmap (Virtual_Address);
       Physical.Unreference_Page_At (Physical_Address_Type (Virtual_Address),
-        Reference_Count_Nul);
+                                    Reference_Count_Nul);
+      if Reference_Count_Nul then
+         null;
+      end if;
    end Remove_Container;

    function Extract_Address (Data_Container : Data_Container_Access)
============================================================
--- src/core/lovelace-tasking-threads.adb	8c79d813e2a1b3343b2feb6aaf1a5a01ca658ed6
+++ src/core/lovelace-tasking-threads.adb	f70a4e2e02df3396d10b1b3ce632c950e479a522
@@ -22,6 +22,7 @@ package body Lovelace.Tasking.Threads is
    procedure Set_Current (Thr : Kthread_Ptr);
    procedure Switch_To_Next_Thread (Operation : Switch_Type);
    procedure Delete_Thread (Thr : in out Kthread_Ptr);
+   pragma Convention (C, Delete_Thread);
    procedure Sleep_Timeout (Act : Time.Timeout_Action_Ptr);

    procedure Set_Current (Thr : Kthread_Ptr) is
@@ -289,7 +290,7 @@ package body Lovelace.Tasking.Threads is
       Force_Unblock (Sleep_Timeout_Params.Thread_To_Wakeup);
    end Sleep_Timeout;

-   procedure Force_Unblock (Kthread : in out Kthread_Ptr) is
+   procedure Force_Unblock (Kthread : in Kthread_Ptr) is
       Flags : Unsigned_32 := 0;
       EINVAL, EFATAL : exception;
    begin
============================================================
--- src/core/lovelace-tasking-threads.ads	d20cedc048fc86ae3769ea9c0ad804436b09eb99
+++ src/core/lovelace-tasking-threads.ads	a2108ac0d31696cc408d65041153b53579596189
@@ -17,10 +17,11 @@ package Lovelace.Tasking.Threads is
    procedure Yield;
    procedure Exit_Thread (Dummy_Arg : in out System.Address);
    pragma No_Return (Exit_Thread);
+   pragma Convention (C, Exit_Thread);

    procedure Sleep (Delay_Arg : in out Time.Time_Type);

-   procedure Force_Unblock (Kthread : in out Kthread_Ptr);
+   procedure Force_Unblock (Kthread : in Kthread_Ptr);
    function Get_State (Kthread : Kthread_Ptr) return Kthread_State;
    function Get_Current return Kthread_Ptr;
    function Get_Current_Without_Test return Kthread_Ptr;
============================================================
--- src/core/lovelace-time.adb	850de3b3dfdcb15d1f0db786c7b8d057e9366694
+++ src/core/lovelace-time.adb	963f8adff3cc8cf062eea17cfb321da68955d4ff
@@ -131,8 +131,8 @@ package body Lovelace.Time is
       return Tm.Sec = 0 and Tm.Nanoseconds = 0;
    end Time_Is_Zero;

-   procedure Remove_Action (Act : in out Timeout_Action_Ptr);
-   procedure Remove_Action (Act : in out Timeout_Action_Ptr) is
+   procedure Remove_Action (Act : in Timeout_Action_Ptr);
+   procedure Remove_Action (Act : in Timeout_Action_Ptr) is
       EINVAL : exception;
    begin
       if not Act.In_List then
@@ -159,12 +159,12 @@ package body Lovelace.Time is
       Act.In_List := False;
    end Remove_Action;

-   procedure Add_Action (Act : in out Timeout_Action_Ptr;
+   procedure Add_Action (Act : in Timeout_Action_Ptr;
                          Due_Date : Time_Type;
                          Is_Relative_Due_Date : Boolean;
                          Routine : Timeout_Routine;
                          Routine_Data : System.Address);
-   procedure Add_Action (Act : in out Timeout_Action_Ptr;
+   procedure Add_Action (Act : in Timeout_Action_Ptr;
                          Due_Date : Time_Type;
                          Is_Relative_Due_Date : Boolean;
                          Routine : Timeout_Routine;
@@ -209,7 +209,7 @@ package body Lovelace.Time is
                                      New_Item => Act);
    end Add_Action;

-   procedure Register_Action_Relative (Act : in out Timeout_Action_Ptr;
+   procedure Register_Action_Relative (Act : in Timeout_Action_Ptr;
                                        Delay_Arg : Time_Type;
                                        Routine : Timeout_Routine;
                                        Routine_Data : System.Address) is
@@ -221,7 +221,7 @@ package body Lovelace.Time is
       Stage1.Interrupts.Restore_IRQs (Flags);
    end Register_Action_Relative;

-   procedure Unregister_Action (Act : in out Timeout_Action_Ptr) is
+   procedure Unregister_Action (Act : in Timeout_Action_Ptr) is
       Flags : Unsigned_32 := 0;
    begin
       Stage1.Interrupts.Disable_IRQs (Flags);
============================================================
--- src/core/lovelace-time.ads	8d5807dcf495eb90e5d25fb4d133b143f1608558
+++ src/core/lovelace-time.ads	42e1e7508058b8177c8421b8dd6f60dab9c4ea15
@@ -38,10 +38,10 @@ package Lovelace.Time is
    function Get_Tick_Resolution return Time_Type;
    procedure Set_Tick_Resolution (Resolution : Time_Type);
    function Get_Now return Time_Type;
-   procedure Register_Action_Relative (Act : in out Timeout_Action_Ptr;
+   procedure Register_Action_Relative (Act : in Timeout_Action_Ptr;
                                        Delay_Arg : Time_Type;
                                        Routine : Timeout_Routine;
                                        Routine_Data : System.Address);
-   procedure Unregister_Action (Act : in out Timeout_Action_Ptr);
+   procedure Unregister_Action (Act : in Timeout_Action_Ptr);
    procedure Do_Tick;
 end Lovelace.Time;