[freenos] push by nieklinn...@xxxxxxxxx - Moved sbin/ to bin/. Added SubDirectories() for SConscripts. Servers b... on 2015-01-20 18:38 GMT

  • From: freenos@xxxxxxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Tue, 20 Jan 2015 18:39:04 +0000

Revision: 0407f42b048e
Author:   Niek Linnenbank <nieklinnenbank@xxxxxxxxx>
Date:     Tue Jan 20 18:37:02 2015 UTC
Log: Moved sbin/ to bin/. Added SubDirectories() for SConscripts. Servers build fixed.

https://code.google.com/p/freenos/source/detail?r=0407f42b048e

Added:
 /bin/img/BootEntry.h
 /bin/img/Main.cpp
 /bin/img/Main.h
 /bin/img/SConscript
 /bin/init/Main.cpp
 /bin/init/SConscript
 /bin/reboot/Main.cpp
 /bin/reboot/SConscript
 /bin/shutdown/Main.cpp
 /bin/shutdown/SConscript
Deleted:
 /sbin/SConscript
 /sbin/img/BootEntry.h
 /sbin/img/Main.cpp
 /sbin/img/Main.h
 /sbin/img/SConscript
 /sbin/init/Main.cpp
 /sbin/init/SConscript
 /sbin/reboot/Main.cpp
 /sbin/reboot/SConscript
 /sbin/shutdown/Main.cpp
 /sbin/shutdown/SConscript
Modified:
 /.gitignore
 /SConstruct
 /bin/SConscript
 /config/x86/pc/clang.conf
 /config/x86/pc/gcc.conf
 /lib/SConscript
 /lib/liballoc/SConscript
 /lib/libc/SConscript
 /lib/libcrt/SConscript
 /lib/libteken/SConscript
 /site_scons/autoconf.py
 /site_scons/build.py
 /srv/SConscript
 /srv/ata/SConscript
 /srv/filesystem/SConscript
 /srv/filesystem/ext2/SConscript
 /srv/filesystem/grub/SConscript
 /srv/filesystem/linn/SConscript
 /srv/filesystem/proc/SConscript
 /srv/filesystem/tmp/SConscript
 /srv/idle/SConscript
 /srv/input/SConscript
 /srv/input/keyboard/SConscript
 /srv/log/SConscript
 /srv/memory/SConscript
 /srv/pci/SConscript
 /srv/process/SConscript
 /srv/serial/SConscript
 /srv/terminal/SConscript
 /srv/time/SConscript
 /srv/usb/SConscript
 /srv/usb/uhci/SConscript
 /srv/video/SConscript
 /srv/video/vga/SConscript

