[freenos] push by nieklinn...@xxxxxxxxx - Restructure SCons build scripts. Introducing new SCons configuration i... on 2015-01-19 20:02 GMT

  • From: freenos@xxxxxxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Mon, 19 Jan 2015 20:03:03 +0000

Revision: 3f7625fec70b
Author:   Niek Linnenbank <nieklinnenbank@xxxxxxxxx>
Date:     Mon Jan 19 19:58:13 2015 UTC
Log: Restructure SCons build scripts. Introducing new SCons configuration in conf/. Replacing Prepare().

https://code.google.com/p/freenos/source/detail?r=3f7625fec70b

Added:
 /build.conf
 /config/x86/pc/clang.conf
 /config/x86/pc/gcc.conf
 /config/x86/pc/kernel.ld
 /config/x86/pc/user.ld
 /include/x86/API.h
 /include/x86/BootImage.h
 /include/x86/ByteOrder.h
 /include/x86/CPU.h
 /include/x86/Init.h
 /include/x86/Interrupt.h
 /include/x86/Kernel.h
 /include/x86/Memory.h
 /include/x86/Multiboot.h
 /include/x86/Process.h
 /include/x86/Scheduler.h
 /include/x86/Support.h
 /site_scons/archive.py
 /site_scons/autoconf.py
 /site_scons/binary.py
 /site_scons/bootimage.py
 /site_scons/gdbinit.py
 /site_scons/phony.py
Deleted:
 /include/X86/API.h
 /include/X86/BootImage.h
 /include/X86/ByteOrder.h
 /include/X86/CPU.h
 /include/X86/Init.h
 /include/X86/Interrupt.h
 /include/X86/Kernel.h
 /include/X86/Memory.h
 /include/X86/Multiboot.h
 /include/X86/Process.h
 /include/X86/Scheduler.h
 /include/X86/Support.h
 /kernel/X86/kernel.ld
 /kernel/X86/user.ld
 /lib/libteken/gensequences
 /site_scons/configure.py
 /site_scons/dist.py
 /site_scons/emulate.py
 /site_scons/ext2.py
 /site_scons/img.py
 /site_scons/linn.py
 /site_scons/pci.py
Modified:
 /.gitignore
 /SConstruct
 /VERSION
 /bin/bench/SConscript
 /bin/cat/SConscript
 /bin/echo/SConscript
 /bin/hostname/SConscript
 /bin/ls/SConscript
 /bin/memstat/SConscript
 /bin/mknod/SConscript
 /bin/mount/SConscript
 /bin/parse/SConscript
 /bin/ps/SConscript
 /bin/sh/SConscript
 /bin/stat/SConscript
 /bin/touch/SConscript
 /bin/uname/SConscript
 /lib/liballoc/PoolAllocator.h
 /lib/liballoc/SConscript
 /lib/libc/SConscript
 /lib/libcrt/Runtime.cpp
 /lib/libcrt/SConscript
 /lib/libexec/SConscript
 /lib/libparse/SConscript
 /lib/libposix/SConscript
 /lib/libteken/SConscript
 /site_scons/build.py
 /site_scons/checksum.py
 /site_scons/iso.py
 /site_scons/version.py

=======================================
--- /dev/null
+++ /build.conf Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+VERSION   = '0.1.0'
+ARCH      = 'x86'
+SYSTEM    = 'pc'
+COMPILER  = 'config/' + ARCH + '/' + SYSTEM + '/gcc.conf'
+BUILDROOT = 'build/'  + ARCH + '/' + SYSTEM
+VERBOSE   = 'False'
+
=======================================
--- /dev/null
+++ /config/x86/pc/clang.conf   Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+CC        = 'clang'
+AS        = 'clang'
+LD        = 'clang'
+CCFLAGS   = [ '-m32', '-Wall', '-nostdinc',
+             '-fno-builtin', '-fno-stack-protector', '-g3', '-ansi',
+              '-fno-rtti', '-fno-exceptions' ]
+ASFLAGS   = [ '-m32', '-Wall', '-nostdinc' ]
+LINKFLAGS = [ '-m32', '-static', '-nostdlib', '-nostartfiles', '-nodefaultlibs', '-Wl,-whole-archive' ]
+LINKUSER  = [ '-T', 'config/x86/pc/user.ld' ]
+LINKKERN  = [ '-T', 'config/x86/pc/kernel.ld' ]
+CPPPATH   = [ '#include' ]
+
=======================================
--- /dev/null
+++ /config/x86/pc/gcc.conf     Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+CC        = 'gcc'
+AS        = 'gcc'
+LD        = 'gcc'
+CCFLAGS   = [ '-m32', '-Wall', '-nostdinc',
+             '-fno-stack-protector', '-fno-builtin', '-g3', '-ansi',
+             '-fno-rtti', '-fno-exceptions' ]
+ASFLAGS   = [ '-m32', '-Wall', '-nostdinc' ]
+LINKFLAGS = [ '-m32', '-static', '-nostdlib', '-nostartfiles',
+             '-nodefaultlibs', '-Wl,-whole-archive' ]
+LINKUSER  = [ '-T', 'config/x86/pc/user.ld' ]
+LINKKERN  = [ '-T', 'config/x86/pc/kernel.ld' ]
+CPPPATH   = [ '#include' ]
+
=======================================
--- /dev/null
+++ /config/x86/pc/kernel.ld    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ENTRY(_start)
+TARGET("elf32-i386")
+OUTPUT_FORMAT("elf32-i386")
+
+phys = 0x00100000;
+virt = 0x00100000;
+
+SECTIONS
+{
+    . = 0x00100000;
+    kernelStart = .;
+
+    /DISCARD/ :
+    {
+        *(.note.gnu.build-id)
+    }
+
+    .text virt : AT(phys)
+    {
+       code = .;
+       *(.text)
+       *(*.text)
+       *(.gnu.linkonce.*)
+       *(.rodata)
+       *(.rodata.*)
+       *(.eh_frame)
+       . = ALIGN(4096);
+    }
+
+    .data : AT (phys + (data - code))
+    {
+       data = .;
+       *(.data)
+
+        CTOR_LIST = .;
+       KEEP (*(SORT(.ctors.*)))
+       KEEP (*(.ctors))
+       LONG(0)
+        CTOR_END = .;
+
+        DTOR_LIST = .;
+       KEEP (*(SORT(.dtors.*)))
+       KEEP (*(.dtors))
+        LONG(0)
+        DTOR_END = .;
+       . += 4;
+
+       initStart = .;
+       KEEP (*(SORT(.init*)))
+       initEnd   = .;
+       . = ALIGN(4096);
+    }
+
+    .bss : AT(phys + (bss - code))
+    {
+       bss = .;
+       *(.bss)
+       *(.bss.*)
+       *(COMMON)
+
+        . += 4;
+       kernelEnd = .;
+
+       . = 0x00400000;
+    }
+}
=======================================
--- /dev/null
+++ /config/x86/pc/user.ld      Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,57 @@
+/**
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ENTRY(_entry)
+TARGET("elf32-i386")
+OUTPUT_FORMAT("elf32-i386")
+
+SECTIONS
+{
+    . = 0x80000000;
+
+    .text :
+    {
+       *(.entry)
+       *(.text)
+       *(*.text)
+       *(.gnu.linkonce.*)
+       *(.data)
+       *(.rodata)
+       *(.rodata.*)
+       *(.eh_frame)
+
+       . = ALIGN(4);
+        CTOR_LIST = .;
+       KEEP (*(SORT(.ctors.*)))
+       KEEP (*(.ctors))
+       LONG(0)
+        CTOR_END = .;
+
+        DTOR_LIST = .;
+       KEEP (*(SORT(.dtors.*)))
+       KEEP (*(.dtors))
+        LONG(0)
+        DTOR_END = .;
+       . += 4;
+
+       initStart = .;
+       KEEP (*(SORT(.init*)))
+       KEEP (*(.init*))
+       initEnd   = .;
+       *(.bss)
+    }
+}
=======================================
--- /dev/null
+++ /include/x86/API.h  Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __X86_API_H
+#define __X86_API_H
+
+#include <Types.h>
+#include <kernel/API.h>
+
+/**
+ * @defgroup x86kernel kernel (x86)
+ * @{
+ */
+
+/**
+ * Perform a kernel trap with 1 argument.
+ * @param num Unique number of the handler to execute.
+ * @param arg1 First argument becomes ECX.
+ * @return An integer.
+ */
+inline ulong trapKernel1(ulong num, ulong arg1)
+{
+    ulong ret;
+    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1));
+    return ret;
+}
+
+/**
+ * Perform a kernel trap with 3 arguments.
+ * @param num Unique number of the handler to execute.
+ * @param arg1 First argument becomes ECX.
+ * @param arg2 Second argument becomes EBX.
+ * @param arg3 Third argument becomes EDX.
+ * @return An integer.
+ */
+inline ulong trapKernel3(ulong num, ulong arg1, ulong arg2, ulong arg3)
+{
+    ulong ret;
+    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1), "b"(arg2),
+                                           "d"(arg3));
+    return ret;
+}
+
+/**
+ * Perform a kernel trap with 4 arguments.
+ * @param num Unique number of the handler to execute.
+ * @param arg1 First argument becomes ECX.
+ * @param arg2 Second argument becomes EBX.
+ * @param arg3 Third argument becomes EDX.
+ * @param arg4 Fourth argument becomes ESI.
+ * @return An integer.
+ */
+inline ulong trapKernel4(ulong num, ulong arg1, ulong arg2, ulong arg3,
+                        ulong arg4)
+{
+    ulong ret;
+    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1), "b"(arg2),
+                                           "d"(arg3), "S"(arg4));
+    return ret;
+}
+
+/**
+ * Perform a kernel trap with 5 arguments.
+ * @param num Unique number of the handler to execute.
+ * @param arg1 First argument becomes ECX.
+ * @param arg2 Second argument becomes EBX.
+ * @param arg3 Third argument becomes EDX.
+ * @param arg4 Fourth argument becomes ESI.
+ * @param arg5 Fifth argument becomes EDI.
+ * @return An integer.
+ */
+inline ulong trapKernel5(ulong num, ulong arg1, ulong arg2, ulong arg3,
+                        ulong arg4, ulong arg5)
+{
+    ulong ret;
+    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1), "b"(arg2),
+                                "d"(arg3), "S"(arg4), "D"(arg5));
+    return ret;
+}
+
+/**
+ * @}
+ */
+
+#endif /* __X86_API_H */
=======================================
--- /dev/null
+++ /include/x86/BootImage.h    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,1 @@
+../kernel/BootImage.h
=======================================
--- /dev/null
+++ /include/x86/ByteOrder.h    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,1 @@
+../kernel/ByteOrder.h
=======================================
--- /dev/null
+++ /include/x86/CPU.h  Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,250 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __X86_CPU_H
+#define __X86_CPU_H
+
+/**
+ * @defgroup x86kernel kernel (x86)
+ * @{
+ */
+
+/** Intel is little endian. */
+#define CPU_LITTLE_ENDIAN      1
+
+#if !defined(__HOST__)
+
+/** Paged Mode. */
+#define CR0_PG         0x80000000
+
+/** Timestamp Counter Disable. */
+#define CR4_TSD                0x00000004
+
+/** Kernel Code Segment. */
+#define KERNEL_CS       1
+#define KERNEL_CS_SEL   0x8
+
+/** System Data Segment. */
+#define KERNEL_DS       2
+#define KERNEL_DS_SEL   0x10
+
+/** User Code Segment. */
+#define USER_CS         3
+#define USER_CS_SEL     (0x18 | 3)
+
+/** User Data Segment. */
+#define USER_DS         4
+#define USER_DS_SEL     (0x20 | 3)
+
+/** User TSS. */
+#define USER_TSS        5
+#define USER_TSS_SEL    0x28
+
+#ifndef __ASSEMBLER__
+
+#include <Types.h>
+#include <Macros.h>
+
+/**
+ * Retrieve the IRQ number from CPUState.
+ * @return IRQ number.
+ */
+#define IRQ_REG(state) \
+    ((state)->vector - 0x20)
+
+/**
+ * Reads the CPU's timestamp counter.
+ * @return 64-bit integer.
+ */
+#define timestamp() \
+    ({ \
+       u64 low = 0, high = 0; \
+       asm volatile ("rdtsc\n" \
+                     "movl %%eax, %0\n" \
+                     "movl %%edx, %1\n" : "=r"(low), "=r"(high)); \
+       (u64) (high << 32) | (low); \
+    })
+
+/**
+ * Reboot the system (by sending the a reset signal on the keyboard I/O port)
+ */
+#define reboot() \
+    outb(0x64, 0xfe)
+
+/**
+ * Shutdown the machine via ACPI.
+ * @note We do not have ACPI yet. Shutdown now has a bit naive implementation.
+ * @see http://forum.osdev.org/viewtopic.php?t=16990
+ */
+#define shutdown() \
+    outw(0xB004, 0x0 | 0x2000)
+
+/**
+ * Puts the CPU in a lower power consuming state.
+ */
+#define idle() \
+    asm volatile ("hlt");
+
+/**
+ * Loads the Task State Register (LTR) with the given segment.
+ * @param sel TSS segment selector.
+ */
+#define ltr(sel) \
+({ \
+    u16 tr = sel; \
+    asm volatile ("ltr %0\n" :: "r"(tr)); \
+})
+
+/**
+ * Read a byte from a port.
+ * @param port The I/O port to read from.
+ * @return A byte read from the port.
+ */
+#define inb(port) \
+({ \
+    unsigned char b; \
+    asm volatile ("inb %%dx, %%al" : "=a" (b) : "d" (port)); \
+    b; \
+})
+
+/**
+ * Read a word from a port.
+ * @param port The I/O port to read from.
+ * @return Word read from the port.
+ */
+#define inw(port) \
+({ \
+    unsigned short w; \
+    asm volatile ("inw %%dx, %%ax" : "=a" (w) : "d" (port)); \
+    w; \
+})
+
+/**
+ * Output a byte to a port.
+ * @param port Port to write to.
+ * @param byte The byte to output.
+ */
+#define outb(port,byte) \
+    asm volatile ("outb %%al,%%dx"::"a" (byte),"d" (port))
+
+/**
+ * Output a word to a port.
+ * @param port Port to write to.
+ * @param byte The word to output.
+ */
+#define outw(port,word) \
+    asm volatile ("outw %%ax,%%dx"::"a" (word),"d" (port))
+
+/**
+ * Output a long to a I/O port.
+ * @param port Target I/O port.
+ * @param l The long 32-bit number to output.
+ */
+#define outl(port,l) \
+    asm volatile ("outl %%eax,%%dx"::"a" (l),"d" (port))
+
+/** I/O bitmap. */
+extern Address kernelioBitMap[1024];
+
+#ifdef CPP
+
+/**
+ * Intel's Task State Segment.
+ */
+typedef struct TSS
+{
+    /**
+     * (Un)mask the appropriate bit to (dis)allow direct I/O.
+     * @param port I/O port.
+     * @param enabled Allow or disallow a port.
+     * @param bitmap Pointer to the bitmap.
+     */
+    void setPort(u16 port, bool enabled, u8 *bitmap)
+    {
+       if (enabled)
+           bitmap[(port / 8)] &= ~(1 << (port % 8));
+       else
+           bitmap[(port / 8)] |=  (1 << (port % 8));
+    }
+
+    u32 backlink;
+    u32 esp0, ss0;
+    u32 esp1, ss1;
+    u32 esp2, ss2;
+    u32 cr3;
+    u32 eip;
+    u32 eflags;
+    u32 eax,ecx,edx,ebx;
+    u32 esp, ebp;
+    u32 esi, edi;
+    u32 es, cs, ss, ds, fs, gs;
+    u32 ldt;
+    u32 bitmap;
+}
+TSS;
+
+/**
+ * Segment descriptor used in the GDT.
+ */
+typedef struct Segment
+{
+    u32 limitLow:16;
+    u32 baseLow:16;
+    u32 baseMid:8;
+    u32 type:5;
+    u32 privilege:2;
+    u32 present:1;
+    u32 limitHigh:4;
+    u32 granularity:4;
+    u32 baseHigh:8;
+}
+Segment;
+
+/**
+ * Contains all the CPU registers.
+ */
+typedef struct CPUState
+{
+    /* Segments. */
+    u32 gs, fs, es, ds, ss0;
+
+    /* By pusha */
+    u32 edi, esi, ebp, esp0, ebx, edx, ecx, eax;
+
+    /* Vector/error arguments. */
+    u32 vector, error;
+
+    /* Pushed by processor. */
+    u32 eip, cs, eflags, esp3, ss3;
+}
+CPUState;
+
+/** Global Descriptor Table. */
+extern Segment gdt[];
+
+/** Task State Segment. */
+extern TSS kernelTss;
+
+#endif /* CPP */
+
+/**
+ * @}
+ */
+
+#endif /* __ASSEMBLER__ */
+#endif /* !defined(__HOST__) && !defined(CPP) */
+#endif /* __X86_CPU_H */
=======================================
--- /dev/null
+++ /include/x86/Init.h Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,1 @@
+../kernel/Init.h
=======================================
--- /dev/null
+++ /include/x86/Interrupt.h    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __X86_INTERRUPT_H
+#define __X86_INTERRUPT_H
+
+#include "CPU.h"
+#include <Types.h>
+#include <Macros.h>
+
+/**
+ * @defgroup x86kernel kernel (x86)
+ * @{
+ */
+
+/**
+ * Enables interrupts.
+ */
+#define sti() \
+    asm volatile ("sti")
+
+/**
+ * Disables interrupts.
+ */
+#define cli() \
+    asm volatile ("cli");
+
+/**
+ * Explicitely enable interrupts.
+ */
+#define irq_enable() \
+    sti()
+
+/**
+ * Disable interrupts, and store current interrupt state.
+ * @warning This is dangerous: no guarantee of the current stack state.
+ */
+#define irq_disable()                          \
+({                                             \
+    ulong ret;                                 \
+                                               \
+    asm volatile ("pushfl\n"                 \
+                 "popl %0" : "=g" (ret) :);        \
+    cli();                                     \
+    ret;                                       \
+})
+
+/**
+ * Restore the previous interrupt state.
+ * @warning This is dangerous: no guarantee of the current stack state.
+ */
+#define irq_restore(saved)                     \
+    asm volatile ("push %0\n"                        \
+                 "popfl\n" :: "g" (saved))
+
+/**
+ * We remap IRQ's to interrupt vectors 32-47.
+ */
+#define IRQ(vector) \
+    (vector) + 32
+
+/**
+ * Function which is called when the CPU is interrupted.
+ * @param state State of the CPU on the moment the interrupt occurred.
+ * @param param Optional parameter for the handler.
+ */
+typedef void InterruptHandler(CPUState *state, ulong param);
+
+/**
+ * Interrupt hook class.
+ */
+typedef struct InterruptHook
+{
+    /**
+     * Constructor function.
+     * @param h Handler function for the hook.
+     * @param p Parameter to pass.
+     */
+    InterruptHook(InterruptHandler *h, ulong p) : handler(h), param(p)
+    {
+    }
+
+    /**
+     * Comparision operator.
+     * @param i InterruptHook pointer.
+     * @return True if equal, false otherwise.
+     */
+    bool operator == (InterruptHook *i)
+    {
+       return handler == i->handler && param == i->param;
+    }
+
+    /** Executed at time of interrupt. */
+    InterruptHandler *handler;
+
+    /** Passed to the handler. */
+    ulong param;
+}
+InterruptHook;
+
+/**
+ * Called by assembler routine invokeHandler() in boot.S.
+ * @param state CPU registers pushed on the stack.
+ */
+extern C void executeInterrupt(CPUState state);
+
+/**
+ * @}
+ */
+
+#endif /* __X86_INTERRUPT_H */
=======================================
--- /dev/null
+++ /include/x86/Kernel.h       Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __X86_KERNEL_H
+#define __X86_KERNEL_H
+
+#ifndef __ASSEMBLY__
+
+#include <kernel/Kernel.h>
+#include <Singleton.h>
+#include <Types.h>
+#include "Interrupt.h"
+#include "CPU.h"
+
+/**
+ * @defgroup x86kernel kernel (x86)
+ * @{
+ */
+
+/** IO base address for master PIC */
+#define PIC1_CMD        0x20
+
+/** IO base address for slave PIC */
+#define PIC2_CMD        0xa0
+
+/* Master PIC data port */
+#define PIC1_DATA       0x21
+
+/* Slave PIC data port */
+#define PIC2_DATA       0xa1
+
+/** End of Interrupt (EOI). */
+#define PIC_EOI                0x20
+
+/** Base of IRQ's from the PIC's. */
+#define PIC_IRQ_BASE   0x20
+
+/** PIT maximum frequency. */
+#define PIT_FREQUENCY   1193182
+
+/** PIT IRQ interval. */
+#define PIT_HZ         250
+
+/** PIT divisor. */
+#define PIT_DIVISOR    (PIT_FREQUENCY / PIT_HZ)
+
+/** PIT command port. */
+#define PIT_CMD                0x43
+
+/** PIT channel zero. */
+#define PIT_CHAN0      0x40
+
+/**
+ * Implements an x86 compatible kernel.
+ */
+class X86Kernel : public Kernel, public Singleton<X86Kernel>
+{
+    public:
+
+        /**
+         * Constructor function.
+         */
+       X86Kernel();
+
+       /**
+        * Hooks a function to an hardware interrupt.
+        * @param vec Interrupt vector to hook on.
+        * @param h Handler function.
+        * @param p Parameter to pass to the handler function.
+        */
+       void hookInterrupt(int vec, InterruptHandler h, ulong p);
+
+        /**
+         * Uses the PIC to (un)mask an IRQ.
+         * @param vector Interrupt vector.
+         * @param enabled Either to mask (true) or unmask (false).
+         */
+        void enableIRQ(uint vector, bool enabled);
+
+    private:
+
+       /**
+         * Called when the CPU detects a fault.
+ * @param state Contains CPU registers, interrupt vector and error code.
+         * @param param Not used.
+         */
+        static void exception(CPUState *state, ulong param);
+
+       /**
+         * Default interrupt handler.
+ * @param state Contains CPU registers, interrupt vector and error code.
+         * @param param Not used.
+         */
+        static void interrupt(CPUState *state, ulong param);
+
+       /**
+        * Kernel trap handler (system calls).
+ * @param state Contains the arguments for the APIHandler, in CPU registers.
+        * @param param Not used.
+        */
+       static void trap(CPUState *state, ulong param);
+
+       /**
+         * i8253 system clock interrupt handler.
+         * @param state CPU registers on time of interrupt.
+        * @param param Not used.
+         */
+       static void clocktick(CPUState *state, ulong param);
+
+       /** Amount of i8253 ticks (interrupts) counted so far. */
+       Size ticks;
+};
+
+/** Points to the kernel. */
+extern X86Kernel *kernel;
+
+/**
+ * @}
+ */
+
+#endif /* __ASSEMBLY__ */
+#endif /* __X86_CPU_H */
=======================================
--- /dev/null
+++ /include/x86/Memory.h       Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __X86_MEMORY_H
+#define __X86_MEMORY_H
+
+/**
+ * @defgroup x86kernel kernel (x86)
+ * @{
+ */
+
+#ifdef __ASSEMBLER__
+#define ADDRESS
+#define ADDRESSP
+#else
+#define ADDRESS          (Address)
+#define ADDRESSP  (Address *)
+#endif
+
+/** Page entry bit shift. */
+#define PAGESHIFT       12
+
+/** Page table bit shift. */
+#define DIRSHIFT        22
+
+/** Intel uses 4K pages. */
+#define PAGESIZE        4096
+
+/** Number of entries in the page directory. */
+#define PAGEDIR_MAX    1024
+
+/** Number of entries in a page table. */
+#define PAGETAB_MAX    1024
+
+/** Mask to find the page. */
+#define PAGEMASK        0xfffff000
+
+/** Memory address alignment. */
+#define MEMALIGN       4
+
+/** Marks a page entry present. */
+#define PAGE_PRESENT    1
+
+/** Marks a page entry read/write. */
+#define PAGE_RW         2
+
+/** Marks a page accessible by user programs (ring 3). */
+#define PAGE_USER       4
+
+/** Pinned pages cannot be released. */
+#define PAGE_PINNED    (1 << 9)
+
+/** This page has been marked for temporary operations. */
+#define PAGE_MARKED    (1 << 10)
+
+/** Page has been reserved for future use. */
+#define PAGE_RESERVED  (1 << 11)
+
+/** We map page tables into virtual memory, at a fixed address. */
+#define PAGETABFROM            ADDRESS (1024 * 1024 * 4)
+
+/** Address space for modifing remote page tables. */
+#define PAGETABFROM_REMOTE     ADDRESS (1024 * 1024 * 8)
+
+/** Address space for userspace pagetable mapping. */
+#define PAGEUSERFROM           ADDRESS (1024 * 1024 * 12)
+
+/**
+ * Entry inside the page directory of a given virtual address.
+ * @param vaddr Virtual Address.
+ * @return Index of the corresponding page directory entry.
+ */
+#define DIRENTRY(vaddr) \
+    ((ADDRESS vaddr) >> DIRSHIFT)
+
+/**
+ * Entry inside the page table of a given virtual address.
+ * @param vaddr Virtual Address.
+ * @return Index of the corresponding page table entry.
+ */
+#define TABENTRY(vaddr) \
+    (((ADDRESS vaddr) >> PAGESHIFT) & 0x3ff)
+
+/**
+ * Compute the virtual address of the page table, for a given vaddr.
+ * @param vaddr Virtual address.
+ * @param from Address of the first page table.
+ * @return Address pointer to the page table for vaddr.
+ */
+#define PAGETABADDR_FROM(vaddr,from) \
+    ADDRESSP (((((vaddr) >> (PAGESHIFT)) * 4) + (from)) & PAGEMASK)
+
+/**
+ * Compute the virtual address of the page table, for a given vaddr.
+ * @param vaddr Virtual address.
+ * @return Address pointer of the page table for vaddr.
+ */
+#define PAGETABADDR(vaddr) \
+    PAGETABADDR_FROM(vaddr, PAGETABFROM)
+
+/**
+ * Virtual address pointing to the page directory.
+ */
+#define PAGEDIRADDR \
+    PAGETABADDR(PAGETABFROM)
+
+/**
+ * Virtual address pointer to the page directory.
+ * @param from Address of the first page table.
+ * @return Address pointer to the page directory table.
+ */
+#define PAGEDIRADDR_FROM(from) \
+    PAGETABADDR_FROM(PAGETABFROM, from)
+
+#define PAGEDIRADDR_REMOTE \
+    PAGETABADDR_FROM(PAGETABFROM, PAGETABFROM_REMOTE)
+
+#ifndef __ASSEMBLER__
+#ifndef __HOST__
+
+/**
+ * Flushes the Translation Lookaside Buffers (TLB) for a single page.
+ * @param addr Memory address to flush.
+ */
+#define tlb_flush(addr) \
+    asm volatile("invlpg (%0)" ::"r" (addr) : "memory")
+
+/**
+ * Flushes all Translation Lookaside Buffers (TLB).
+ */
+#define tlb_flush_all() \
+    asm volatile("mov %cr3, %eax\n" \
+                "mov %eax, %cr3\n")
+
+#include <kernel/Memory.h>
+#include <Singleton.h>
+#include "Process.h"
+#include <Types.h>
+#include <Macros.h>
+
+/**
+ * x86 Virtual Memory.
+ */
+class X86Memory : public Memory, public Singleton<X86Memory>
+{
+    public:
+
+       /**
+        * Constructor function.
+        */
+       X86Memory();
+
+       /**
+ * Map a physical page to a virtual address, using intel's paged virtual memory.
+        * @param paddr Physical address.
+        * @param vaddr Virtual address.
+        * @param prot Page entry protection flags.
+        * @return Mapped virtual address.
+        */
+       Address mapVirtual(Address paddr, Address vaddr = ZERO,
+                          ulong prot = PAGE_PRESENT | PAGE_RW);
+
+       /**
+ * Map a physical page to a virtual address, using intel's paged virtual memory.
+        * @param p Process to map memory for.
+        * @param paddr Physical address.
+        * @param vaddr Virtual address.
+        * @param prot Page entry protection flags.
+        * @return Mapped virtual address.
+        */
+       Address mapVirtual(X86Process *p, Address paddr,
+                          Address vaddr, ulong prot = PAGE_PRESENT | PAGE_RW);
+
+        /**
+         * Lookup a pagetable entry for the given (remote) virtual address.
+         * @param p Target process.
+        * @param vaddr Virtual address to lookup.
+        * @return Page table entry if vaddr is mapped, or ZERO if not.
+        */
+       Address lookupVirtual(X86Process *p, Address vaddr);
+
+       /**
+        * Verify protection access flags in the page directory and page table.
+        * @param p Target process to verify protection bits for.
+        * @param vaddr Virtual address.
+        * @param sz Size of the byte range to check.
+        * @return True if the current process has access, false otherwise.
+        */
+       bool access(X86Process *p, Address vaddr, Size sz,
+                   ulong prot = PAGE_PRESENT|PAGE_RW|PAGE_USER);
+
+        /**
+ * Marks all physical pages used by a process as free (if not pinned).
+         * @param p Target process.
+         */
+       void releaseAll(ArchProcess *p);
+
+       /**
+        * Maps remote pages into the current process.
+        * @param p Other process for which we map tables.
+        * @param pageTabAddr Point page table pointer for this address.
+ * @param pageDirAddr Map the remote page remote directory on this address.
+        * @param prot Extra memory protection flags for the mapping.
+        */
+       void mapRemote(X86Process *p, Address pageTabaddr,
+                      Address pageDirAddr = (Address) PAGEDIRADDR_REMOTE,
+                      ulong prot = ZERO);
+
+    private:
+
+       /**
+        * Find a free virtual page.
+        * @param pageTabFrom Address of the first page table.
+        * @param pageDirAddr Pointer to the page directory to use.
+        * @return Free virtual address, if any.
+        */
+       Address findFree(Address pageTabFrom, Address *pageDir);
+
+
+       /** Remote page directory and page tables. */
+       Address *remPageDir, *remPageTab;
+
+       /** Local (i.e. currently executing process) page directory and tables. 
*/
+       Address *myPageDir, *myPageTab;
+};
+
+/** Instance of Intel memory. */
+extern X86Memory *memory;
+
+/** Kernel page directory. */
+extern Address kernelPageDir[1024], kernelPageTab[1024];
+
+#endif /* __HOST__ */
+#endif /* __ASSEMBLER__ */
+
+/**
+ * @}
+ */
+
+#endif /* __X86_MEMORY_H */
=======================================
--- /dev/null
+++ /include/x86/Multiboot.h    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,1 @@
+../kernel/Multiboot.h
=======================================
--- /dev/null
+++ /include/x86/Process.h      Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __X86_PROCESS_H
+#define __X86_PROCESS_H
+
+/**
+ * @defgroup x86kernel kernel (x86)
+ * @{
+ */
+
+#ifndef __ASSEMBLY__
+#ifdef  __cplusplus
+
+/**
+ * Used by kernel/ classes to point back to us.
+ */
+#define ArchProcess X86Process
+class ArchProcess;
+
+#include <kernel/Process.h>
+#include "CPU.h"
+#include "Memory.h"
+#include <Types.h>
+
+/**
+ * Process which may execute on an Intel x86 CPU.
+ */
+class X86Process : public Process
+{
+    public:
+
+        /**
+         * Constructor function.
+        * @param entry Initial EIP register value.
+         */
+       X86Process(Address entry);
+
+       /**
+        * Destructor function.
+        */
+       ~X86Process();
+
+       /**
+        * (Dis)allows a process direct I/O to a port.
+        * @param port I/O port.
+        * @param enabled (Dis)allow access.
+        */
+       void IOPort(u16 port, bool enabled);
+
+       /**
+        * Save and restore registers, then perform a context switch.
+        */
+       void execute();
+
+       /**
+        * Get the address of our page directory.
+        * @return Page directory address.
+        */
+       Address getPageDirectory()
+       {
+           return pageDirAddr;
+       }
+
+       /**
+        * Get the address of our stack.
+        * @return Stack address.
+        */
+       Address getStack()
+       {
+           return stackAddr;
+       }
+
+       /**
+        * Sets the address of our stack.
+        * @param addr New stack address.
+        */
+       void setStack(Address addr)
+       {
+           stackAddr = addr;
+       }
+
+    private:
+
+       /** Page Directory physical address. */
+       Address pageDirAddr;
+
+       /** Current stack pointer. */
+       Address stackAddr;
+
+       /** Kernel stack pointer. */
+       Address kernelStackAddr;
+
+       /** I/O bitmap physical address. */
+       Address ioMapAddr;
+};
+
+/**
+ * Assembly routine which performs context switches.
+ * @param oldStackPtr Pointer to the stackAddr of the currently running X86Process, if any.
+ * @param pageDirAddr Address of the page directory.
+ * @param stackAddr Address of the user stack.
+ * @param kernelTss Pointer to the kernel's TSS.
+ * @param kernelStackAddr Address of the kernel stack.
+ * @see TSS
+ * @see contextSwitch.S
+ */
+extern C void contextSwitch(Address *oldStack,  Address pageDirAddr,
+                           Address  stackAddr, TSS *kernelTss,
+                           Address  kernelStackAddr);
+
+#endif /* __cplusplus */
+#endif /* __ASSEMBLY__ */
+
+/**
+ * @}
+ */
+
+#endif /* __X86_PROCESS_H */
=======================================
--- /dev/null
+++ /include/x86/Scheduler.h    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,1 @@
+../kernel/Scheduler.h
=======================================
--- /dev/null
+++ /include/x86/Support.h      Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,1 @@
+../kernel/Support.h
=======================================
--- /dev/null
+++ /site_scons/archive.py      Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,104 @@
+#
+# Copyright 2007 Nicolas Rougier
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+from SCons.Script import *
+from checksum import *
+import os, os.path
+import fnmatch
+import tarfile, zipfile
+import phony
+import build
+
+#
+# Recursively find files in path matching include patterns list
+# and not matching exclude patterns
+#
+def Files (path, include = ['*'],  exclude= []):
+
+    files = []
+    for filename in os.listdir (path):
+        included = False
+        excluded = False
+        for pattern in include:
+            if fnmatch.fnmatch (filename, pattern):
+                included = True
+                for pattern in exclude:
+                    if fnmatch.fnmatch (filename, pattern):
+                        excluded = True
+                        break
+                break
+        if included and not excluded:
+            fullname = os.path.join (path, filename)
+            if os.path.isdir (fullname):
+                files.extend (Files (fullname, include, exclude))
+            else:
+                files.append (fullname)
+    return files
+
+#
+# Make an archive from sources
+#
+def Archive (target, source, env):
+
+    print '  TAR %s' % target
+
+    path = os.path.basename (target)
+    type = os.path.splitext (path)[-1]
+
+    if type == '.tgz' or type == '.gz':
+        archive = tarfile.open (path, 'w:gz')
+        path    = path.split('.tar')[0]
+    elif type == '.bz2':
+        archive = tarfile.open (path, 'w:bz2')
+        path    = path.split('.tar')[0]
+    elif type == '.zip':
+        archive = zipfile.ZipFile (path, 'w')
+        archive.add = archive.write
+        path    = path.split('.zip')[0]
+    else:
+        print "Unknown archive type (%s)" % type
+        return
+
+    src = [str(s) for s in source if str(s) != path]
+    for s in src:
+        archive.add (s, os.path.join (path, s))
+    archive.close()
+
+#
+# Make a FreeNOS source distribution in tar.gz and tar.bz2 format.
+#
+def ReleaseAction(target, source, env):
+
+    inc_list = ['*']
+    exl_list = ['*~', '.*', '*.o', '*.pyc', '*.tar.gz',
+               '*.tar.bz2', '*.zip', 'build']
+
+    Archive ('FreeNOS-' + build.target['VERSION'] + '.tar.gz',
+             Files ('.', include = inc_list, exclude = exl_list), env)
+    Archive ('FreeNOS-' + build.target['VERSION'] + '.tar.bz2',
+             Files ('.', include = inc_list, exclude = exl_list), env)
+    Checksum('FreeNOS-' + build.target['VERSION'] + '.tar.gz.md5',
+            'FreeNOS-' + build.target['VERSION'] + '.tar.gz', env)
+    Checksum('FreeNOS-' + build.target['VERSION'] + '.tar.gz.sha1',
+            'FreeNOS-' + build.target['VERSION'] + '.tar.gz', env)
+    Checksum('FreeNOS-' + build.target['VERSION'] + '.tar.bz2.md5',
+            'FreeNOS-' + build.target['VERSION'] + '.tar.bz2', env)
+    Checksum('FreeNOS-' + build.target['VERSION'] + '.tar.bz2.sha1',
+            'FreeNOS-' + build.target['VERSION'] + '.tar.bz2', env)
+
+phony.Targets(release = SCons.Action.Action(ReleaseAction, None))
+
=======================================
--- /dev/null
+++ /site_scons/autoconf.py     Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,121 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+from SCons.SConf  import *
+from SCons.Script import *
+
+#
+# SConf helper function.
+#
+def TryCompileC(context):
+
+    # Print out a debug message.
+    context.Message('Checking for ' + context.env['TRYFLAG'] + ' ... ')
+
+    # Use the simpelest C program possible.
+    source_file = "int main(int argc, char **argv)" \
+                 "{" \
+                 "    return 0;" \
+                 "}\n"
+
+    # Try to compile and link it.
+    result = context.TryLink(source_file, '.cpp')
+
+    # Return the result status.
+    context.Result(result)
+    return result
+
+#
+# Checks if the compiler in the given environment supports
+# the given command-line CFLAGS, and unsets it if not.
+#
+# Thanks to loonycyborg on #scons for his help!
+#
+def CheckCCFlags(env):
+
+    cflags = env['CCFLAGS'][:]
+
+    # Loop all CFLAGS.
+    for flag in cflags:
+
+       # Setup a temporary environment.
+        conf = Configure(env.Clone(),
+                        custom_tests = { 'TryCompileC' : TryCompileC })
+        conf.env.Replace(CCFLAGS   = flag)
+        conf.env.Replace(LINKFLAGS = flag)
+        conf.env.Replace(TRYFLAG   = flag)
+
+       # Try to link a dummy program.
+       result = conf.TryCompileC()
+
+       # If it failed, mark to remove the CFLAG.
+        if not result:
+           env['CCFLAGS'].remove(flag)
+
+       # Done. Try next.
+        conf.Finish()
+
+#
+# SConf helper function.
+#
+def TryCompileCXX(context):
+
+    # Print out a debug message.
+    context.Message('Checking for ' + context.env['TRYFLAG'] + ' ... ')
+
+    # Use the simpelest C program possible.
+    source_file = "int main(int argc, char **argv)" \
+                 "{" \
+                 "    return 0;" \
+                 "}\n"
+
+    # Try to compile and link it.
+    result = context.TryLink(source_file, '.cpp')
+
+    # Return the result status.
+    context.Result(result)
+    return result
+
+#
+# Checks if the compiler in the given environment supports
+# the given command-line CPPFLAGS, and unsets it if not.
+#
+# Thanks to loonycyborg on #scons for his help!
+#
+def CheckCXXFlags(env):
+
+    cppflags = env['CXXFLAGS'][:]
+
+    # Loop all CPPFLAGS.
+    for flag in cppflags:
+
+       # Setup a temporary environment.
+        conf = Configure(env.Clone(),
+                        custom_tests = { 'TryCompileCXX' : TryCompileCXX })
+        conf.env.Replace(CXXFLAGS  = flag)
+        conf.env.Replace(LINKFLAGS = flag)
+        conf.env.Replace(TRYFLAG   = flag)
+
+       # Try to link a dummy program.
+       result = conf.TryCompileCXX()
+
+       # If it failed, mark to remove the CXXFLAGS.
+        if not result:
+           env['CXXFLAGS'].remove(flag)
+
+       # Done. Try next.
+        conf.Finish()
=======================================
--- /dev/null
+++ /site_scons/binary.py       Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+import os
+import binascii
+
+#
+# Produces an C symbol from a given binary.
+#
+def binary_func(target, source, env):
+
+    # Open source and target files.
+    fin  = open(str(source[0]), "r")
+    fout = open(str(target[0]), "w")
+
+    # Read input file.
+    data   = binascii.hexlify(fin.read())
+    symbol = os.path.basename(str(source[0]))
+    symbol = symbol.replace(".", "_")
+
+    # Output header.
+    fout.write("/*\n" +
+              " * This file is auto-generated from " + str(source[0]) + "\n" +
+              " */\n"
+              "\n"
+              "unsigned char __attribute__((aligned(4096))) " +
+                            "__attribute__((__section__(\".binary\"))) " +
+               symbol + "[] = { ")
+
+    # Loop data.
+    i = 0
+    while i < len(data):
+       fout.write("0x" + data[i] + data[i+1])
+
+       if i < len(data) - 2:
+           fout.write(",")
+       i += 2
+
+    #for i in range(0, len(data)):
+#
+#      fout.write(data[i])
+#
+#      if i < len(data) - 1:
+#          fout.write(",")
+
+    # Output footer.
+    fout.write("};\n\n")
+
+    # All done.
+    fin.close()
+    fin.close()
+
+def binary_str(target, source, env):
+
+    return "  GEN " + str(target[0])
+
+#
+# Add ourselves to the given environment.
+#
+def generate(env):
+
+    builder =  env.Builder(action  = env.Action(binary_func, binary_str))
+    env.Append(BUILDERS = { 'Binary' : builder })
+
+#
+# We always exist.
+#
+def exists(env):
+
+    return True
=======================================
--- /dev/null
+++ /site_scons/bootimage.py    Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,78 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+import os
+import build
+
+#
+# Modifies the dependency list by parsing boot image config.
+#
+def boot_image_emitter(target, source, env):
+
+    # Open boot configuration.
+    f = open(str(source[0]))
+
+    # Loop all lines.
+    for line in f.readlines():
+
+       # Skip comments, empty lines and subtrees.
+       if len(line.strip()) <= 0 or \
+              line.find('=') != -1 or \
+              line[0] == '{' or \
+              line[0] == '}' or \
+              line[0] == '#':
+           continue
+
+       # Make us depend on the program.
+       source.append('#' + env['BUILDROOT'] + '/' + line.strip())
+
+    # We also depend on the mkimage utility.
+    source.append('#' + build.host['BUILDROOT'] + '/bin/mkimage')
+
+    # All done.
+    f.close()
+    return target, source
+
+#
+# Generate a boot image.
+#
+def boot_image_func(target, source, env):
+
+    # Invoke the mkimage utility to generate a boot image.
+    os.system("build/host/bin/mkimage " +
+             "kernel/" + env['ARCH'] + "/" +
+              env['SYSTEM'] + "/config/boot_image.conf " +
+              env['BUILDROOT'] + " " + str(target[0]))
+
+def boot_image_str(target, source, env):
+
+    return "  IMG " + str(target[0])
+
+#
+# Add ourselves to the given environment.
+#
+def generate(env):
+
+ builder = env.Builder(action = env.Action(boot_image_func, boot_image_str),
+                          emitter = boot_image_emitter)
+    env.Append(BUILDERS = { 'BootImage' : builder })
+
+#
+# We always exist.
+#
+def exists(env):
+    return True
=======================================
--- /dev/null
+++ /site_scons/gdbinit.py      Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+import build
+
+#
+# Generate an GNU Debugger initialization file for
+# the current target kernel.
+#
+f = open(".gdbinit", "w")
+f.write('file ' + build.target['BUILDROOT'] + '/kernel/kernel\n'
+       'target remote localhost:1234\n')
+f.flush()
+f.close()
+
=======================================
--- /dev/null
+++ /site_scons/phony.py        Mon Jan 19 19:58:13 2015 UTC
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2010 Niek Linnenbank
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+from SCons.Script import *
+import os
+
+#
+# Always execute the given commands as SCons targets.
+#
+# @author GregNoel
+# @see http://www.scons.org/wiki/PhonyTargets
+#
+def Targets(env = None, **kw):
+
+    # Generate an environment, if not given.
+    if not env: env = DefaultEnvironment()
+
+    # Make sure to pass the whole environment to the command.
+    env.Append(ENV = os.environ)
+
+    # Execute all targets
+    for target,action in kw.items():
+        env.AlwaysBuild(env.Alias(target, [], action))
+
=======================================
--- /include/X86/API.h  Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __X86_API_H
-#define __X86_API_H
-
-#include <Types.h>
-#include <kernel/API.h>
-
-/**
- * @defgroup x86kernel kernel (x86)
- * @{
- */
-
-/**
- * Perform a kernel trap with 1 argument.
- * @param num Unique number of the handler to execute.
- * @param arg1 First argument becomes ECX.
- * @return An integer.
- */
-inline ulong trapKernel1(ulong num, ulong arg1)
-{
-    ulong ret;
-    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1));
-    return ret;
-}
-
-/**
- * Perform a kernel trap with 3 arguments.
- * @param num Unique number of the handler to execute.
- * @param arg1 First argument becomes ECX.
- * @param arg2 Second argument becomes EBX.
- * @param arg3 Third argument becomes EDX.
- * @return An integer.
- */
-inline ulong trapKernel3(ulong num, ulong arg1, ulong arg2, ulong arg3)
-{
-    ulong ret;
-    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1), "b"(arg2),
-                                           "d"(arg3));
-    return ret;
-}
-
-/**
- * Perform a kernel trap with 4 arguments.
- * @param num Unique number of the handler to execute.
- * @param arg1 First argument becomes ECX.
- * @param arg2 Second argument becomes EBX.
- * @param arg3 Third argument becomes EDX.
- * @param arg4 Fourth argument becomes ESI.
- * @return An integer.
- */
-inline ulong trapKernel4(ulong num, ulong arg1, ulong arg2, ulong arg3,
-                        ulong arg4)
-{
-    ulong ret;
-    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1), "b"(arg2),
-                                           "d"(arg3), "S"(arg4));
-    return ret;
-}
-
-/**
- * Perform a kernel trap with 5 arguments.
- * @param num Unique number of the handler to execute.
- * @param arg1 First argument becomes ECX.
- * @param arg2 Second argument becomes EBX.
- * @param arg3 Third argument becomes EDX.
- * @param arg4 Fourth argument becomes ESI.
- * @param arg5 Fifth argument becomes EDI.
- * @return An integer.
- */
-inline ulong trapKernel5(ulong num, ulong arg1, ulong arg2, ulong arg3,
-                        ulong arg4, ulong arg5)
-{
-    ulong ret;
-    asm volatile ("int $0x90" : "=a"(ret) : "a"(num), "c"(arg1), "b"(arg2),
-                                "d"(arg3), "S"(arg4), "D"(arg5));
-    return ret;
-}
-
-/**
- * @}
- */
-
-#endif /* __X86_API_H */
=======================================
--- /include/X86/BootImage.h    Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,1 +0,0 @@
-../kernel/BootImage.h
=======================================
--- /include/X86/ByteOrder.h    Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,1 +0,0 @@
-../kernel/ByteOrder.h
=======================================
--- /include/X86/CPU.h  Sat Oct 24 20:14:36 2009 UTC
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __X86_CPU_H
-#define __X86_CPU_H
-
-/**
- * @defgroup x86kernel kernel (x86)
- * @{
- */
-
-/** Intel is little endian. */
-#define CPU_LITTLE_ENDIAN      1
-
-#if !defined(__HOST__)
-
-/** Paged Mode. */
-#define CR0_PG         0x80000000
-
-/** Timestamp Counter Disable. */
-#define CR4_TSD                0x00000004
-
-/** Kernel Code Segment. */
-#define KERNEL_CS       1
-#define KERNEL_CS_SEL   0x8
-
-/** System Data Segment. */
-#define KERNEL_DS       2
-#define KERNEL_DS_SEL   0x10
-
-/** User Code Segment. */
-#define USER_CS         3
-#define USER_CS_SEL     (0x18 | 3)
-
-/** User Data Segment. */
-#define USER_DS         4
-#define USER_DS_SEL     (0x20 | 3)
-
-/** User TSS. */
-#define USER_TSS        5
-#define USER_TSS_SEL    0x28
-
-#ifndef __ASSEMBLER__
-
-#include <Types.h>
-#include <Macros.h>
-
-/**
- * Retrieve the IRQ number from CPUState.
- * @return IRQ number.
- */
-#define IRQ_REG(state) \
-    ((state)->vector - 0x20)
-
-/**
- * Reads the CPU's timestamp counter.
- * @return 64-bit integer.
- */
-#define timestamp() \
-    ({ \
-       u64 low = 0, high = 0; \
-       asm volatile ("rdtsc\n" \
-                     "movl %%eax, %0\n" \
-                     "movl %%edx, %1\n" : "=r"(low), "=r"(high)); \
-       (u64) (high << 32) | (low); \
-    })
-
-/**
- * Reboot the system (by sending the a reset signal on the keyboard I/O port)
- */
-#define reboot() \
-    outb(0x64, 0xfe)
-
-/**
- * Shutdown the machine via ACPI.
- * @note We do not have ACPI yet. Shutdown now has a bit naive implementation.
- * @see http://forum.osdev.org/viewtopic.php?t=16990
- */
-#define shutdown() \
-    outw(0xB004, 0x0 | 0x2000)
-
-/**
- * Puts the CPU in a lower power consuming state.
- */
-#define idle() \
-    asm volatile ("hlt");
-
-/**
- * Loads the Task State Register (LTR) with the given segment.
- * @param sel TSS segment selector.
- */
-#define ltr(sel) \
-({ \
-    u16 tr = sel; \
-    asm volatile ("ltr %0\n" :: "r"(tr)); \
-})
-
-/**
- * Read a byte from a port.
- * @param port The I/O port to read from.
- * @return A byte read from the port.
- */
-#define inb(port) \
-({ \
-    unsigned char b; \
-    asm volatile ("inb %%dx, %%al" : "=a" (b) : "d" (port)); \
-    b; \
-})
-
-/**
- * Read a word from a port.
- * @param port The I/O port to read from.
- * @return Word read from the port.
- */
-#define inw(port) \
-({ \
-    unsigned short w; \
-    asm volatile ("inw %%dx, %%ax" : "=a" (w) : "d" (port)); \
-    w; \
-})
-
-/**
- * Output a byte to a port.
- * @param port Port to write to.
- * @param byte The byte to output.
- */
-#define outb(port,byte) \
-    asm volatile ("outb %%al,%%dx"::"a" (byte),"d" (port))
-
-/**
- * Output a word to a port.
- * @param port Port to write to.
- * @param byte The word to output.
- */
-#define outw(port,word) \
-    asm volatile ("outw %%ax,%%dx"::"a" (word),"d" (port))
-
-/**
- * Output a long to a I/O port.
- * @param port Target I/O port.
- * @param l The long 32-bit number to output.
- */
-#define outl(port,l) \
-    asm volatile ("outl %%eax,%%dx"::"a" (l),"d" (port))
-
-/** I/O bitmap. */
-extern Address kernelioBitMap[1024];
-
-#ifdef CPP
-
-/**
- * Intel's Task State Segment.
- */
-typedef struct TSS
-{
-    /**
-     * (Un)mask the appropriate bit to (dis)allow direct I/O.
-     * @param port I/O port.
-     * @param enabled Allow or disallow a port.
-     * @param bitmap Pointer to the bitmap.
-     */
-    void setPort(u16 port, bool enabled, u8 *bitmap)
-    {
-       if (enabled)
-           bitmap[(port / 8)] &= ~(1 << (port % 8));
-       else
-           bitmap[(port / 8)] |=  (1 << (port % 8));
-    }
-
-    u32 backlink;
-    u32 esp0, ss0;
-    u32 esp1, ss1;
-    u32 esp2, ss2;
-    u32 cr3;
-    u32 eip;
-    u32 eflags;
-    u32 eax,ecx,edx,ebx;
-    u32 esp, ebp;
-    u32 esi, edi;
-    u32 es, cs, ss, ds, fs, gs;
-    u32 ldt;
-    u32 bitmap;
-}
-TSS;
-
-/**
- * Segment descriptor used in the GDT.
- */
-typedef struct Segment
-{
-    u32 limitLow:16;
-    u32 baseLow:16;
-    u32 baseMid:8;
-    u32 type:5;
-    u32 privilege:2;
-    u32 present:1;
-    u32 limitHigh:4;
-    u32 granularity:4;
-    u32 baseHigh:8;
-}
-Segment;
-
-/**
- * Contains all the CPU registers.
- */
-typedef struct CPUState
-{
-    /* Segments. */
-    u32 gs, fs, es, ds, ss0;
-
-    /* By pusha */
-    u32 edi, esi, ebp, esp0, ebx, edx, ecx, eax;
-
-    /* Vector/error arguments. */
-    u32 vector, error;
-
-    /* Pushed by processor. */
-    u32 eip, cs, eflags, esp3, ss3;
-}
-CPUState;
-
-/** Global Descriptor Table. */
-extern Segment gdt[];
-
-/** Task State Segment. */
-extern TSS kernelTss;
-
-#endif /* CPP */
-
-/**
- * @}
- */
-
-#endif /* __ASSEMBLER__ */
-#endif /* !defined(__HOST__) && !defined(CPP) */
-#endif /* __X86_CPU_H */
=======================================
--- /include/X86/Init.h Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,1 +0,0 @@
-../kernel/Init.h
=======================================
--- /include/X86/Interrupt.h    Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __X86_INTERRUPT_H
-#define __X86_INTERRUPT_H
-
-#include "CPU.h"
-#include <Types.h>
-#include <Macros.h>
-
-/**
- * @defgroup x86kernel kernel (x86)
- * @{
- */
-
-/**
- * Enables interrupts.
- */
-#define sti() \
-    asm volatile ("sti")
-
-/**
- * Disables interrupts.
- */
-#define cli() \
-    asm volatile ("cli");
-
-/**
- * Explicitely enable interrupts.
- */
-#define irq_enable() \
-    sti()
-
-/**
- * Disable interrupts, and store current interrupt state.
- * @warning This is dangerous: no guarantee of the current stack state.
- */
-#define irq_disable()                          \
-({                                             \
-    ulong ret;                                 \
-                                               \
-    asm volatile ("pushfl\n"                 \
-                 "popl %0" : "=g" (ret) :);        \
-    cli();                                     \
-    ret;                                       \
-})
-
-/**
- * Restore the previous interrupt state.
- * @warning This is dangerous: no guarantee of the current stack state.
- */
-#define irq_restore(saved)                     \
-    asm volatile ("push %0\n"                        \
-                 "popfl\n" :: "g" (saved))
-
-/**
- * We remap IRQ's to interrupt vectors 32-47.
- */
-#define IRQ(vector) \
-    (vector) + 32
-
-/**
- * Function which is called when the CPU is interrupted.
- * @param state State of the CPU on the moment the interrupt occurred.
- * @param param Optional parameter for the handler.
- */
-typedef void InterruptHandler(CPUState *state, ulong param);
-
-/**
- * Interrupt hook class.
- */
-typedef struct InterruptHook
-{
-    /**
-     * Constructor function.
-     * @param h Handler function for the hook.
-     * @param p Parameter to pass.
-     */
-    InterruptHook(InterruptHandler *h, ulong p) : handler(h), param(p)
-    {
-    }
-
-    /**
-     * Comparision operator.
-     * @param i InterruptHook pointer.
-     * @return True if equal, false otherwise.
-     */
-    bool operator == (InterruptHook *i)
-    {
-       return handler == i->handler && param == i->param;
-    }
-
-    /** Executed at time of interrupt. */
-    InterruptHandler *handler;
-
-    /** Passed to the handler. */
-    ulong param;
-}
-InterruptHook;
-
-/**
- * Called by assembler routine invokeHandler() in boot.S.
- * @param state CPU registers pushed on the stack.
- */
-extern C void executeInterrupt(CPUState state);
-
-/**
- * @}
- */
-
-#endif /* __X86_INTERRUPT_H */
=======================================
--- /include/X86/Kernel.h       Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __X86_KERNEL_H
-#define __X86_KERNEL_H
-
-#ifndef __ASSEMBLY__
-
-#include <kernel/Kernel.h>
-#include <Singleton.h>
-#include <Types.h>
-#include "Interrupt.h"
-#include "CPU.h"
-
-/**
- * @defgroup x86kernel kernel (x86)
- * @{
- */
-
-/** IO base address for master PIC */
-#define PIC1_CMD        0x20
-
-/** IO base address for slave PIC */
-#define PIC2_CMD        0xa0
-
-/* Master PIC data port */
-#define PIC1_DATA       0x21
-
-/* Slave PIC data port */
-#define PIC2_DATA       0xa1
-
-/** End of Interrupt (EOI). */
-#define PIC_EOI                0x20
-
-/** Base of IRQ's from the PIC's. */
-#define PIC_IRQ_BASE   0x20
-
-/** PIT maximum frequency. */
-#define PIT_FREQUENCY   1193182
-
-/** PIT IRQ interval. */
-#define PIT_HZ         250
-
-/** PIT divisor. */
-#define PIT_DIVISOR    (PIT_FREQUENCY / PIT_HZ)
-
-/** PIT command port. */
-#define PIT_CMD                0x43
-
-/** PIT channel zero. */
-#define PIT_CHAN0      0x40
-
-/**
- * Implements an x86 compatible kernel.
- */
-class X86Kernel : public Kernel, public Singleton<X86Kernel>
-{
-    public:
-
-        /**
-         * Constructor function.
-         */
-       X86Kernel();
-
-       /**
-        * Hooks a function to an hardware interrupt.
-        * @param vec Interrupt vector to hook on.
-        * @param h Handler function.
-        * @param p Parameter to pass to the handler function.
-        */
-       void hookInterrupt(int vec, InterruptHandler h, ulong p);
-
-        /**
-         * Uses the PIC to (un)mask an IRQ.
-         * @param vector Interrupt vector.
-         * @param enabled Either to mask (true) or unmask (false).
-         */
-        void enableIRQ(uint vector, bool enabled);
-
-    private:
-
-       /**
-         * Called when the CPU detects a fault.
- * @param state Contains CPU registers, interrupt vector and error code.
-         * @param param Not used.
-         */
-        static void exception(CPUState *state, ulong param);
-
-       /**
-         * Default interrupt handler.
- * @param state Contains CPU registers, interrupt vector and error code.
-         * @param param Not used.
-         */
-        static void interrupt(CPUState *state, ulong param);
-
-       /**
-        * Kernel trap handler (system calls).
- * @param state Contains the arguments for the APIHandler, in CPU registers.
-        * @param param Not used.
-        */
-       static void trap(CPUState *state, ulong param);
-
-       /**
-         * i8253 system clock interrupt handler.
-         * @param state CPU registers on time of interrupt.
-        * @param param Not used.
-         */
-       static void clocktick(CPUState *state, ulong param);
-
-       /** Amount of i8253 ticks (interrupts) counted so far. */
-       Size ticks;
-};
-
-/** Points to the kernel. */
-extern X86Kernel *kernel;
-
-/**
- * @}
- */
-
-#endif /* __ASSEMBLY__ */
-#endif /* __X86_CPU_H */
=======================================
--- /include/X86/Memory.h       Sun Aug  2 10:33:36 2009 UTC
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __X86_MEMORY_H
-#define __X86_MEMORY_H
-
-/**
- * @defgroup x86kernel kernel (x86)
- * @{
- */
-
-#ifdef __ASSEMBLER__
-#define ADDRESS
-#define ADDRESSP
-#else
-#define ADDRESS          (Address)
-#define ADDRESSP  (Address *)
-#endif
-
-/** Page entry bit shift. */
-#define PAGESHIFT       12
-
-/** Page table bit shift. */
-#define DIRSHIFT        22
-
-/** Intel uses 4K pages. */
-#define PAGESIZE        4096
-
-/** Number of entries in the page directory. */
-#define PAGEDIR_MAX    1024
-
-/** Number of entries in a page table. */
-#define PAGETAB_MAX    1024
-
-/** Mask to find the page. */
-#define PAGEMASK        0xfffff000
-
-/** Memory address alignment. */
-#define MEMALIGN       4
-
-/** Marks a page entry present. */
-#define PAGE_PRESENT    1
-
-/** Marks a page entry read/write. */
-#define PAGE_RW         2
-
-/** Marks a page accessible by user programs (ring 3). */
-#define PAGE_USER       4
-
-/** Pinned pages cannot be released. */
-#define PAGE_PINNED    (1 << 9)
-
-/** This page has been marked for temporary operations. */
-#define PAGE_MARKED    (1 << 10)
-
-/** Page has been reserved for future use. */
-#define PAGE_RESERVED  (1 << 11)
-
-/** We map page tables into virtual memory, at a fixed address. */
-#define PAGETABFROM            ADDRESS (1024 * 1024 * 4)
-
-/** Address space for modifing remote page tables. */
-#define PAGETABFROM_REMOTE     ADDRESS (1024 * 1024 * 8)
-
-/** Address space for userspace pagetable mapping. */
-#define PAGEUSERFROM           ADDRESS (1024 * 1024 * 12)
-
-/**
- * Entry inside the page directory of a given virtual address.
- * @param vaddr Virtual Address.
- * @return Index of the corresponding page directory entry.
- */
-#define DIRENTRY(vaddr) \
-    ((ADDRESS vaddr) >> DIRSHIFT)
-
-/**
- * Entry inside the page table of a given virtual address.
- * @param vaddr Virtual Address.
- * @return Index of the corresponding page table entry.
- */
-#define TABENTRY(vaddr) \
-    (((ADDRESS vaddr) >> PAGESHIFT) & 0x3ff)
-
-/**
- * Compute the virtual address of the page table, for a given vaddr.
- * @param vaddr Virtual address.
- * @param from Address of the first page table.
- * @return Address pointer to the page table for vaddr.
- */
-#define PAGETABADDR_FROM(vaddr,from) \
-    ADDRESSP (((((vaddr) >> (PAGESHIFT)) * 4) + (from)) & PAGEMASK)
-
-/**
- * Compute the virtual address of the page table, for a given vaddr.
- * @param vaddr Virtual address.
- * @return Address pointer of the page table for vaddr.
- */
-#define PAGETABADDR(vaddr) \
-    PAGETABADDR_FROM(vaddr, PAGETABFROM)
-
-/**
- * Virtual address pointing to the page directory.
- */
-#define PAGEDIRADDR \
-    PAGETABADDR(PAGETABFROM)
-
-/**
- * Virtual address pointer to the page directory.
- * @param from Address of the first page table.
- * @return Address pointer to the page directory table.
- */
-#define PAGEDIRADDR_FROM(from) \
-    PAGETABADDR_FROM(PAGETABFROM, from)
-
-#define PAGEDIRADDR_REMOTE \
-    PAGETABADDR_FROM(PAGETABFROM, PAGETABFROM_REMOTE)
-
-#ifndef __ASSEMBLER__
-#ifndef __HOST__
-
-/**
- * Flushes the Translation Lookaside Buffers (TLB) for a single page.
- * @param addr Memory address to flush.
- */
-#define tlb_flush(addr) \
-    asm volatile("invlpg (%0)" ::"r" (addr) : "memory")
-
-/**
- * Flushes all Translation Lookaside Buffers (TLB).
- */
-#define tlb_flush_all() \
-    asm volatile("mov %cr3, %eax\n" \
-                "mov %eax, %cr3\n")
-
-#include <kernel/Memory.h>
-#include <Singleton.h>
-#include "Process.h"
-#include <Types.h>
-#include <Macros.h>
-
-/**
- * x86 Virtual Memory.
- */
-class X86Memory : public Memory, public Singleton<X86Memory>
-{
-    public:
-
-       /**
-        * Constructor function.
-        */
-       X86Memory();
-
-       /**
- * Map a physical page to a virtual address, using intel's paged virtual memory.
-        * @param paddr Physical address.
-        * @param vaddr Virtual address.
-        * @param prot Page entry protection flags.
-        * @return Mapped virtual address.
-        */
-       Address mapVirtual(Address paddr, Address vaddr = ZERO,
-                          ulong prot = PAGE_PRESENT | PAGE_RW);
-
-       /**
- * Map a physical page to a virtual address, using intel's paged virtual memory.
-        * @param p Process to map memory for.
-        * @param paddr Physical address.
-        * @param vaddr Virtual address.
-        * @param prot Page entry protection flags.
-        * @return Mapped virtual address.
-        */
-       Address mapVirtual(X86Process *p, Address paddr,
-                          Address vaddr, ulong prot = PAGE_PRESENT | PAGE_RW);
-
-        /**
-         * Lookup a pagetable entry for the given (remote) virtual address.
-         * @param p Target process.
-        * @param vaddr Virtual address to lookup.
-        * @return Page table entry if vaddr is mapped, or ZERO if not.
-        */
-       Address lookupVirtual(X86Process *p, Address vaddr);
-
-       /**
-        * Verify protection access flags in the page directory and page table.
-        * @param p Target process to verify protection bits for.
-        * @param vaddr Virtual address.
-        * @param sz Size of the byte range to check.
-        * @return True if the current process has access, false otherwise.
-        */
-       bool access(X86Process *p, Address vaddr, Size sz,
-                   ulong prot = PAGE_PRESENT|PAGE_RW|PAGE_USER);
-
-        /**
- * Marks all physical pages used by a process as free (if not pinned).
-         * @param p Target process.
-         */
-       void releaseAll(ArchProcess *p);
-
-       /**
-        * Maps remote pages into the current process.
-        * @param p Other process for which we map tables.
-        * @param pageTabAddr Point page table pointer for this address.
- * @param pageDirAddr Map the remote page remote directory on this address.
-        * @param prot Extra memory protection flags for the mapping.
-        */
-       void mapRemote(X86Process *p, Address pageTabaddr,
-                      Address pageDirAddr = (Address) PAGEDIRADDR_REMOTE,
-                      ulong prot = ZERO);
-
-    private:
-
-       /**
-        * Find a free virtual page.
-        * @param pageTabFrom Address of the first page table.
-        * @param pageDirAddr Pointer to the page directory to use.
-        * @return Free virtual address, if any.
-        */
-       Address findFree(Address pageTabFrom, Address *pageDir);
-
-
-       /** Remote page directory and page tables. */
-       Address *remPageDir, *remPageTab;
-
-       /** Local (i.e. currently executing process) page directory and tables. 
*/
-       Address *myPageDir, *myPageTab;
-};
-
-/** Instance of Intel memory. */
-extern X86Memory *memory;
-
-/** Kernel page directory. */
-extern Address kernelPageDir[1024], kernelPageTab[1024];
-
-#endif /* __HOST__ */
-#endif /* __ASSEMBLER__ */
-
-/**
- * @}
- */
-
-#endif /* __X86_MEMORY_H */
=======================================
--- /include/X86/Multiboot.h    Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,1 +0,0 @@
-../kernel/Multiboot.h
=======================================
--- /include/X86/Process.h      Mon Jun 29 00:23:04 2009 UTC
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __X86_PROCESS_H
-#define __X86_PROCESS_H
-
-/**
- * @defgroup x86kernel kernel (x86)
- * @{
- */
-
-#ifndef __ASSEMBLY__
-#ifdef  __cplusplus
-
-/**
- * Used by kernel/ classes to point back to us.
- */
-#define ArchProcess X86Process
-class ArchProcess;
-
-#include <kernel/Process.h>
-#include "CPU.h"
-#include "Memory.h"
-#include <Types.h>
-
-/**
- * Process which may execute on an Intel x86 CPU.
- */
-class X86Process : public Process
-{
-    public:
-
-        /**
-         * Constructor function.
-        * @param entry Initial EIP register value.
-         */
-       X86Process(Address entry);
-
-       /**
-        * Destructor function.
-        */
-       ~X86Process();
-
-       /**
-        * (Dis)allows a process direct I/O to a port.
-        * @param port I/O port.
-        * @param enabled (Dis)allow access.
-        */
-       void IOPort(u16 port, bool enabled);
-
-       /**
-        * Save and restore registers, then perform a context switch.
-        */
-       void execute();
-
-       /**
-        * Get the address of our page directory.
-        * @return Page directory address.
-        */
-       Address getPageDirectory()
-       {
-           return pageDirAddr;
-       }
-
-       /**
-        * Get the address of our stack.
-        * @return Stack address.
-        */
-       Address getStack()
-       {
-           return stackAddr;
-       }
-
-       /**
-        * Sets the address of our stack.
-        * @param addr New stack address.
-        */
-       void setStack(Address addr)
-       {
-           stackAddr = addr;
-       }
-
-    private:
-
-       /** Page Directory physical address. */
-       Address pageDirAddr;
-
-       /** Current stack pointer. */
-       Address stackAddr;
-
-       /** Kernel stack pointer. */
-       Address kernelStackAddr;
-
-       /** I/O bitmap physical address. */
-       Address ioMapAddr;
-};
-
-/**
- * Assembly routine which performs context switches.
- * @param oldStackPtr Pointer to the stackAddr of the currently running X86Process, if any.
- * @param pageDirAddr Address of the page directory.
- * @param stackAddr Address of the user stack.
- * @param kernelTss Pointer to the kernel's TSS.
- * @param kernelStackAddr Address of the kernel stack.
- * @see TSS
- * @see contextSwitch.S
- */
-extern C void contextSwitch(Address *oldStack,  Address pageDirAddr,
-                           Address  stackAddr, TSS *kernelTss,
-                           Address  kernelStackAddr);
-
-#endif /* __cplusplus */
-#endif /* __ASSEMBLY__ */
-
-/**
- * @}
- */
-
-#endif /* __X86_PROCESS_H */
=======================================
--- /include/X86/Scheduler.h    Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,1 +0,0 @@
-../kernel/Scheduler.h
=======================================
--- /include/X86/Support.h      Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,1 +0,0 @@
-../kernel/Support.h
=======================================
--- /kernel/X86/kernel.ld       Sun Aug 17 18:01:48 2014 UTC
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-ENTRY(_start)
-TARGET("elf32-i386")
-OUTPUT_FORMAT("elf32-i386")
-
-phys = 0x00100000;
-virt = 0x00100000;
-
-SECTIONS
-{
-    . = 0x00100000;
-    kernelStart = .;
-
-    /DISCARD/ :
-    {
-        *(.note.gnu.build-id)
-    }
-
-    .text virt : AT(phys)
-    {
-       code = .;
-       *(.text)
-       *(*.text)
-       *(.gnu.linkonce.*)
-       *(.rodata)
-       *(.rodata.*)
-       *(.eh_frame)
-       . = ALIGN(4096);
-    }
-
-    .data : AT (phys + (data - code))
-    {
-       data = .;
-       *(.data)
-
-        CTOR_LIST = .;
-       KEEP (*(SORT(.ctors.*)))
-       KEEP (*(.ctors))
-       LONG(0)
-        CTOR_END = .;
-
-        DTOR_LIST = .;
-       KEEP (*(SORT(.dtors.*)))
-       KEEP (*(.dtors))
-        LONG(0)
-        DTOR_END = .;
-       . += 4;
-
-       initStart = .;
-       KEEP (*(SORT(.init*)))
-       initEnd   = .;
-       . = ALIGN(4096);
-    }
-
-    .bss : AT(phys + (bss - code))
-    {
-       bss = .;
-       *(.bss)
-       *(.bss.*)
-       *(COMMON)
-
-        . += 4;
-       kernelEnd = .;
-
-       . = 0x00400000;
-    }
-}
=======================================
--- /kernel/X86/user.ld Sun Aug 17 18:01:48 2014 UTC
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-ENTRY(_entry)
-TARGET("elf32-i386")
-OUTPUT_FORMAT("elf32-i386")
-
-SECTIONS
-{
-    . = 0x80000000;
-
-    .text :
-    {
-       *(.entry)
-       *(.text)
-       *(*.text)
-       *(.gnu.linkonce.*)
-       *(.data)
-       *(.rodata)
-       *(.rodata.*)
-       *(.eh_frame)
-
-       . = ALIGN(4);
-        CTOR_LIST = .;
-       KEEP (*(SORT(.ctors.*)))
-       KEEP (*(.ctors))
-       LONG(0)
-        CTOR_END = .;
-
-        DTOR_LIST = .;
-       KEEP (*(SORT(.dtors.*)))
-       KEEP (*(.dtors))
-        LONG(0)
-        DTOR_END = .;
-       . += 4;
-
-       initStart = .;
-       KEEP (*(SORT(.init*)))
-       KEEP (*(.init*))
-       initEnd   = .;
-       *(.bss)
-    }
-}
=======================================
--- /lib/libteken/gensequences  Sat Sep  5 17:50:50 2009 UTC
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/usr/bin/awk -f
-
-#-
-# Copyright (c) 2008-2009 Ed Schouten <ed@xxxxxxxxxxx>
-# All rights reserved.
-#
-# 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.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
-#
-# $FreeBSD$
-
-function die(msg) {
-       print msg;
-       exit 1;
-}
-
-function cchar(str) {
-       if (str == "^[")
-               return "\\x1B";
-
-       return str;
-}
-
-BEGIN {
-FS = "\t+"
-
-while (getline > 0) {
-       if (NF == 0 || $1 ~ /^#/)
-               continue;
-
-       if (NF != 3 && NF != 4)
-               die("Invalid line layout: " NF " columns");
-
-       split($3, sequence, " +");
-       nsequences = 0;
-       for (s in sequence)
-               nsequences++;
-
-       prefix = "";
-       l_prefix_name[""] = "teken_state_init";
-       for (i = 1; i < nsequences; i++) {
-               n = prefix sequence[i];
-               l_prefix_parent[n] = prefix;
-               l_prefix_suffix[n] = sequence[i];
-               if (!l_prefix_name[n])
-                       l_prefix_name[n] = "teken_state_" ++npr;
-               prefix = n;
-       }
-
-       suffix = sequence[nsequences];
-       cmd = prefix suffix;
-
-       # Fill lists
-       if (l_cmd_name[cmd] != "")
-               die(cmd " already exists");
-       l_cmd_prefix[cmd] = prefix;
-       l_cmd_suffix[cmd] = suffix;
-       l_cmd_args[cmd] = $4;
-       l_cmd_abbr[cmd] = $1;
-       l_cmd_name[cmd] = $2;
-       l_cmd_c_name[cmd] = "teken_subr_" tolower($2);
-       gsub(" ", "_", l_cmd_c_name[cmd]);
-
-       if ($4 != "")
-               l_prefix_numbercmds[prefix]++;
-}
-
-print "/* Generated file. Do not edit. */";
-print "";
-
-for (p in l_prefix_name) {
-       if (l_prefix_name[p] != "teken_state_init")
-               print "static teken_state_t        " l_prefix_name[p] ";";
-}
-
-for (p in l_prefix_name) {
-       print "";
-       print "/* '" p "' */";
-       print "static void";
-       print l_prefix_name[p] "(teken_t *t, teken_char_t c)";
-       print "{";
-
-       if (l_prefix_numbercmds[p] > 0) {
-               print "";
-               print "\tif (teken_state_numbers(t, c))";
-               print "\t\treturn;";
-       }
-
-       print "";
-       print "\tswitch (c) {";
-       for (c in l_cmd_prefix) {
-               if (l_cmd_prefix[c] != p)
-                       continue;
-
- print "\tcase '" cchar(l_cmd_suffix[c]) "': /* " l_cmd_abbr[c] ": " l_cmd_name[c] " */";
-
-               if (l_cmd_args[c] == "v") {
-                       print "\t\t" l_cmd_c_name[c] "(t, t->t_curnum, 
t->t_nums);";
-               } else {
-                       printf "\t\t%s(t", l_cmd_c_name[c];
-                       split(l_cmd_args[c], args, " ");
-                       for (a = 1; args[a] != ""; a++) {
-                               if (args[a] == "n")
- printf ", (t->t_curnum < %d || t->t_nums[%d] == 0) ? 1 : t->t_nums[%d]", a, (a - 1), (a - 1);
-                               else if (args[a] == "r")
-                                       printf ", t->t_curnum < %d ? 0 : 
t->t_nums[%d]", a, (a - 1);
-                               else
-                                       die("Invalid argument type: " args[a]);
-                       }
-                       print ");";
-               }
-               print "\t\tbreak;";
-       }
-       for (pc in l_prefix_parent) {
-               if (l_prefix_parent[pc] != p)
-                       continue;
-               print "\tcase '" cchar(l_prefix_suffix[pc]) "':";
-               print "\t\tteken_state_switch(t, " l_prefix_name[pc] ");";
-               print "\t\treturn;";
-       }
-
-       print "\tdefault:";
-       if (l_prefix_name[p] == "teken_state_init") {
-               print "\t\tteken_subr_regular_character(t, c);";
-       } else {
- print "\t\tteken_printf(\"Unsupported sequence in " l_prefix_name[p] ": %u\\n\", (unsigned int)c);";
-       }
-       print "\t\tbreak;";
-
-       print "\t}";
-
-       if (l_prefix_name[p] != "teken_state_init") {
-               print "";
-               print "\tteken_state_switch(t, teken_state_init);";
-       }
-       print "}";
-}
-
-}
=======================================
--- /site_scons/configure.py    Wed Jun 17 17:54:14 2009 UTC
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-from SCons.SConf  import *
-from SCons.Script import *
-
-#
-# SConf helper function.
-#
-def TryCompileC(context):
-
-    # Print out a debug message.
-    context.Message('Checking for ' + context.env['TRYFLAG'] + ' ... ')
-
-    # Use the simpelest C program possible.
-    source_file = "int main(int argc, char **argv)" \
-                 "{" \
-                 "    return 0;" \
-                 "}\n"
-
-    # Try to compile and link it.
-    result = context.TryLink(source_file, '.c')
-
-    # Return the result status.
-    context.Result(result)
-    return result
-
-#
-# Checks if the compiler in the given environment supports
-# the given command-line argument, and sets it if so.
-#
-# Thanks to loonycyborg on #scons for his help!
-#
-def TryCCFlag(env,flag):
-
-    global TryCompileC
-
-    conf = Configure(env, custom_tests = { 'TryCompileC' : TryCompileC })
-    conf.env.Append(CCFLAGS = flag)
-    conf.env.Replace(TRYFLAG = flag)
-
-    result = conf.TryCompileC()
-    if not result:
-       conf.env['CCFLAGS'].remove(flag)
-
-    conf.Finish()
=======================================
--- /site_scons/dist.py Sat Jun  6 09:18:01 2009 UTC
+++ /dev/null
@@ -1,205 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-# vim: set et sw=3 tw=0 fo=awqorc ft=python:
-# DistTarBuilder: tool to generate tar files using SCons
-# Copyright (C) 2005, 2006  Matthew A. Nicholson
-# Copyright (C) 2006  John Pye
-#
-# This file is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-import os
-import sys
-import tarfile
-import version
-import checksum
-import SCons.Builder
-
-from build import *
-from SCons.Script import *
-
-def DistTarEmitter(target,source,env):
-
-   source,origsource = [], source
-
-   excludeexts = env.Dictionary().get('DISTTAR_EXCLUDEEXTS',[])
-   excludedirs = env.Dictionary().get('DISTTAR_EXCLUDEDIRS',[])
-
-   # assume the sources are directories... need to check that
-   for item in origsource:
-      if os.path.isdir(str(item)):
-         for root, dirs, files in os.walk(str(item)):
-
-            # don't make directory dependences as that triggers full build
-            # of that directory
-            if root in source:
-               #print "Removing directory %s" % root
-               source.remove(root)
-
-            # loop through files in a directory
-            for name in files:
-               ext = os.path.splitext(name)
-               if not ext[1] in excludeexts:
-                  relpath = os.path.join(root,name)
-                  source.append(relpath)
-            for d in excludedirs:
-               if d in dirs:
-                  dirs.remove(d)  # don't visit CVS directories etc
-      else:
-         ext = os.path.splitext(str(item))
-         if not ext[1] in excludeexts:
-            source.append(str(item))
-
-   return target, source
-
-def DistTarString(target, source, env):
-   """
- This is what gets printed on the console. We'll strip out the list or source - files, since it tends to get very long. If you want to see the contents, the
-   easiest way is to uncomment the line 'Adding to TAR file' below.
-   """
-   return "  TAR     " + str(target[0])
-
-def DistTar(target, source, env):
-   """tar archive builder"""
-
-   import tarfile
-
-   env_dict = env.Dictionary()
-
-   if env_dict.get("DISTTAR_FORMAT") in ["gz", "bz2"]:
-      tar_format = env_dict["DISTTAR_FORMAT"]
-   else:
-      tar_format = ""
-
-   # split the target directory, filename, and stuffix
-   base_name = str(target[0]).split('.tar')[0]
-   (target_dir, dir_name) = os.path.split(base_name)
-
-   # create the target directory if it does not exist
-   if target_dir and not os.path.exists(target_dir):
-      os.makedirs(target_dir)
-
-   # open our tar file for writing
-   tar = tarfile.open(str(target[0]), "w:%s" % (tar_format,))
-
-   # write sources to our tar file
-   for item in source:
-      item = str(item)
-      tar.add(item,'%s/%s' % (dir_name,item))
-
-   # all done
-   tar.close()
-
-def DistTarSuffix(env, sources):
-   """tar archive suffix generator"""
-
-   env_dict = env.Dictionary()
- if env_dict.has_key("DISTTAR_FORMAT") and env_dict["DISTTAR_FORMAT"] in ["gz", "bz2"]:
-      return ".tar." + env_dict["DISTTAR_FORMAT"]
-   else:
-      return ".tar"
-
-#
-# Registers the DistTar builder.
-#
-target.Append(BUILDERS =
-{
-    'DistTar': target.Builder(
-       action = SCons.Action.Action(DistTar, DistTarString),
-       suffix = DistTarSuffix,
-       emitter = DistTarEmitter,
-       target_factory = target.fs.Entry,
-     ),
-})
-
-target.Append(
-          DISTTAR_EXCLUDEEXTS=['.o','.os','.so','.a','.dll','.cc','.cache',
-                              '.pyc','.cvsignore','.dblite','.log', '.gz',
-                              '.bz2', '.zip', '.bak', '.BAK', '.md5', '.sha1',
-                              '.tar', '.img', '.ext2', '.iso']
-        , DISTTAR_EXCLUDEDIRS=['CVS','.svn','.sconf_temp', 'dist', 'host']
-)
-
-#
-# Create a release GZipped TAR archive.
-#
-releaseTarGz = target.DistTar("FreeNOS-" + version.current + ".tar.gz",
-                                    [target.Dir('#')],
-                                    DISTTAR_FORMAT = "gz")
-
-releaseTarGzMd5 = target.Checksum("FreeNOS-" + version.current + ".tar.gz.md5",
-                                    "FreeNOS-" + version.current + ".tar.gz")
-
-releaseTarGzSha1 = target.Checksum("FreeNOS-" + version.current + ".tar.gz.sha1",
-                                    "FreeNOS-" + version.current + ".tar.gz")
-
-#
-# Create a release BZipped TAR archive.
-#
-releaseTarBz2 = target.DistTar("FreeNOS-" + version.current + ".tar.bz2",
-                                    [target.Dir("#")],
-                                    DISTTAR_FORMAT = "bz2")
-
-releaseTarBz2Md5 = target.Checksum("FreeNOS-" + version.current + ".tar.bz2.md5",
-                                    "FreeNOS-" + version.current + ".tar.bz2")
-
-releaseTarBz2Sha1 = target.Checksum("FreeNOS-" + version.current + ".tar.bz2.sha1",
-                                    "FreeNOS-" + version.current + ".tar.bz2")
-
-#
-# Create a snapshot GZipped TAR archive.
-#
-snapshotTarGz = target.DistTar("FreeNOS-" + version.currentRev + ".tar.gz",
-                                    [target.Dir("#")],
-                                    DISTTAR_FORMAT = "gz")
-
-snapshotTarGzMd5 = target.Checksum("FreeNOS-" + version.currentRev + ".tar.gz.md5",
-                                    "FreeNOS-" + version.currentRev + 
".tar.gz")
-
-snapshotTarGzSha1 = target.Checksum("FreeNOS-" + version.currentRev + ".tar.gz.sha1",
-                                    "FreeNOS-" + version.currentRev + 
".tar.gz")
-
-#
-# Create a snapshot BZipped TAR archive.
-#
-snapshotTarBz2 = target.DistTar("FreeNOS-" + version.currentRev + ".tar.bz2",
-                                   [target.Dir("#")],
-                                   DISTTAR_FORMAT = "bz2")
-
-snapshotTarBz2Md5 = target.Checksum("FreeNOS-" + version.currentRev + ".tar.bz2.md5",
-                                    "FreeNOS-" + version.currentRev + 
".tar.bz2")
-
-snapshotTarBz2Sha1 = target.Checksum("FreeNOS-" + version.currentRev + ".tar.bz2.sha1",
-                                    "FreeNOS-" + version.currentRev + 
".tar.bz2")
-
-
-Alias("release",  [ releaseTarGz,   releaseTarGzMd5,   releaseTarGzSha1,
-                   releaseTarBz2,  releaseTarBz2Md5,  releaseTarBz2Sha1 ])
-Alias("snapshot", [ snapshotTarGz,  snapshotTarGzMd5,  snapshotTarGzSha1,
-                   snapshotTarBz2, snapshotTarBz2Md5, snapshotTarBz2Sha1 ])
=======================================
--- /site_scons/emulate.py      Sun Aug 30 19:21:38 2009 UTC
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import os
-import build
-
-build.target.Append(ENV = os.environ)
-build.PhonyTargets(build.target,
-                  qemu        = 'qemu -usb -cdrom boot/boot.iso',
- qemu_debug = 'qemu -curses -usb -cdrom boot/boot.iso -s -S -d int,pcall,exec',
-                  qemu_curses = 'qemu -curses -usb -cdrom boot/boot.iso',
-                  qemu_sdl    = 'qemu -sdl -cdrom boot/boot.iso',
- bochs = 'bochs -q "ata0-slave: type=cdrom, path=boot/boot.iso, status=inserted" ' \
-                                          '"boot: cdrom"',
- bochs_debug = 'bochs -q "ata0-slave: type=cdrom, path=boot/boot.iso, status=inserted" ' \
-                                          '"boot: cdrom" "gdbstub: enabled=1"')
=======================================
--- /site_scons/ext2.py Fri Jul  3 12:20:34 2009 UTC
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import os
-import tempfile
-import shutil
-
-from build import *
-from SCons.Script import *
-from SCons.Action import *
-
-#
-# Generate an Extended 2 Filesystem image.
-#
-def generateExt2(target, source, env):
-
-    # Open the list.
-    list = open(str(source[0]))
-
-    # Copy the entire project.
-    shutil.copytree(".", "tmproot")
-
-    # Strip all binaries.
-    os.system("strip `find tmproot` 2> /dev/null")
-
-    # Create an Extended 2 Filesystem image.
-    os.system("srv/filesystem/ext2/host/create " + str(target[0]) +
-             " tmproot -e '*.cpp' -e '*.h' -e '*.c' -e '*.o' -e 'lib*' -e 'doc' 
"
-             " -e 'SCons*' -e '*.a' -e '*.S' -e '*.ld' -e 'boot*'")
-
-    # Done.
-    os.system("rm -rf tmproot")
-    list.close()
-
-#
-# Prints out a user friendly command-line string.
-#
-def generateExt2Str(target, source, env):
-
-    return "  EXT2    " + str(target[0])
-
-#
-# Create extended 2 builder.
-#
-ext2Builder = Builder(action     = Action(generateExt2, generateExt2Str),
-                     suffix     = '.ext2',
-                     src_suffix = '.ext2desc')
-
-target.Append(BUILDERS = { 'Ext2' : ext2Builder })
-
-#
-# Specify dependencies and targets.
-#
-ext2 = target.Ext2('boot/boot.ext2', ['boot/boot.ext2desc'])
-Depends(ext2, ['bin', 'lib', 'kernel', 'sbin', 'srv'])
-AlwaysBuild(ext2)
=======================================
--- /site_scons/img.py  Fri Jul 10 06:12:51 2009 UTC
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import os
-import tempfile
-from build import *
-from SCons.Script import *
-from SCons.Action import *
-
-#
-# Generate a BootImage.
-#
-def generateBootImage(target, source, env):
-
-    # Use the host compiled 'img' program.
-    os.system("sbin/img/img " + str(source[0]) + " " + str(target[0]))
-    os.system("gzip -fq '" + str(target[0]) + "'")
-
-#
-# Output user friendly command.
-#
-def generateBootImageStr(target, source, env):
-
-    return "  IMG     " + str(target[0])
-
-#
-# Create boot image builder.
-#
-imgBuilder = Builder(action = Action(generateBootImage, generateBootImageStr),
-                    suffix     = '.img',
-                    src_suffix = '.imgdesc')
-
-target.Append(BUILDERS = { 'Img' : imgBuilder })
-
-#
-# Define dependencies and targets.
-#
-img = target.Img('boot/boot.img', ['boot/boot.imgdesc'])
-target.Clean(img, '#boot/boot.img.gz')
-Depends(img, ['bin', 'lib', 'kernel', 'sbin', 'srv'])
-AlwaysBuild(img)
=======================================
--- /site_scons/linn.py Fri Jul 10 05:40:09 2009 UTC
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import os
-from SCons.Action import *
-
-#
-# Generate an LinnFS filesystem image.
-#
-def generateLinnFS(target=None, source=None, env=None):
-
-    os.system("srv/filesystem/linn/host/create boot/boot.linn" \
- " -d . -s -n 16384 -e '*.cpp' -e '*.h' -e '*.c' -e '*.o' -e 'lib*' -e 'doc' " \
-             " -e 'SCons*' -e '*.a' -e '*.S' -e '*.ld' -e 'boot*'")
-    os.system("gzip -f boot/boot.linn")
-
-#
-# Prints out a user friendly command-line string.
-#
-def generateLinnFSStr(target, source, env):
-
-    return "  LINN    boot/boot.linn.gz"
-
-#
-# Create LinnFS Action.
-#
-action  = Action(generateLinnFS, generateLinnFSStr)
=======================================
--- /site_scons/pci.py  Sun Aug 16 21:25:53 2009 UTC
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (C) 2009 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-from build import *
-
-#
-# Copies a program to the /srv/pci directory. When
-# the PCIServer detects the given device, it will forkexec()
-# it using the bus, slot and function number as an argument.
-# A symbolic link may be a cleaner solution, when the
-# FileSystems support it.
-#
-def PCIRegister(env, program, vendor, device):
-
-    target.Command('#/etc/pci/' + hex(vendor) + ':' + hex(device),
-                   str(program), Copy("$TARGET", "$SOURCE"))
-
-target.AddMethod(PCIRegister, 'PCI')
=======================================
--- /.gitignore Sun Aug 17 18:53:50 2014 UTC
+++ /.gitignore Mon Jan 19 19:58:13 2015 UTC
@@ -8,3 +8,4 @@
 boot/boot.*
 host/
 include/FreeNOS