=======================================
--- /dev/null
+++ /bin/img/BootEntry.h        Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,42 @@
+/*
+ * 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 __IMG_BOOTENTRY_H
+#define __IMG_BOOTENTRY_H
+
+#include <ExecutableFormat.h>
+
+/** Maximum memory regions. */
+#define MAX_REGIONS    16
+
+/**
+ * Executable for use inside a BootImage.
+ */
+typedef struct BootEntry
+{
+    /** Pointer to the executable format. */
+    ExecutableFormat *format;
+
+    /** Memory regions extracted from the program. */
+    MemoryRegion regions[MAX_REGIONS];
+
+    /** Number of memory regions. */
+    Size numRegions;
+}
+BootEntry;
+
+#endif /* __IMG_BOOTENTRY_H */
=======================================
--- /dev/null
+++ /bin/img/Main.cpp   Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,227 @@
+/*
+ * 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/>.
+ */
+
+#include <FreeNOS/BootImage.h>
+#include <FreeNOS/Memory.h>
+#include <Version.h>
+#include <Array.h>
+#include <ExecutableFormat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include "BootEntry.h"
+#include "Main.h"
+
+Size readBootEntries(char *prog, char *file,
+                   Array<BootEntry> *entries)
+{
+    char line[128];
+    int num = 0;
+    Size totalBytes = 0, totalEntries = 0;
+    BootEntry *entry;
+    FILE *fp;
+
+    /* Open configuration file. */
+    if ((fp = fopen(file, "r")) == NULL)
+    {
+       fprintf(stderr, "%s: failed to open `%s': %s\n",
+               prog, file, strerror(errno));
+       exit(EXIT_FAILURE);
+    }
+    /* Read out lines. */
+    while (fgets(line, sizeof(line), fp) != NULL)
+    {
+       /* Clear newline. */
+       line[strlen(line) - 1] = 0;
+
+       /* Allocate new boot entry. */
+       entry = new BootEntry;
+
+       /* Attempt to parse the executable headers. */
+       if (!(entry->format = ExecutableFormat::find(strdup(line))))
+       {
+           fprintf(stderr, "%s: failed to read `%s': %s\n",
+                   prog, line, strerror(errno));
+           exit(EXIT_FAILURE);
+       }
+       /* Extract memory regions. */
+       else if ((num = entry->format->regions(entry->regions, MAX_REGIONS)) <= 
0)
+        {
+ fprintf(stderr, "%s: failed to extract memory regions from `%s': %s\n",
+                       prog, line, strerror(errno));
+           exit(EXIT_FAILURE);
+       }
+       else
+           entry->numRegions = num;
+
+       /* Insert into Array. */
+       entries->insert(entry);
+       totalEntries++;
+
+       /* Debug out memory sections. */
+       for (Size i = 0; i < entry->numRegions; i++)
+       {
+           printf("%s[%u]: vaddr=%x size=%u\n",
+                   line, i, (uint) entry->regions[i].virtualAddress,
+                   entry->regions[i].size);
+           totalBytes += entry->regions[i].size;
+       }
+    }
+    /* All done. */
+    printf("%d entries, %d bytes total\n", totalEntries, totalBytes);
+    return totalEntries;
+}
+
+int main(int argc, char **argv)
+{
+    Array<BootEntry> entries(128);
+    BootImage image;
+    BootVariable variables[13];
+    BootProgram *programs;
+    BootSegment *segments;
+    FILE *fp;
+    Size numEntries, numSegments = 0, dataOffset = 0;
+
+    /* Verify command-line arguments. */
+    if (argc < 3)
+    {
+       fprintf(stderr, "usage: %s FILE FILE\n",
+               argv[0]);
+       return EXIT_FAILURE;
+    }
+    /* Read executables. */
+    numEntries = readBootEntries(argv[0], argv[1], &entries);
+
+    /* Allocate tables. */
+    programs = new BootProgram[numEntries];
+
+    /* Clear first. */
+    memset(&image, 0, sizeof(image));
+    memset(&variables, 0, sizeof(variables));
+    memset(programs, 0, sizeof(BootProgram) * numEntries);
+
+    /* Fill in the boot image header. */
+    image.magic[0]       = BOOTIMAGE_MAGIC0;
+    image.magic[1]       = BOOTIMAGE_MAGIC1;
+    image.layoutRevision = BOOTIMAGE_REVISION;
+    image.variablesTableOffset = sizeof(BootImage);
+    image.variablesTableCount  = 12;
+    image.programsTableOffset  = image.variablesTableOffset +
+                                image.variablesTableCount  * 
sizeof(BootVariable);
+    image.programsTableCount   = numEntries;
+    image.segmentsTableOffset  = image.programsTableOffset  +
+                                image.programsTableCount   * 
sizeof(BootProgram);
+
+    /* Fill in the boot variables. */
+    VARIABLE(variables[0],  RELEASE);
+    VARIABLE(variables[1],  COMPILER);
+    VARIABLE(variables[2],  DATETIME);
+    VARIABLE(variables[3],  ARCH);
+    VARIABLE(variables[4],  BUILDUSER);
+    VARIABLE(variables[5],  BUILDHOST);
+    VARIABLE(variables[6],  BUILDOS);
+    VARIABLE(variables[7],  BUILDARCH);
+    VARIABLE(variables[8],  BUILDPY);
+    VARIABLE(variables[9], BUILDER);
+    VARIABLE(variables[10], BUILDPATH);
+    VARIABLE(variables[11], BUILDURL);
+
+    /* Fill in the boot programs. */
+    for (Size i = 0; i < numEntries; i++)
+    {
+       strncpy(programs[i].path, entries[i]->format->getPath(), 
BOOTIMAGE_PATH);
+       programs[i].entry = (u32) entries[i]->format->entry();
+       programs[i].segmentsOffset = numSegments;
+       programs[i].segmentsCount  = entries[i]->numRegions;
+       numSegments += entries[i]->numRegions;
+    }
+    /* Update BootImage. */
+    image.segmentsTableCount = numSegments;
+
+    /* Now we allocate and clear the segments table. */
+    segments = new BootSegment[numSegments];
+    memset(segments, 0, sizeof(BootSegment) * numSegments);
+
+    /* Point segment data after the segments table. */
+    dataOffset  = image.segmentsTableOffset +
+                 image.segmentsTableCount  * sizeof(BootSegment);
+    dataOffset += PAGESIZE - (dataOffset % PAGESIZE);
+
+    /* Fill the segments table by looping programs. */
+    for (Size i = 0; i < numEntries; i++)
+    {
+       /* Loop this program's segments. */
+       for (Size j = 0; j < entries[i]->numRegions; j++)
+       {
+           /* Fill in the segment. */
+           segments[i].virtualAddress = entries[i]->regions[j].virtualAddress;
+           segments[i].size           = entries[i]->regions[j].size;
+           segments[i].offset         = dataOffset;
+
+           /* Increment data pointer. Align on memory page boundary. */
+           dataOffset += segments[i].size;
+           dataOffset += PAGESIZE - (dataOffset % PAGESIZE);
+       }
+    }
+    /* Open boot image for writing. */
+    if ((fp = fopen(argv[2], "w")) == NULL)
+    {
+       fprintf(stderr, "%s: failed to open `%s': %s\n",
+               argv[0], argv[2], strerror(errno));
+       return EXIT_FAILURE;
+    }
+    /* Write the final boot image headers. */
+    if (fwrite(&image,     sizeof(image),     1, fp) <= 0 ||
+        fwrite(&variables, sizeof(variables), 1, fp) <= 0 ||
+       fwrite( programs,  sizeof(BootProgram) * numEntries,  1, fp) <= 0 ||
+       fwrite( segments,  sizeof(BootSegment) * numSegments, 1, fp) <= 0)
+    {
+       fprintf(stderr, "%s: failed to write BootImage headers to `%s': %s\n",
+               argv[0], argv[2], strerror(errno));
+       return EXIT_FAILURE;
+    }
+    /* Write the contents of the BootSegments. */
+    for (Size i = 0; i < numEntries; i++)
+    {
+       /* Loop regions/segments per BootProgram entry. */
+       for (Size j = 0; j < entries[i]->numRegions; j++)
+       {
+           /* Adjust file pointer. */
+           if (fseek(fp, segments[programs[i].segmentsOffset].offset,
+                     SEEK_SET) == -1)
+           {
+ fprintf(stderr, "%s: failed to seek to BootSegment contents in `%s': %s\n",
+                       argv[0], argv[2], strerror(errno));
+               return EXIT_FAILURE;
+           }
+           /* Write segment contents. */
+           if (fwrite(entries[i]->regions[j].data,
+                      entries[i]->regions[j].size, 1, fp) <= 0)
+           {
+               fprintf(stderr, "%s: failed to write BootSegment contents to `%s': 
%s\n",
+                       argv[0], argv[2], strerror(errno));
+               return EXIT_FAILURE;
+           }
+       }
+    }
+    /* Close file. */
+    fclose(fp);
+
+    /* Exit immediately. */
+    return EXIT_SUCCESS;
+}
=======================================
--- /dev/null
+++ /bin/img/Main.h     Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,46 @@
+/*
+ * 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 __IMG_MAIN_H
+#define __IMG_MAIN_H
+
+#include <FreeNOS/BootImage.h>
+#include <string.h>
+
+/**
+ * Helper macro for VALUEOF().
+ * @see VALUEOF
+ */
+#define VALUE(x) x
+
+/**
+ * Double expand the input argument.
+ * @return Double expanded value.
+ */
+#define VALUEOF(x) VALUE(x)
+
+/**
+ * Fills in an BootVariable.
+ * @param entry Pointer to an BootVariable.
+ * @param var Name of a C preprocessor macro.
+ * @see BootVariable
+ */
+#define VARIABLE(entry,var) \
+    strncpy((entry).key,   #var, BOOTIMAGE_KEY); \
+    strncpy((entry).value, VALUEOF(var), BOOTIMAGE_VALUE);
+
+#endif /* __IMG_MAIN_H */
=======================================
--- /dev/null
+++ /bin/img/SConscript Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,22 @@
+#
+# 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_env')
+
+env = build_env.Clone()
+env.UseLibraries([ 'libexec' ], 'host')
+env.HostProgram('img', 'Main.cpp')
=======================================
--- /dev/null
+++ /bin/init/Main.cpp  Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,41 @@
+/*
+ * 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/>.
+ */
+#include <API/ProcessCtl.h>
+#include <Macros.h>
+#include <Config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+int main(int argc, char **argv)
+{
+    const char *av[] = { "/bin/sh/sh", "/etc/rc", ZERO };
+
+    /*
+     * TODO: give up all privileges.
+     */
+
+    /* Execute the run commands file. */
+    forkexec("/bin/sh/sh", av);
+
+    /* Exit immediately. */
+    return EXIT_SUCCESS;
+}
=======================================
--- /dev/null
+++ /bin/init/SConscript        Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,23 @@
+#
+# 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_env')
+
+env = build_env.Clone()
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.UseServers(['memory', 'filesystem'])
+env.TargetProgram('init', 'Main.cpp')
=======================================
--- /dev/null
+++ /bin/reboot/Main.cpp        Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,23 @@
+/*
+ * 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/>.
+ */
+
+#include <API/PrivExec.h>
+
+int main(int argc, char **argv)
+{
+    return PrivExec(Reboot);
+}
=======================================
--- /dev/null
+++ /bin/reboot/SConscript      Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,22 @@
+#
+# 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_env')
+
+env = build_env.Clone()
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('reboot', 'Main.cpp')
=======================================
--- /dev/null
+++ /bin/shutdown/Main.cpp      Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,23 @@
+/*
+ * 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/>.
+ */
+
+#include <API/PrivExec.h>
+
+int main(int argc, char **argv)
+{
+    return PrivExec(Shutdown);
+}
=======================================
--- /dev/null
+++ /bin/shutdown/SConscript    Tue Jan 20 18:37:02 2015 UTC
@@ -0,0 +1,22 @@
+#
+# 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_env')
+
+env = build_env.Clone()
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('shutdown', 'Main.cpp')
=======================================
--- /sbin/SConscript    Fri Jun 12 11:37:13 2009 UTC
+++ /dev/null
@@ -1,18 +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/>.
-#
-
-SConscript(dirs = [ 'init', 'img', 'reboot', 'shutdown' ] )
=======================================
--- /sbin/img/BootEntry.h       Thu Jun  4 22:32:18 2009 UTC
+++ /dev/null
@@ -1,42 +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 __IMG_BOOTENTRY_H
-#define __IMG_BOOTENTRY_H
-
-#include <ExecutableFormat.h>
-
-/** Maximum memory regions. */
-#define MAX_REGIONS    16
-
-/**
- * Executable for use inside a BootImage.
- */
-typedef struct BootEntry
-{
-    /** Pointer to the executable format. */
-    ExecutableFormat *format;
-
-    /** Memory regions extracted from the program. */
-    MemoryRegion regions[MAX_REGIONS];
-
-    /** Number of memory regions. */
-    Size numRegions;
-}
-BootEntry;
-
-#endif /* __IMG_BOOTENTRY_H */
=======================================
--- /sbin/img/Main.cpp  Sun Jun 21 22:41:48 2009 UTC
+++ /dev/null
@@ -1,228 +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/>.
- */
-
-#include <FreeNOS/BootImage.h>
-#include <FreeNOS/Memory.h>
-#include <Version.h>
-#include <Array.h>
-#include <ExecutableFormat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "BootEntry.h"
-#include "Main.h"
-
-Size readBootEntries(char *prog, char *file,
-                   Array<BootEntry> *entries)
-{
-    char line[128];
-    int num = 0;
-    Size totalBytes = 0, totalEntries = 0;
-    BootEntry *entry;
-    FILE *fp;
-
-    /* Open configuration file. */
-    if ((fp = fopen(file, "r")) == NULL)
-    {
-       fprintf(stderr, "%s: failed to open `%s': %s\n",
-               prog, file, strerror(errno));
-       exit(EXIT_FAILURE);
-    }
-    /* Read out lines. */
-    while (fgets(line, sizeof(line), fp) != NULL)
-    {
-       /* Clear newline. */
-       line[strlen(line) - 1] = 0;
-
-       /* Allocate new boot entry. */
-       entry = new BootEntry;
-
-       /* Attempt to parse the executable headers. */
-       if (!(entry->format = ExecutableFormat::find(strdup(line))))
-       {
-           fprintf(stderr, "%s: failed to read `%s': %s\n",
-                   prog, line, strerror(errno));
-           exit(EXIT_FAILURE);
-       }
-       /* Extract memory regions. */
-       else if ((num = entry->format->regions(entry->regions, MAX_REGIONS)) <= 
0)
-        {
- fprintf(stderr, "%s: failed to extract memory regions from `%s': %s\n",
-                       prog, line, strerror(errno));
-           exit(EXIT_FAILURE);
-       }
-       else
-           entry->numRegions = num;
-
-       /* Insert into Array. */
-       entries->insert(entry);
-       totalEntries++;
-
-       /* Debug out memory sections. */
-       for (Size i = 0; i < entry->numRegions; i++)
-       {
-           printf("%s[%u]: vaddr=%x size=%u\n",
-                   line, i, (uint) entry->regions[i].virtualAddress,
-                   entry->regions[i].size);
-           totalBytes += entry->regions[i].size;
-       }
-    }
-    /* All done. */
-    printf("%d entries, %d bytes total\n", totalEntries, totalBytes);
-    return totalEntries;
-}
-
-int main(int argc, char **argv)
-{
-    Array<BootEntry> entries(128);
-    BootImage image;
-    BootVariable variables[13];
-    BootProgram *programs;
-    BootSegment *segments;
-    FILE *fp;
-    Size numEntries, numSegments = 0, dataOffset = 0;
-
-    /* Verify command-line arguments. */
-    if (argc < 3)
-    {
-       fprintf(stderr, "usage: %s FILE FILE\n",
-               argv[0]);
-       return EXIT_FAILURE;
-    }
-    /* Read executables. */
-    numEntries = readBootEntries(argv[0], argv[1], &entries);
-
-    /* Allocate tables. */
-    programs = new BootProgram[numEntries];
-
-    /* Clear first. */
-    memset(&image, 0, sizeof(image));
-    memset(&variables, 0, sizeof(variables));
-    memset(programs, 0, sizeof(BootProgram) * numEntries);
-
-    /* Fill in the boot image header. */
-    image.magic[0]       = BOOTIMAGE_MAGIC0;
-    image.magic[1]       = BOOTIMAGE_MAGIC1;
-    image.layoutRevision = BOOTIMAGE_REVISION;
-    image.variablesTableOffset = sizeof(BootImage);
-    image.variablesTableCount  = 13;
-    image.programsTableOffset  = image.variablesTableOffset +
-                                image.variablesTableCount  * 
sizeof(BootVariable);
-    image.programsTableCount   = numEntries;
-    image.segmentsTableOffset  = image.programsTableOffset  +
-                                image.programsTableCount   * 
sizeof(BootProgram);
-
-    /* Fill in the boot variables. */
-    VARIABLE(variables[0],  RELEASE);
-    VARIABLE(variables[1],  COMPILER);
-    VARIABLE(variables[2],  DATETIME);
-    VARIABLE(variables[3],  ARCH);
-    VARIABLE(variables[4],  BUILDUSER);
-    VARIABLE(variables[5],  BUILDHOST);
-    VARIABLE(variables[6],  BUILDOS);
-    VARIABLE(variables[7],  BUILDARCH);
-    VARIABLE(variables[8],  BUILDCPU);
-    VARIABLE(variables[9],  BUILDPY);
-    VARIABLE(variables[10], BUILDER);
-    VARIABLE(variables[11], BUILDPATH);
-    VARIABLE(variables[12], BUILDURL);
-
-    /* Fill in the boot programs. */
-    for (Size i = 0; i < numEntries; i++)
-    {
-       strncpy(programs[i].path, entries[i]->format->getPath(), 
BOOTIMAGE_PATH);
-       programs[i].entry = (u32) entries[i]->format->entry();
-       programs[i].segmentsOffset = numSegments;
-       programs[i].segmentsCount  = entries[i]->numRegions;
-       numSegments += entries[i]->numRegions;
-    }
-    /* Update BootImage. */
-    image.segmentsTableCount = numSegments;
-
-    /* Now we allocate and clear the segments table. */
-    segments = new BootSegment[numSegments];
-    memset(segments, 0, sizeof(BootSegment) * numSegments);
-
-    /* Point segment data after the segments table. */
-    dataOffset  = image.segmentsTableOffset +
-                 image.segmentsTableCount  * sizeof(BootSegment);
-    dataOffset += PAGESIZE - (dataOffset % PAGESIZE);
-
-    /* Fill the segments table by looping programs. */
-    for (Size i = 0; i < numEntries; i++)
-    {
-       /* Loop this program's segments. */
-       for (Size j = 0; j < entries[i]->numRegions; j++)
-       {
-           /* Fill in the segment. */
-           segments[i].virtualAddress = entries[i]->regions[j].virtualAddress;
-           segments[i].size           = entries[i]->regions[j].size;
-           segments[i].offset         = dataOffset;
-
-           /* Increment data pointer. Align on memory page boundary. */
-           dataOffset += segments[i].size;
-           dataOffset += PAGESIZE - (dataOffset % PAGESIZE);
-       }
-    }
-    /* Open boot image for writing. */
-    if ((fp = fopen(argv[2], "w")) == NULL)
-    {
-       fprintf(stderr, "%s: failed to open `%s': %s\n",
-               argv[0], argv[2], strerror(errno));
-       return EXIT_FAILURE;
-    }
-    /* Write the final boot image headers. */
-    if (fwrite(&image,     sizeof(image),     1, fp) <= 0 ||
-        fwrite(&variables, sizeof(variables), 1, fp) <= 0 ||
-       fwrite( programs,  sizeof(BootProgram) * numEntries,  1, fp) <= 0 ||
-       fwrite( segments,  sizeof(BootSegment) * numSegments, 1, fp) <= 0)
-    {
-       fprintf(stderr, "%s: failed to write BootImage headers to `%s': %s\n",
-               argv[0], argv[2], strerror(errno));
-       return EXIT_FAILURE;
-    }
-    /* Write the contents of the BootSegments. */
-    for (Size i = 0; i < numEntries; i++)
-    {
-       /* Loop regions/segments per BootProgram entry. */
-       for (Size j = 0; j < entries[i]->numRegions; j++)
-       {
-           /* Adjust file pointer. */
-           if (fseek(fp, segments[programs[i].segmentsOffset].offset,
-                     SEEK_SET) == -1)
-           {
- fprintf(stderr, "%s: failed to seek to BootSegment contents in `%s': %s\n",
-                       argv[0], argv[2], strerror(errno));
-               return EXIT_FAILURE;
-           }
-           /* Write segment contents. */
-           if (fwrite(entries[i]->regions[j].data,
-                      entries[i]->regions[j].size, 1, fp) <= 0)
-           {
-               fprintf(stderr, "%s: failed to write BootSegment contents to `%s': 
%s\n",
-                       argv[0], argv[2], strerror(errno));
-               return EXIT_FAILURE;
-           }
-       }
-    }
-    /* Close file. */
-    fclose(fp);
-
-    /* Exit immediately. */
-    return EXIT_SUCCESS;
-}
=======================================
--- /sbin/img/Main.h    Sat Jun  6 13:01:22 2009 UTC
+++ /dev/null
@@ -1,46 +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 __IMG_MAIN_H
-#define __IMG_MAIN_H
-
-#include <FreeNOS/BootImage.h>
-#include <string.h>
-
-/**
- * Helper macro for VALUEOF().
- * @see VALUEOF
- */
-#define VALUE(x) x
-
-/**
- * Double expand the input argument.
- * @return Double expanded value.
- */
-#define VALUEOF(x) VALUE(x)
-
-/**
- * Fills in an BootVariable.
- * @param entry Pointer to an BootVariable.
- * @param var Name of a C preprocessor macro.
- * @see BootVariable
- */
-#define VARIABLE(entry,var) \
-    strncpy((entry).key,   #var, BOOTIMAGE_KEY); \
-    strncpy((entry).value, VALUEOF(var), BOOTIMAGE_VALUE);
-
-#endif /* __IMG_MAIN_H */
=======================================
--- /sbin/img/SConscript        Wed Jun  3 14:14:27 2009 UTC
+++ /dev/null
@@ -1,21 +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 *
-
-env = Prepare(host, [ 'libexec' ])
-env.Program('img', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
=======================================
--- /sbin/init/Main.cpp Sat Oct 24 20:14:36 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/>.
- */
-#include <API/ProcessCtl.h>
-#include <Macros.h>
-#include <Config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-int main(int argc, char **argv)
-{
-    const char *av[] = { "/bin/sh/sh", "/etc/rc", ZERO };
-
-    /*
-     * TODO: give up all privileges.
-     */
-
-    /* Execute the run commands file. */
-    forkexec("/bin/sh/sh", av);
-
-    /* Exit immediately. */
-    return EXIT_SUCCESS;
-}
=======================================
--- /sbin/init/SConscript       Fri Jun  5 11:57:25 2009 UTC
+++ /dev/null
@@ -1,23 +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 *
-
-env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
-                     [ 'filesystem' ])
-
-env.Program('init', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
=======================================
--- /sbin/reboot/Main.cpp       Tue Jun  9 21:55:16 2009 UTC
+++ /dev/null
@@ -1,23 +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/>.
- */
-
-#include <API/PrivExec.h>
-
-int main(int argc, char **argv)
-{
-    return PrivExec(Reboot);
-}
=======================================
--- /sbin/reboot/SConscript     Tue Jun  9 21:55:16 2009 UTC
+++ /dev/null
@@ -1,22 +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 *
-
-env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ])
-env.Program('reboot',  [ 'Main.cpp' ],
-            LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
=======================================
--- /sbin/shutdown/Main.cpp     Fri Jun 12 11:37:13 2009 UTC
+++ /dev/null
@@ -1,23 +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/>.
- */
-
-#include <API/PrivExec.h>
-
-int main(int argc, char **argv)
-{
-    return PrivExec(Shutdown);
-}
=======================================
--- /sbin/shutdown/SConscript   Fri Jun 12 11:37:13 2009 UTC
+++ /dev/null
@@ -1,22 +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 *
-
-env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ])
-env.Program('shutdown',  [ 'Main.cpp' ],
-            LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
=======================================
--- /.gitignore Mon Jan 19 19:58:13 2015 UTC
+++ /.gitignore Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,7 @@
 *.o
 *.a
 *.pyc
+build/
 include/Version.h
 config.log
 .sconf_temp
=======================================
--- /SConstruct Mon Jan 19 19:58:13 2015 UTC
+++ /SConstruct Tue Jan 20 18:37:02 2015 UTC
@@ -29,12 +29,10 @@
 # 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)
+VariantDir(target['BUILDROOT'] + '/srv', '#srv', duplicate = 0)
 SConscript(target['BUILDROOT'] + '/lib/SConscript')
 SConscript(target['BUILDROOT'] + '/bin/SConscript')
-SConscript(target['BUILDROOT'] + '/server/SConscript')
-SConscript(target['BUILDROOT'] + '/regress/SConscript')
+SConscript(target['BUILDROOT'] + '/srv/SConscript')

 #
 # Host build
@@ -45,10 +43,10 @@
 # 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)
+VariantDir(host['BUILDROOT'] + '/srv', '#srv', duplicate = 0)
 SConscript(host['BUILDROOT'] + '/lib/SConscript')
 SConscript(host['BUILDROOT'] + '/bin/SConscript')
-SConscript(host['BUILDROOT'] + '/regress/SConscript')
+SConscript(host['BUILDROOT'] + '/srv/SConscript')

 #
 # Kernel build
=======================================
--- /bin/SConscript     Sun Aug 17 18:54:53 2014 UTC
+++ /bin/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
+# Copyright (C) 2015 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
@@ -15,7 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-SConscript(dirs = [ 'sh', 'ps', 'memstat', 'mount',
-                   'bench', 'hostname', 'parse',
-                   'uname', 'cat', 'ls', 'stat', 'touch',
-                   'mknod', 'echo' ])
+Import('*')
+
+SubDirectories()
=======================================
--- /config/x86/pc/clang.conf   Mon Jan 19 19:58:13 2015 UTC
+++ /config/x86/pc/clang.conf   Tue Jan 20 18:37:02 2015 UTC
@@ -19,8 +19,9 @@
 AS        = 'clang'
 LD        = 'clang'
 CCFLAGS   = [ '-m32', '-Wall', '-nostdinc',
-             '-fno-builtin', '-fno-stack-protector', '-g3', '-ansi',
-              '-fno-rtti', '-fno-exceptions' ]
+             '-fno-builtin', '-fno-stack-protector', '-g3',
+             '-Wno-write-strings' ]
+CXXFLAGS  = [ '-fno-rtti', '-fno-exceptions' ]
 ASFLAGS   = [ '-m32', '-Wall', '-nostdinc' ]