+.gdbinit
=======================================
--- /SConstruct Sun Aug 16 21:30:57 2009 UTC
+++ /SConstruct Mon Jan 19 19:58:13 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2010 Niek Linnenbank
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
@@ -10,31 +10,54 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-import build
-import version
-import linn
-import img
-import pci
-import iso
-import emulate
-import dist
+from build import *
+from version import *
+from archive import *
+from gdbinit import *

 #
-# Update versioning header file.
+# Target build
 #
-version.regenerateHeader()
+build_env = target
+Export('build_env')
+
+# Build programs, libraries and servers.
+VariantDir(target['BUILDROOT'] + '/lib', '#lib', duplicate = 0)
+VariantDir(target['BUILDROOT'] + '/bin', '#bin', duplicate = 0)
+VariantDir(target['BUILDROOT'] + '/server', '#server', duplicate = 0)
+VariantDir(target['BUILDROOT'] + '/regress', '#regress', duplicate = 0)
+SConscript(target['BUILDROOT'] + '/lib/SConscript')
+SConscript(target['BUILDROOT'] + '/bin/SConscript')
+SConscript(target['BUILDROOT'] + '/server/SConscript')
+SConscript(target['BUILDROOT'] + '/regress/SConscript')

 #
-# Process subscripts.
+# Host build
 #