LINKFLAGS = [ '-m32', '-static', '-nostdlib', '-nostartfiles', '-nodefaultlibs', '-Wl,-whole-archive' ]
 LINKUSER  = [ '-T', 'config/x86/pc/user.ld' ]
=======================================
--- /config/x86/pc/gcc.conf     Mon Jan 19 19:58:13 2015 UTC
+++ /config/x86/pc/gcc.conf     Tue Jan 20 18:37:02 2015 UTC
@@ -19,8 +19,9 @@
 AS        = 'gcc'
 LD        = 'gcc'
 CCFLAGS   = [ '-m32', '-Wall', '-nostdinc',
-             '-fno-stack-protector', '-fno-builtin', '-g3', '-ansi',
-             '-fno-rtti', '-fno-exceptions' ]
+             '-fno-stack-protector', '-fno-builtin', '-g3',
+             '-Wno-write-strings' ]
+CXXFLAGS  = [ '-fno-rtti', '-fno-exceptions' ]
 ASFLAGS   = [ '-m32', '-Wall', '-nostdinc' ]
 LINKFLAGS = [ '-m32', '-static', '-nostdlib', '-nostartfiles',
              '-nodefaultlibs', '-Wl,-whole-archive' ]
=======================================
--- /lib/SConscript     Fri Sep  4 14:55:40 2009 UTC
+++ /lib/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
+# Copyright (C) 2015 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
@@ -15,5 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-SConscript( dirs = [ 'liballoc', 'libc', 'libcrt', 'libexec',
-                    'libparse', 'libposix', 'libteken' ])
+Import('*')
+
+SubDirectories()
=======================================
--- /lib/liballoc/SConscript    Mon Jan 19 19:58:13 2015 UTC
+++ /lib/liballoc/SConscript    Tue Jan 20 18:37:02 2015 UTC
@@ -21,12 +21,4 @@
 env.UseLibraries([ 'libc', 'libposix' ])
 env.UseServers([ 'memory' ])
 env.Append(CPPPATH = [ '.' ])
-env.Library('liballoc', [ Glob('*.cpp') ])
-
-
-#from build import *
-#
-#env = Prepare(target, [ 'libposix', 'libc' ], [ 'memory' ])
-#env.Library('liballoc', [ 'Allocator.cpp', 'BubbleAllocator.cpp',
-#                        'ListAllocator.cpp', 'PageAllocator.cpp',
-#                        'PoolAllocator.cpp', 'VMCtlAllocator.cpp' ])
+env.TargetLibrary('liballoc', [ Glob('*.cpp') ])
=======================================
--- /lib/libc/SConscript        Mon Jan 19 19:58:13 2015 UTC
+++ /lib/libc/SConscript        Tue Jan 20 18:37:02 2015 UTC
@@ -21,9 +21,9 @@
 env.UseLibraries([ 'libposix' ])
 env.UseServers([ 'process' ])
 env.Append(CPPPATH = [ '.' ])
-env.Library('libc', [ Glob('stdio/*.c'),
-                     Glob('stdlib/*.c'),
-                     Glob('stdlib/*.cpp'),
-                     Glob('string/*.c'),
-                     Glob('*.c') ])
+env.TargetLibrary('libc', [ Glob('stdio/*.c'),
+                           Glob('stdlib/*.c'),
+                           Glob('stdlib/*.cpp'),
+                           Glob('string/*.c'),
+                           Glob('*.c') ])