-SConscript(dirs = ['lib', 'kernel', 'bin', 'sbin', 'srv'])
+build_env = host
+Export('build_env')
+
+# Build programs and libraries.
+VariantDir(host['BUILDROOT'] + '/lib', '#lib', duplicate = 0)
+VariantDir(host['BUILDROOT'] + '/bin', '#bin', duplicate = 0)
+VariantDir(host['BUILDROOT'] + '/regress', '#regress', duplicate = 0)
+SConscript(host['BUILDROOT'] + '/lib/SConscript')
+SConscript(host['BUILDROOT'] + '/bin/SConscript')
+SConscript(host['BUILDROOT'] + '/regress/SConscript')

 #
-# Per default, build libraries, kernel and user programs.
+# Kernel build
 #
-Default(['lib', 'kernel', 'bin', 'sbin', 'srv', 'etc'])
+build_env = kernel
+Export('build_env')
+
+# Build the kernel.
+VariantDir(kernel['BUILDROOT'] + '/kernel',
+           '#kernel/' + kernel['ARCH'] + '/' + kernel['SYSTEM'], duplicate = 0)
+SConscript(kernel['BUILDROOT'] + '/kernel/SConscript')
+
=======================================
--- /VERSION    Sat Sep  5 23:39:08 2009 UTC
+++ /VERSION    Mon Jan 19 19:58:13 2015 UTC
@@ -1,1 +1,1 @@
-0.0.5
+0.1.0
=======================================
--- /bin/bench/SConscript       Tue Jun  9 21:55:16 2009 UTC
+++ /bin/bench/SConscript       Mon Jan 19 19:58:13 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2010 Niek Linnenbank
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
@@ -10,14 +10,14 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-from build import *
+Import('build_env')

-env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
-                     [ 'memory' ])
-env.Program('bench',  [ 'Main.cpp' ],
-            LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.UseServers(['memory'])
+env.TargetProgram('bench', 'Main.cpp')
=======================================
--- /bin/cat/SConscript Fri Jun 26 14:14:31 2009 UTC
+++ /bin/cat/SConscript Mon Jan 19 19:58:13 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2010 Niek Linnenbank
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
@@ -10,12 +10,13 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-from build import *
+Import('build_env')

-env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ]) -env.Program('cat', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
+env.TargetProgram('cat', 'Main.cpp')
=======================================
***Additional files exist in this changeset.***

Other related posts:

  • » [freenos] push by nieklinn...@xxxxxxxxx - Restructure SCons build scripts. Introducing new SCons configuration i... on 2015-01-19 20:02 GMT - freenos