=======================================
--- /lib/libcrt/SConscript      Mon Jan 19 19:58:13 2015 UTC
+++ /lib/libcrt/SConscript      Tue Jan 20 18:37:02 2015 UTC
@@ -20,4 +20,4 @@
 env = build_env.Clone()
 env.UseLibraries([ 'libposix', 'libc', 'liballoc' ])
 env.UseServers([ 'process', 'memory', 'filesystem' ])
-env.Library('libcrt', [ Glob('*.cpp') ])
+env.TargetLibrary('libcrt', [ Glob('*.cpp') ])
=======================================
--- /lib/libteken/SConscript    Mon Jan 19 19:58:13 2015 UTC
+++ /lib/libteken/SConscript    Tue Jan 20 18:37:02 2015 UTC
@@ -19,5 +19,6 @@

 env = build_env.Clone()
 env.Append(CCFLAGS = [ '-DTEKEN_XTERM' ])
+env.UseLibraries(['libposix', 'libc'])
 env.UseServers([ 'terminal', 'process' ])
-env.Library('libexec', [ Glob('*.cpp') ])
+env.Library('libteken', [ Glob('*.c') ])
=======================================
--- /site_scons/autoconf.py     Mon Jan 19 19:58:13 2015 UTC
+++ /site_scons/autoconf.py     Tue Jan 20 18:37:02 2015 UTC
@@ -33,7 +33,7 @@
                  "}\n"

     # Try to compile and link it.
-    result = context.TryLink(source_file, '.cpp')
+    result = context.TryLink(source_file, '.c')

     # Return the result status.
     context.Result(result)
@@ -84,7 +84,7 @@
                  "}\n"

     # Try to compile and link it.
-    result = context.TryLink(source_file, '.cpp')
+    result = context.TryCompile(source_file, '.cpp')

     # Return the result status.
     context.Result(result)
=======================================
--- /site_scons/build.py        Mon Jan 19 19:58:13 2015 UTC
+++ /site_scons/build.py        Tue Jan 20 18:37:02 2015 UTC
@@ -22,7 +22,6 @@
     """
     Prepares a given environment, by adding library dependencies.
     """
-
     # By default exclude host. If arch filter is set, apply it.
if (not arch and env['ARCH'] == 'host') or (arch and env['ARCH'] != arch):
         return
@@ -58,6 +57,19 @@
     if env['ARCH'] != 'host':
        env.Library(lib, source)

+def SubDirectories():
+    dir_list = []
+    dir_src  = Dir('.').srcnode().abspath
+
+    if dir_src:
+       for f in os.listdir(dir_src):
+           if os.path.isdir(dir_src + os.sep + f):
+               dir_list.append(f)
+
+       SConscript( dirs = dir_list )
+
+Export('SubDirectories')
+
 # Create target, host and kernel environments.
 host = Environment()
 host.AddMethod(HostProgram, "HostProgram")
@@ -74,9 +86,9 @@
 global_vars = Variables('build.conf')
 global_vars.Add('VERSION', 'FreeNOS release version number')
global_vars.Add(EnumVariable('ARCH', 'Target machine CPU architecture', 'x86',
-                             allowed_values = ('x86')))
+                             allowed_values = ("x86",)))
 global_vars.Add(EnumVariable('SYSTEM', 'Target machine system type', 'pc',
-                             allowed_values = ('pc')))
+                             allowed_values = ("pc",)))
 global_vars.Add(PathVariable('COMPILER', 'Target compiler chain', None))
 global_vars.Add('BUILDROOT','Object output directory')
global_vars.Add(BoolVariable('VERBOSE', 'Output verbose compilation commands', False))
@@ -89,6 +101,7 @@
 system_vars.Add('AS', 'Assembler')
 system_vars.Add('LD', 'Linker')
 system_vars.Add('CCFLAGS', 'C/C++ Compiler flags')
+system_vars.Add('CXXFLAGS', 'C++ Compiler flags')
 system_vars.Add('ASFLAGS', 'Assembler flags')
 system_vars.Add('LINKFLAGS', 'Linker flags')
 system_vars.Add('LINKKERN', 'Linker flags for the kernel linker script')
@@ -98,17 +111,18 @@

 # Enables verbose compilation command output.
 if not target['VERBOSE']:
-    target['CXXCOMSTR']    = host['CXXCOMSTR']    = "  CXX $TARGET"
-    target['CCCOMSTR']     = host['CCCOMSTR']     = "  CC  $TARGET"
-    target['ASCOMSTR']     = host['ASCOMSTR']     = "  AS  $TARGET"
-    target['ASPPCOMSTR']   = host['ASPPCOMSTR']   = "  AS  $TARGET"
-    target['ARCOMSTR']     = host['ARCOMSTR']     = "  AR  $TARGET"
-    target['RANLIBCOMSTR'] = host['RANLIBCOMSTR'] = "  LIB $TARGET"
-    target['LINKCOMSTR']   = host['LINKCOMSTR']   = "  LD  $TARGET"
+    target['CXXCOMSTR']    = host['CXXCOMSTR']    = "  CXX  $TARGET"
+    target['CCCOMSTR']     = host['CCCOMSTR']     = "  CC   $TARGET"
+    target['ASCOMSTR']     = host['ASCOMSTR']     = "  AS   $TARGET"
+    target['ASPPCOMSTR']   = host['ASPPCOMSTR']   = "  AS   $TARGET"
+    target['ARCOMSTR']     = host['ARCOMSTR']     = "  AR   $TARGET"
+    target['RANLIBCOMSTR'] = host['RANLIBCOMSTR'] = "  LIB  $TARGET"
+    target['LINKCOMSTR']   = host['LINKCOMSTR']   = "  LD   $TARGET"

 # Verify the configured CFLAGS.
 if not GetOption('clean'):
     CheckCCFlags(target)
+    CheckCXXFlags(target)

 # Kernel environment is the same as target, except for linker scripts.
 kernel = target.Clone()
@@ -121,7 +135,7 @@
 host.Replace(ARCH      = 'host')
 host.Replace(SYSTEM    = 'host')
 host.Replace(BUILDROOT = 'build/host')
-host.Append (CPPFLAGS  = '-DHOST')
+host.Append (CPPFLAGS  = '-D__HOST__')
 host.Append (CPPPATH   = [ '#include' ])

 # Provide configuration help.
=======================================
--- /srv/SConscript     Thu Sep  3 22:52:22 2009 UTC
+++ /srv/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
+# Copyright (C) 2015 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
@@ -15,5 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-SConscript(dirs = [ 'log', 'idle', 'memory', 'pci', 'usb', 'ata', 'video', 'input',
-                   'process', 'serial', 'terminal', 'time', 'filesystem' ])
+Import('*')
+
+SubDirectories()
=======================================
--- /srv/ata/SConscript Thu Sep  3 22:52:22 2009 UTC
+++ /srv/ata/SConscript Tue Jan 20 18:37:02 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,15 +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' ],
-                     [ 'log', 'filesystem', 'process', 'memory', 'pci'])
-
-env.Program('server', [ 'ATAController.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.UseServers(['log', 'filesystem', 'process', 'memory', 'pci'])
+env.TargetProgram('server', [Glob('*.cpp')])
=======================================
--- /srv/filesystem/SConscript  Fri Sep  4 14:53:55 2009 UTC
+++ /srv/filesystem/SConscript  Tue Jan 20 18:37:02 2015 UTC
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
+# Copyright (C) 2015 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
@@ -15,4 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-SConscript(dirs = [ 'ext2', 'linn', 'proc', 'tmp', 'grub' ])
+Import('*')
+
+SubDirectories()
=======================================
--- /srv/filesystem/ext2/SConscript     Sun Aug  2 12:06:01 2009 UTC
+++ /srv/filesystem/ext2/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,32 +10,17 @@
 # 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')

-#
-# Target system environment.
-#
-targetEnv = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
-                     [ 'filesystem', 'process', 'memory', 'log' ])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries(['libexec'])
+env.HostProgram('create', [ 'Ext2Create.cpp' ])

-#
-# Host system environment.
-#
-hostEnv   = Prepare(host, [ 'libexec' ], [ 'filesystem' ])
-
-#
-# Extended 2 FileSystem server.
-#
-targetEnv.Program('server', [ 'Ext2Directory.cpp', 'Ext2File.cpp', 'Ext2FileSystem.cpp' ],
-                  LIBS = targetEnv['LIBS'], LIBPATH = targetEnv['LIBPATH'])
-
-#
-# Extended 2 FileSystem creation utility.
-#
-hostEnv.Program('host/create', [ 'host/Ext2Create.cpp' ],
-                LIBS = hostEnv['LIBS'], LIBPATH = hostEnv['LIBPATH'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt' ])
+env.TargetProgram('server', [ 'Ext2Directory.cpp', 'Ext2File.cpp', 'Ext2FileSystem.cpp' ])
=======================================
--- /srv/filesystem/grub/SConscript     Fri Sep  4 14:53:55 2009 UTC
+++ /srv/filesystem/grub/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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' ],
-                     [ 'filesystem', 'process', 'log', 'memory' ])
-
-env.Program('server', [ 'Main.cpp', 'GRUBFileSystem.cpp', 'GRUBModule.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/filesystem/linn/SConscript     Sun Aug  2 12:08:22 2009 UTC
+++ /srv/filesystem/linn/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,39 +10,18 @@
 # 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')

-#
-# Target system environment.
-#
-targetEnv = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
-                           [ 'filesystem', 'process', 'memory', 'log' ])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries(['libexec'])
+env.HostProgram('create', [ 'LinnCreate.cpp' ])
+env.HostProgram('dump', [ 'LinnDump.cpp' ])

-#
-# Host system environment.
-#
-hostEnv   = Prepare(host, [ 'libexec' ], [ 'filesystem' ])
-
-#
-# Linnenbank FileSystem creation utility.
-#
-hostEnv.Program('host/create', [ 'host/LinnCreate.cpp' ],
-                LIBS = hostEnv['LIBS'], LIBPATH = hostEnv['LIBPATH'])
-
-#
-# Linnenbank FileSystem dump utility.
-#
-hostEnv.Program('host/dump', [ 'host/LinnDump.cpp' ],
-                LIBS = hostEnv['LIBS'], LIBPATH = hostEnv['LIBPATH'])
-
-#
-# Linnenbank FileSystem server.
-#
-targetEnv.Program('server', [ 'LinnFileSystem.cpp', 'LinnFile.cpp',
-                             'LinnDirectory.cpp' ],
-                  LIBS = targetEnv['LIBS'], LIBPATH = targetEnv['LIBPATH'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt' ])
+env.TargetProgram('server', [ 'LinnDirectory.cpp', 'LinnFile.cpp', 'LinnFileSystem.cpp' ])
=======================================
--- /srv/filesystem/proc/SConscript     Tue Aug 11 21:29:34 2009 UTC
+++ /srv/filesystem/proc/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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' ],
-                     [ 'filesystem', 'process', 'log', 'memory' ])
-
-env.Program('server', [ 'Main.cpp', 'ProcFileSystem.cpp', 'ProcRootDirectory.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/filesystem/tmp/SConscript      Tue Aug 11 21:29:34 2009 UTC
+++ /srv/filesystem/tmp/SConscript      Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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' ],
-                     [ 'filesystem', 'process', 'log', 'memory' ])
-
-env.Program('server', [ 'Main.cpp', 'TmpFileSystem.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/idle/SConscript        Sun Jun 28 09:30:20 2009 UTC
+++ /srv/idle/SConscript        Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,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' ]) -env.Program('server', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/input/SConscript       Sun Aug  2 11:56:56 2009 UTC
+++ /srv/input/SConscript       Tue Jan 20 18:37:02 2015 UTC
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
+# Copyright (C) 2015 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
@@ -15,4 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #

-SConscript(dirs = [ 'keyboard' ])
+Import('*')
+
+SubDirectories()
=======================================
--- /srv/input/keyboard/SConscript      Sun Aug  2 11:56:56 2009 UTC
+++ /srv/input/keyboard/SConscript      Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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', 'libteken' ],
-                     [ 'filesystem', 'process', 'memory' ])
-
-env.Program('server', [ 'Keyboard.cpp', 'Main.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec', 'libteken' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/log/SConscript Sun Aug  2 11:59:34 2009 UTC
+++ /srv/log/SConscript Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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' ],
-                     [ 'filesystem', 'memory' ])
-
-env.Program('server', [ 'SystemLog.cpp', 'Main.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/memory/SConscript      Sun Aug  2 10:22:02 2009 UTC
+++ /srv/memory/SConscript      Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,18 +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, [ 'liballoc', 'libposix', 'libexec', 'libc', 'libcrt' ],
-                     [ 'process', 'log', 'filesystem' ])
-
-env.Program('server', [ 'MemoryServer.cpp',
-                       'CreatePrivate.cpp', 'ReservePrivate.cpp',
-                       'ReleasePrivate.cpp', 'CreateShared.cpp',
-                       'SystemMemory.cpp', 'Main.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/pci/SConscript Sun Aug 30 19:31:31 2009 UTC
+++ /srv/pci/SConscript Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,18 +10,15 @@
 # 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' ],
-                     [ 'log', 'filesystem', 'process', 'memory' ])
-
-env.Program('server', [ 'PCIServer.cpp', 'PCIRegister.cpp', 'PCIConfig.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
-
-env.Program('detect', [ 'PCIDetect.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ 'PCIServer.cpp', 'PCIRegister.cpp', 'PCIConfig.cpp' ])
+env.TargetProgram('detect', [ 'PCIDetect.cpp' ])
=======================================
--- /srv/process/SConscript     Sun Aug  2 12:03:39 2009 UTC
+++ /srv/process/SConscript     Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,18 +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', 'libparse' ],
-                     [ 'filesystem', 'memory', 'log' ])
-
-env.Program('server', [ 'ProcessServer.cpp', 'CloneProcess.cpp',
-                       'ExitProcess.cpp', 'ReadProcess.cpp',
-                       'SpawnProcess.cpp', 'WaitProcess.cpp', 
'SetCurrentDirectory.cpp',
-                       'Main.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'memory', 'process'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec', 'libparse' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/serial/SConscript      Sun Aug  2 11:50:48 2009 UTC
+++ /srv/serial/SConscript      Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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' ],
-                     [ 'filesystem', 'log', 'process', 'memory' ])
-
-env.Program('server', [ 'i8250.cpp', 'Main.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
--- /srv/terminal/SConscript    Sun Aug  2 11:54:52 2009 UTC
+++ /srv/terminal/SConscript    Tue Jan 20 18:37:02 2015 UTC
@@ -1,6 +1,6 @@
 #
-# Copyright (C) 2009 Niek Linnenbank
-#
+# Copyright (C) 2015 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,15 +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', 'libteken' ],
-                     [ 'filesystem', 'process', 'memory', 'video/vga' ])
-
-env.Program('server', [ 'Terminal.cpp', 'Main.cpp' ],
-                        LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
+env = build_env.Clone()
+env.UseServers(['log', 'filesystem', 'process', 'memory', 'video/vga'])
+env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec', 'libteken' ])
+env.TargetProgram('server', [ Glob('*.cpp') ])
=======================================
***Additional files exist in this changeset.***

Other related posts:

  • » [freenos] push by nieklinn...@xxxxxxxxx - Moved sbin/ to bin/. Added SubDirectories() for SConscripts. Servers b... on 2015-01-20 18:38 GMT - freenos