diff --git a/src/bsp/lk/lib/libc/atexit.c b/src/bsp/lk/lib/libc/atexit.c
new file mode 100644
index 0000000..9be083f
--- /dev/null
+++ b/src/bsp/lk/lib/libc/atexit.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/* nulled out atexit. static object constructors call this */
+int atexit(void (*func)(void))
+{
+    return 0;
+}
+
diff --git a/src/bsp/lk/lib/libc/atoi.c b/src/bsp/lk/lib/libc/atoi.c
new file mode 100644
index 0000000..d641e00
--- /dev/null
+++ b/src/bsp/lk/lib/libc/atoi.c
@@ -0,0 +1,191 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+
+#define LONG_IS_INT 1
+
+static int hexval(char c)
+{
+    if (c >= '0' && c <= '9')
+        return c - '0';
+    else if (c >= 'a' && c <= 'f')
+        return c - 'a' + 10;
+    else if (c >= 'A' && c <= 'F')
+        return c - 'A' + 10;
+
+    return 0;
+}
+
+int atoi(const char *num)
+{
+#if !LONG_IS_INT
+    // XXX fail
+#else
+    return atol(num);
+#endif
+}
+
+unsigned int atoui(const char *num)
+{
+#if !LONG_IS_INT
+    // XXX fail
+#else
+    return atoul(num);
+#endif
+}
+
+long atol(const char *num)
+{
+    long value = 0;
+    int neg = 0;
+
+    if (num[0] == '0' && num[1] == 'x') {
+        // hex
+        num += 2;
+        while (*num && isxdigit(*num))
+            value = value * 16 + hexval(*num++);
+    } else {
+        // decimal
+        if (num[0] == '-') {
+            neg = 1;
+            num++;
+        }
+        while (*num && isdigit(*num))
+            value = value * 10 + *num++  - '0';
+    }
+
+    if (neg)
+        value = -value;
+
+    return value;
+}
+
+unsigned long atoul(const char *num)
+{
+    unsigned long value = 0;
+    if (num[0] == '0' && num[1] == 'x') {
+        // hex
+        num += 2;
+        while (*num && isxdigit(*num))
+            value = value * 16 + hexval(*num++);
+    } else {
+        // decimal
+        while (*num && isdigit(*num))
+            value = value * 10 + *num++  - '0';
+    }
+
+    return value;
+}
+
+unsigned long long atoull(const char *num)
+{
+    unsigned long long value = 0;
+    if (num[0] == '0' && num[1] == 'x') {
+        // hex
+        num += 2;
+        while (*num && isxdigit(*num))
+            value = value * 16 + hexval(*num++);
+    } else {
+        // decimal
+        while (*num && isdigit(*num))
+            value = value * 10 + *num++  - '0';
+    }
+
+    return value;
+}
+
+unsigned long strtoul(const char *nptr, char **endptr, int base)
+{
+    int neg = 0;
+    unsigned long ret = 0;
+
+    if (base < 0 || base == 1 || base > 36) {
+        errno = EINVAL;
+        return 0;
+    }
+
+    while (isspace(*nptr)) {
+        nptr++;
+    }
+
+    if (*nptr == '+') {
+        nptr++;
+    } else if (*nptr == '-') {
+        neg = 1;
+        nptr++;
+    }
+
+    if ((base == 0 || base == 16) && nptr[0] == '0' && nptr[1] == 'x') {
+        base = 16;
+        nptr += 2;
+    } else if (base == 0 && nptr[0] == '0') {
+        base = 8;
+        nptr++;
+    } else if (base == 0) {
+        base = 10;
+    }
+
+    for (;;) {
+        char c = *nptr;
+        int v = -1;
+        unsigned long new_ret;
+
+        if (c >= 'A' && c <= 'Z') {
+            v = c - 'A' + 10;
+        } else if (c >= 'a' && c <= 'z') {
+            v = c - 'a' + 10;
+        } else if (c >= '0' && c <= '9') {
+            v = c - '0';
+        }
+
+        if (v < 0 || v >= base) {
+            *endptr = (char *) nptr;
+            break;
+        }
+
+        new_ret = ret * base;
+        if (new_ret / base != ret ||
+                new_ret + v < new_ret ||
+                ret == ULONG_MAX) {
+            ret = ULONG_MAX;
+            errno = ERANGE;
+        } else {
+            ret = new_ret + v;
+        }
+
+        nptr++;
+    }
+
+    if (neg && ret != ULONG_MAX) {
+        ret = -ret;
+    }
+
+    return ret;
+}
diff --git a/src/bsp/lk/lib/libc/bsearch.c b/src/bsp/lk/lib/libc/bsearch.c
new file mode 100644
index 0000000..a50c576
--- /dev/null
+++ b/src/bsp/lk/lib/libc/bsearch.c
@@ -0,0 +1,45 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+#include <stdlib.h>
+
+void *bsearch(const void *key, const void *base, size_t num_elems, size_t size,
+              int (*compare)(const void *, const void *))
+{
+    size_t low = 0, high = num_elems - 1;
+
+    if (num_elems == 0) {
+        return NULL;
+    }
+
+    for (;;) {
+        size_t mid = low + ((high - low) / 2);
+        const void *mid_elem = ((unsigned char*) base) + mid*size;
+        int r = compare(key, mid_elem);
+
+        if (r < 0) {
+            if (mid == 0) {
+                return NULL;
+            }
+            high = mid - 1;
+        } else if (r > 0) {
+            low = mid + 1;
+            if (low < mid || low > high) {
+                return NULL;
+            }
+        } else {
+            return (void*) mid_elem;
+        }
+    }
+}
diff --git a/src/bsp/lk/lib/libc/ctype.c b/src/bsp/lk/lib/libc/ctype.c
new file mode 100644
index 0000000..e5600bc
--- /dev/null
+++ b/src/bsp/lk/lib/libc/ctype.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <ctype.h>
+
+int isblank(int c)
+{
+    return (c == ' ' || c == '\t');
+}
+
+int isspace(int c)
+{
+    return (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v');
+}
+
+int islower(int c)
+{
+    return ((c >= 'a') && (c <= 'z'));
+}
+
+int isupper(int c)
+{
+    return ((c >= 'A') && (c <= 'Z'));
+}
+
+int isdigit(int c)
+{
+    return ((c >= '0') && (c <= '9'));
+}
+
+int isalpha(int c)
+{
+    return isupper(c) || islower(c);
+}
+
+int isalnum(int c)
+{
+    return isalpha(c) || isdigit(c);
+}
+
+int isxdigit(int c)
+{
+    return isdigit(c) || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F'));
+}
+
+int isgraph(int c)
+{
+    return ((c > ' ') && (c < 0x7f));
+}
+
+int iscntrl(int c)
+{
+    return ((c < ' ') || (c == 0x7f));
+}
+
+int isprint(int c)
+{
+    return ((c >= 0x20) && (c < 0x7f));
+}
+
+int ispunct(int c)
+{
+    return isgraph(c) && (!isalnum(c));
+}
+
+int tolower(int c)
+{
+    if ((c >= 'A') && (c <= 'Z'))
+        return c + ('a' - 'A');
+    return c;
+}
+
+int toupper(int c)
+{
+    if ((c >= 'a') && (c <= 'z'))
+        return c + ('A' - 'a');
+    return c;
+}
+
diff --git a/src/bsp/lk/lib/libc/eabi.c b/src/bsp/lk/lib/libc/eabi.c
new file mode 100644
index 0000000..8cf1381
--- /dev/null
+++ b/src/bsp/lk/lib/libc/eabi.c
@@ -0,0 +1,68 @@
+/* Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/* some cruft we have to define when using the linux toolchain */
+#include <unwind.h>
+
+#if defined(__ARM_EABI_UNWINDER__) && __ARM_EABI_UNWINDER__
+
+/* Our toolchain has eabi functionality built in, but they're not really used.
+ * so we stub them out here. */
+_Unwind_Reason_Code __aeabi_unwind_cpp_pr0(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context)
+{
+    return _URC_FAILURE;
+}
+
+_Unwind_Reason_Code __aeabi_unwind_cpp_pr1(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context)
+{
+    return _URC_FAILURE;
+}
+
+_Unwind_Reason_Code __aeabi_unwind_cpp_pr2(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context)
+{
+    return _URC_FAILURE;
+}
+
+#elif  defined(__clang__) && defined(__arm__)
+
+_Unwind_Reason_Code __aeabi_unwind_cpp_pr0(_Unwind_State state, void *ucbp, struct _Unwind_Context *context)
+{
+    return _URC_FAILURE;
+}
+
+_Unwind_Reason_Code __aeabi_unwind_cpp_pr1(_Unwind_State state, void *ucbp, struct _Unwind_Context *context)
+{
+    return _URC_FAILURE;
+}
+
+_Unwind_Reason_Code __aeabi_unwind_cpp_pr2(_Unwind_State state, void  *ucbp, struct  _Unwind_Context *context)
+{
+    return _URC_FAILURE;
+}
+
+#endif
+
+/* needed by some piece of EABI */
+void raise(void)
+{
+}
+
diff --git a/src/bsp/lk/lib/libc/errno.c b/src/bsp/lk/lib/libc/errno.c
new file mode 100644
index 0000000..d9b76cc
--- /dev/null
+++ b/src/bsp/lk/lib/libc/errno.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <errno.h>
+
+/* completely un-threadsafe implementation of errno */
+/* TODO: pull from kernel TLS or some other thread local storage */
+static int _errno;
+
+int *__geterrno(void)
+{
+    return &_errno;
+}
+
diff --git a/src/bsp/lk/lib/libc/printf.c b/src/bsp/lk/lib/libc/printf.c
new file mode 100644
index 0000000..14e7cd1
--- /dev/null
+++ b/src/bsp/lk/lib/libc/printf.c
@@ -0,0 +1,638 @@
+/*
+ * Copyright (c) 2008-2014 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <debug.h>
+#include <assert.h>
+#include <limits.h>
+#include <printf.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <string.h>
+#include <platform/debug.h>
+
+#if WITH_NO_FP
+#define FLOAT_PRINTF 0
+#else
+#define FLOAT_PRINTF 1
+#endif
+
+int sprintf(char *str, const char *fmt, ...)
+{
+    int err;
+
+    va_list ap;
+    va_start(ap, fmt);
+    err = vsprintf(str, fmt, ap);
+    va_end(ap);
+
+    return err;
+}
+
+int snprintf(char *str, size_t len, const char *fmt, ...)
+{
+    int err;
+
+    va_list ap;
+    va_start(ap, fmt);
+    err = vsnprintf(str, len, fmt, ap);
+    va_end(ap);
+
+    return err;
+}
+
+
+#define LONGFLAG       0x00000001
+#define LONGLONGFLAG   0x00000002
+#define HALFFLAG       0x00000004
+#define HALFHALFFLAG   0x00000008
+#define SIZETFLAG      0x00000010
+#define INTMAXFLAG     0x00000020
+#define PTRDIFFFLAG    0x00000040
+#define ALTFLAG        0x00000080
+#define CAPSFLAG       0x00000100
+#define SHOWSIGNFLAG   0x00000200
+#define SIGNEDFLAG     0x00000400
+#define LEFTFORMATFLAG 0x00000800
+#define LEADZEROFLAG   0x00001000
+#define BLANKPOSFLAG   0x00002000
+
+__NO_INLINE static char *longlong_to_string(char *buf, unsigned long long n, size_t len, uint flag, char *signchar)
+{
+    size_t pos = len;
+    int negative = 0;
+
+    if ((flag & SIGNEDFLAG) && (long long)n < 0) {
+        negative = 1;
+        n = -n;
+    }
+
+    buf[--pos] = 0;
+
+    /* only do the math if the number is >= 10 */
+    while (n >= 10) {
+        int digit = n % 10;
+
+        n /= 10;
+
+        buf[--pos] = digit + '0';
+    }
+    buf[--pos] = n + '0';
+
+    if (negative)
+        *signchar = '-';
+    else if ((flag & SHOWSIGNFLAG))
+        *signchar = '+';
+    else if ((flag & BLANKPOSFLAG))
+        *signchar = ' ';
+    else
+        *signchar = '\0';
+
+    return &buf[pos];
+}
+
+static const char hextable[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+static const char hextable_caps[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+
+__NO_INLINE static char *longlong_to_hexstring(char *buf, unsigned long long u, size_t len, uint flag)
+{
+    size_t pos = len;
+    const char *table = (flag & CAPSFLAG) ? hextable_caps : hextable;
+
+    buf[--pos] = 0;
+    do {
+        unsigned int digit = u % 16;
+        u /= 16;
+
+        buf[--pos] = table[digit];
+    } while (u != 0);
+
+    return &buf[pos];
+}
+
+#if FLOAT_PRINTF
+union double_int {
+    double d;
+    uint64_t i;
+};
+
+#define OUT(c) buf[pos++] = (c)
+#define OUTSTR(str) do { for (size_t i = 0; (str)[i] != 0; i++) OUT((str)[i]); } while (0)
+
+/* print up to a 4 digit exponent as string, with sign */
+__NO_INLINE static size_t exponent_to_string(char *buf, int32_t exponent)
+{
+    size_t pos = 0;
+
+    /* handle sign */
+    if (exponent < 0) {
+        OUT('-');
+        exponent = -exponent;
+    } else {
+        OUT('+');
+    }
+
+    /* see how far we need to bump into the string to print from the right */
+    if (exponent >= 1000) pos += 4;
+    else if (exponent >= 100) pos += 3;
+    else if (exponent >= 10) pos += 2;
+    else pos++;
+
+    /* print decimal string, from the right */
+    uint i = pos;
+    do {
+        uint digit = (uint32_t)exponent % 10;
+
+        buf[--i] = digit + '0';
+
+        exponent /= 10;
+    } while (exponent != 0);
+
+    /* return number of characters printed */
+    return pos;
+}
+
+__NO_INLINE static char *double_to_string(char *buf, size_t len, double d, uint flag)
+{
+    size_t pos = 0;
+    union double_int u = { d };
+
+    uint32_t exponent = (u.i >> 52) & 0x7ff;
+    uint64_t fraction = (u.i & ((1ULL << 52) - 1));
+    bool neg = !!(u.i & (1ULL << 63));
+
+    /* start constructing the string */
+    if (neg) {
+        OUT('-');
+        d = -d;
+    }
+
+    /* longest:
+     * 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000o
+     */
+
+    /* look for special cases */
+    if (exponent == 0x7ff) {
+        if (fraction == 0) {
+            /* infinity */
+            if (flag & CAPSFLAG) OUTSTR("INF");
+            else OUTSTR("inf");
+        } else {
+            /* NaN */
+            if (flag & CAPSFLAG) OUTSTR("NAN");
+            else OUTSTR("nan");
+        }
+    } else if (exponent == 0) {
+        if (fraction == 0) {
+            /* zero */
+            OUTSTR("0.000000");
+        } else {
+            /* denormalized */
+            /* XXX does not handle */
+            if (flag & CAPSFLAG) OUTSTR("DEN");
+            else OUTSTR("den");
+        }
+    } else {
+        /* see if it's in the range of floats we can easily print */
+        int exponent_signed = exponent - 1023;
+        if (exponent_signed < -52 || exponent_signed > 52) {
+            OUTSTR("<range>");
+        } else {
+            /* start by walking backwards through the string */
+#define OUTREV(c) do { if (&buf[pos] == buf) goto done; else buf[--pos] = (c); } while (0)
+            pos = len;
+            OUTREV(0);
+
+            /* reserve space for the fractional component first */
+            for (int i = 0; i <= 6; i++)
+                OUTREV('0');
+            size_t decimal_spot = pos;
+
+            /* print the integer portion */
+            uint64_t u;
+            if (exponent_signed >= 0) {
+                u = fraction;
+                u |= (1ULL<<52);
+                u >>= (52 - exponent_signed);
+
+                char *s = longlong_to_string(buf, u, pos + 1, flag, &(char) {0});
+
+                pos = s - buf;
+            } else {
+                /* exponent is negative */
+                u = 0;
+                OUTREV('0');
+            }
+
+            buf[decimal_spot] = '.';
+
+            /* handle the fractional part */
+            uint32_t frac = ((d - u) * 1000000) + .5;
+
+            uint i = decimal_spot + 6 + 1;
+            while (frac != 0) {
+                uint digit = frac % 10;
+
+                buf[--i] = digit + '0';
+
+                frac /= 10;
+            }
+
+            if (neg)
+                OUTREV('-');
+
+done:
+            /* separate return path, since we've been walking backwards through the string */
+            return &buf[pos];
+        }
+#undef OUTREV
+    }
+
+    buf[pos] = 0;
+    return buf;
+}
+
+__NO_INLINE static char *double_to_hexstring(char *buf, size_t len, double d, uint flag)
+{
+    size_t pos = 0;
+    union double_int u = { d };
+
+    uint32_t exponent = (u.i >> 52) & 0x7ff;
+    uint64_t fraction = (u.i & ((1ULL << 52) - 1));
+    bool neg = !!(u.i & (1ULL << 63));
+
+    /* start constructing the string */
+    if (neg) {
+        OUT('-');
+    }
+
+    /* look for special cases */
+    if (exponent == 0x7ff) {
+        if (fraction == 0) {
+            /* infinity */
+            if (flag & CAPSFLAG) OUTSTR("INF");
+            else OUTSTR("inf");
+        } else {
+            /* NaN */
+            if (flag & CAPSFLAG) OUTSTR("NAN");
+            else OUTSTR("nan");
+        }
+    } else if (exponent == 0) {
+        if (fraction == 0) {
+            /* zero */
+            if (flag & CAPSFLAG) OUTSTR("0X0P+0");
+            else OUTSTR("0x0p+0");
+        } else {
+            /* denormalized */
+            /* XXX does not handle */
+            if (flag & CAPSFLAG) OUTSTR("DEN");
+            else OUTSTR("den");
+        }
+    } else {
+        /* regular normalized numbers:
+         * 0x1p+1
+         * 0x1.0000000000001p+1
+         * 0X1.FFFFFFFFFFFFFP+1023
+         * 0x1.FFFFFFFFFFFFFP+1023
+         */
+        int exponent_signed = exponent - 1023;
+
+        /* implicit 1. */
+        if (flag & CAPSFLAG) OUTSTR("0X1");
+        else OUTSTR("0x1");
+
+        /* select the appropriate hex case table */
+        const char *table = (flag & CAPSFLAG) ? hextable_caps : hextable;
+
+        int zero_count = 0;
+        bool output_dot = false;
+        for (int i = 52 - 4; i >= 0; i -= 4) {
+            uint digit = (fraction >> i) & 0xf;
+
+            if (digit == 0) {
+                zero_count++;
+            } else {
+                /* output a . the first time we output a char */
+                if (!output_dot) {
+                    OUT('.');
+                    output_dot = true;
+                }
+                /* if we have a non zero digit, see if we need to output a string of zeros */
+                while (zero_count > 0) {
+                    OUT('0');
+                    zero_count--;
+                }
+                buf[pos++] = table[digit];
+            }
+        }
+
+        /* handle the exponent */
+        buf[pos++] = (flag & CAPSFLAG) ? 'P' : 'p';
+        pos += exponent_to_string(&buf[pos], exponent_signed);
+    }
+
+    buf[pos] = 0;
+    return buf;
+}
+
+#undef OUT
+#undef OUTSTR
+
+#endif // FLOAT_PRINTF
+
+int vsprintf(char *str, const char *fmt, va_list ap)
+{
+    return vsnprintf(str, INT_MAX, fmt, ap);
+}
+
+struct _output_args {
+    char *outstr;
+    size_t len;
+    size_t pos;
+};
+
+static int _vsnprintf_output(const char *str, size_t len, void *state)
+{
+    struct _output_args *args = state;
+
+    size_t count = 0;
+    while (count < len) {
+        if (args->pos < args->len) {
+            args->outstr[args->pos++] = *str;
+        }
+
+        str++;
+        count++;
+    }
+
+    return count;
+}
+
+int vsnprintf(char *str, size_t len, const char *fmt, va_list ap)
+{
+    struct _output_args args;
+    int wlen;
+
+    args.outstr = str;
+    args.len = len;
+    args.pos = 0;
+
+    wlen = _printf_engine(&_vsnprintf_output, (void *)&args, fmt, ap);
+    if (args.pos >= len)
+        str[len-1] = '\0';
+    else
+        str[wlen] = '\0';
+    return wlen;
+}
+
+int _printf_engine(_printf_engine_output_func out, void *state, const char *fmt, va_list ap)
+{
+    int err = 0;
+    char c;
+    unsigned char uc;
+    const char *s;
+    size_t string_len;
+    unsigned long long n;
+    void *ptr;
+    int flags;
+    unsigned int format_num;
+    char signchar;
+    size_t chars_written = 0;
+    char num_buffer[32];
+
+#define OUTPUT_STRING(str, len) do { err = out(str, len, state); if (err < 0) { goto exit; } else { chars_written += err; } } while(0)
+#define OUTPUT_CHAR(c) do { char __temp[1] = { c }; OUTPUT_STRING(__temp, 1); } while (0)
+
+    for (;;) {
+        /* reset the format state */
+        flags = 0;
+        format_num = 0;
+        signchar = '\0';
+
+        /* handle regular chars that aren't format related */
+        s = fmt;
+        string_len = 0;
+        while ((c = *fmt++) != 0) {
+            if (c == '%')
+                break; /* we saw a '%', break and start parsing format */
+            string_len++;
+        }
+
+        /* output the string we've accumulated */
+        OUTPUT_STRING(s, string_len);
+
+        /* make sure we haven't just hit the end of the string */
+        if (c == 0)
+            break;
+
+next_format:
+        /* grab the next format character */
+        c = *fmt++;
+        if (c == 0)
+            break;
+
+        switch (c) {
+            case '0'...'9':
+                if (c == '0' && format_num == 0)
+                    flags |= LEADZEROFLAG;
+                format_num *= 10;
+                format_num += c - '0';
+                goto next_format;
+            case '.':
+                /* XXX for now eat numeric formatting */
+                goto next_format;
+            case '%':
+                OUTPUT_CHAR('%');
+                break;
+            case 'c':
+                uc = va_arg(ap, unsigned int);
+                OUTPUT_CHAR(uc);
+                break;
+            case 's':
+                s = va_arg(ap, const char *);
+                if (s == 0)
+                    s = "<null>";
+                flags &= ~LEADZEROFLAG; /* doesn't make sense for strings */
+                goto _output_string;
+            case '-':
+                flags |= LEFTFORMATFLAG;
+                goto next_format;
+            case '+':
+                flags |= SHOWSIGNFLAG;
+                goto next_format;
+            case ' ':
+                flags |= BLANKPOSFLAG;
+                goto next_format;
+            case '#':
+                flags |= ALTFLAG;
+                goto next_format;
+            case 'l':
+                if (flags & LONGFLAG)
+                    flags |= LONGLONGFLAG;
+                flags |= LONGFLAG;
+                goto next_format;
+            case 'h':
+                if (flags & HALFFLAG)
+                    flags |= HALFHALFFLAG;
+                flags |= HALFFLAG;
+                goto next_format;
+            case 'z':
+                flags |= SIZETFLAG;
+                goto next_format;
+            case 'j':
+                flags |= INTMAXFLAG;
+                goto next_format;
+            case 't':
+                flags |= PTRDIFFFLAG;
+                goto next_format;
+            case 'i':
+            case 'd':
+                n = (flags & LONGLONGFLAG) ? va_arg(ap, long long) :
+                    (flags & LONGFLAG) ? va_arg(ap, long) :
+                    (flags & HALFHALFFLAG) ? (signed char)va_arg(ap, int) :
+                    (flags & HALFFLAG) ? (short)va_arg(ap, int) :
+                    (flags & SIZETFLAG) ? va_arg(ap, ssize_t) :
+                    (flags & INTMAXFLAG) ? va_arg(ap, intmax_t) :
+                    (flags & PTRDIFFFLAG) ? va_arg(ap, ptrdiff_t) :
+                    va_arg(ap, int);
+                flags |= SIGNEDFLAG;
+                s = longlong_to_string(num_buffer, n, sizeof(num_buffer), flags, &signchar);
+                goto _output_string;
+            case 'u':
+                n = (flags & LONGLONGFLAG) ? va_arg(ap, unsigned long long) :
+                    (flags & LONGFLAG) ? va_arg(ap, unsigned long) :
+                    (flags & HALFHALFFLAG) ? (unsigned char)va_arg(ap, unsigned int) :
+                    (flags & HALFFLAG) ? (unsigned short)va_arg(ap, unsigned int) :
+                    (flags & SIZETFLAG) ? va_arg(ap, size_t) :
+                    (flags & INTMAXFLAG) ? va_arg(ap, uintmax_t) :
+                    (flags & PTRDIFFFLAG) ? (uintptr_t)va_arg(ap, ptrdiff_t) :
+                    va_arg(ap, unsigned int);
+                s = longlong_to_string(num_buffer, n, sizeof(num_buffer), flags, &signchar);
+                goto _output_string;
+            case 'p':
+                flags |= LONGFLAG | ALTFLAG;
+                goto hex;
+            case 'X':
+                flags |= CAPSFLAG;
+                /* fallthrough */
+hex:
+            case 'x':
+                n = (flags & LONGLONGFLAG) ? va_arg(ap, unsigned long long) :
+                    (flags & LONGFLAG) ? va_arg(ap, unsigned long) :
+                    (flags & HALFHALFFLAG) ? (unsigned char)va_arg(ap, unsigned int) :
+                    (flags & HALFFLAG) ? (unsigned short)va_arg(ap, unsigned int) :
+                    (flags & SIZETFLAG) ? va_arg(ap, size_t) :
+                    (flags & INTMAXFLAG) ? va_arg(ap, uintmax_t) :
+                    (flags & PTRDIFFFLAG) ? (uintptr_t)va_arg(ap, ptrdiff_t) :
+                    va_arg(ap, unsigned int);
+                s = longlong_to_hexstring(num_buffer, n, sizeof(num_buffer), flags);
+                if (flags & ALTFLAG) {
+                    OUTPUT_CHAR('0');
+                    OUTPUT_CHAR((flags & CAPSFLAG) ? 'X': 'x');
+                }
+                goto _output_string;
+            case 'n':
+                ptr = va_arg(ap, void *);
+                if (flags & LONGLONGFLAG)
+                    *(long long *)ptr = chars_written;
+                else if (flags & LONGFLAG)
+                    *(long *)ptr = chars_written;
+                else if (flags & HALFHALFFLAG)
+                    *(signed char *)ptr = chars_written;
+                else if (flags & HALFFLAG)
+                    *(short *)ptr = chars_written;
+                else if (flags & SIZETFLAG)
+                    *(size_t *)ptr = chars_written;
+                else
+                    *(int *)ptr = chars_written;
+                break;
+#if FLOAT_PRINTF
+            case 'F':
+                flags |= CAPSFLAG;
+            /* fallthrough */
+            case 'f': {
+                double d = va_arg(ap, double);
+                s = double_to_string(num_buffer, sizeof(num_buffer), d, flags);
+                goto _output_string;
+            }
+            case 'A':
+                flags |= CAPSFLAG;
+            /* fallthrough */
+            case 'a': {
+                double d = va_arg(ap, double);
+                s = double_to_hexstring(num_buffer, sizeof(num_buffer), d, flags);
+                goto _output_string;
+            }
+#endif
+            default:
+                OUTPUT_CHAR('%');
+                OUTPUT_CHAR(c);
+                break;
+        }
+
+        /* move on to the next field */
+        continue;
+
+        /* shared output code */
+_output_string:
+        string_len = strlen(s);
+
+        if (flags & LEFTFORMATFLAG) {
+            /* left justify the text */
+            OUTPUT_STRING(s, string_len);
+            uint written = err;
+
+            /* pad to the right (if necessary) */
+            for (; format_num > written; format_num--)
+                OUTPUT_CHAR(' ');
+        } else {
+            /* right justify the text (digits) */
+
+            /* if we're going to print a sign digit,
+               it'll chew up one byte of the format size */
+            if (signchar != '\0' && format_num > 0)
+                format_num--;
+
+            /* output the sign char before the leading zeros */
+            if (flags & LEADZEROFLAG && signchar != '\0')
+                OUTPUT_CHAR(signchar);
+
+            /* pad according to the format string */
+            for (; format_num > string_len; format_num--)
+                OUTPUT_CHAR(flags & LEADZEROFLAG ? '0' : ' ');
+
+            /* if not leading zeros, output the sign char just before the number */
+            if (!(flags & LEADZEROFLAG) && signchar != '\0')
+                OUTPUT_CHAR(signchar);
+
+            /* output the string */
+            OUTPUT_STRING(s, string_len);
+        }
+        continue;
+    }
+
+#undef OUTPUT_STRING
+#undef OUTPUT_CHAR
+
+exit:
+    return (err < 0) ? err : (int)chars_written;
+}
diff --git a/src/bsp/lk/lib/libc/pure_virtual.cpp b/src/bsp/lk/lib/libc/pure_virtual.cpp
new file mode 100644
index 0000000..5d3fc0a
--- /dev/null
+++ b/src/bsp/lk/lib/libc/pure_virtual.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2006 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <debug.h>
+
+extern "C" void __cxa_pure_virtual(void)
+{
+    panic("pure virtual called\n");
+}
+
diff --git a/src/bsp/lk/lib/libc/qsort.c b/src/bsp/lk/lib/libc/qsort.c
new file mode 100644
index 0000000..ddd1c45
--- /dev/null
+++ b/src/bsp/lk/lib/libc/qsort.c
@@ -0,0 +1,162 @@
+/*  $OpenBSD: qsort.c,v 1.10 2005/08/08 08:05:37 espie Exp $ */
+/*-
+ * Copyright (c) 1992, 1993
+ *  The Regents of the University of California.  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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+
+static __inline char    *med3(char *, char *, char *, int (*)(const void *, const void *));
+static __inline void     swapfunc(char *, char *, int, int);
+
+#define min(a, b)   (a) < (b) ? a : b
+
+/*
+ * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
+ */
+#define swapcode(TYPE, parmi, parmj, n) {       \
+    long i = (n) / sizeof (TYPE);           \
+    TYPE *pi = (TYPE *) (parmi);            \
+    TYPE *pj = (TYPE *) (parmj);            \
+    do {                        \
+        TYPE    t = *pi;            \
+        *pi++ = *pj;                \
+        *pj++ = t;              \
+        } while (--i > 0);              \
+}
+
+#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
+    es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
+
+static __inline void
+swapfunc(char *a, char *b, int n, int swaptype)
+{
+    if (swaptype <= 1)
+        swapcode(long, a, b, n)
+        else
+            swapcode(char, a, b, n)
+        }
+
+#define swap(a, b)                  \
+    if (swaptype == 0) {                \
+        long t = *(long *)(a);          \
+        *(long *)(a) = *(long *)(b);        \
+        *(long *)(b) = t;           \
+    } else                      \
+        swapfunc(a, b, es, swaptype)
+
+#define vecswap(a, b, n)    if ((n) > 0) swapfunc(a, b, n, swaptype)
+
+static __inline char *
+med3(char *a, char *b, char *c, int (*cmp)(const void *, const void *))
+{
+    return cmp(a, b) < 0 ?
+           (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
+           :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
+}
+
+void
+qsort(void *aa, size_t n, size_t es, int (*cmp)(const void *, const void *))
+{
+    char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
+    int d, r, swaptype, swap_cnt;
+    char *a = aa;
+
+loop:
+    SWAPINIT(a, es);
+    swap_cnt = 0;
+    if (n < 7) {
+        for (pm = (char *)a + es; pm < (char *) a + n * es; pm += es)
+            for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
+                    pl -= es)
+                swap(pl, pl - es);
+        return;
+    }
+    pm = (char *)a + (n / 2) * es;
+    if (n > 7) {
+        pl = (char *)a;
+        pn = (char *)a + (n - 1) * es;
+        if (n > 40) {
+            d = (n / 8) * es;
+            pl = med3(pl, pl + d, pl + 2 * d, cmp);
+            pm = med3(pm - d, pm, pm + d, cmp);
+            pn = med3(pn - 2 * d, pn - d, pn, cmp);
+        }
+        pm = med3(pl, pm, pn, cmp);
+    }
+    swap(a, pm);
+    pa = pb = (char *)a + es;
+
+    pc = pd = (char *)a + (n - 1) * es;
+    for (;;) {
+        while (pb <= pc && (r = cmp(pb, a)) <= 0) {
+            if (r == 0) {
+                swap_cnt = 1;
+                swap(pa, pb);
+                pa += es;
+            }
+            pb += es;
+        }
+        while (pb <= pc && (r = cmp(pc, a)) >= 0) {
+            if (r == 0) {
+                swap_cnt = 1;
+                swap(pc, pd);
+                pd -= es;
+            }
+            pc -= es;
+        }
+        if (pb > pc)
+            break;
+        swap(pb, pc);
+        swap_cnt = 1;
+        pb += es;
+        pc -= es;
+    }
+    if (swap_cnt == 0) {  /* Switch to insertion sort */
+        for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
+            for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
+                    pl -= es)
+                swap(pl, pl - es);
+        return;
+    }
+
+    pn = (char *)a + n * es;
+    r = min(pa - (char *)a, pb - pa);
+    vecswap(a, pb - r, r);
+    r = min(pd - pc, pn - pd - (int)es);
+    vecswap(pb, pn - r, r);
+    if ((r = pb - pa) > (int)es)
+        qsort(a, r / es, es, cmp);
+    if ((r = pd - pc) > (int)es) {
+        /* Iterate rather than recurse to save stack space */
+        a = pn - r;
+        n = r / es;
+        goto loop;
+    }
+    /* qsort(pn - r, r / es, es, cmp); */
+}
diff --git a/src/bsp/lk/lib/libc/rand.c b/src/bsp/lk/lib/libc/rand.c
new file mode 100644
index 0000000..fe502c1
--- /dev/null
+++ b/src/bsp/lk/lib/libc/rand.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2008-2014 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <rand.h>
+#include <sys/types.h>
+
+static unsigned int randseed = 12345;
+
+void srand(unsigned int seed)
+{
+    randseed = seed;
+}
+
+void rand_add_entropy(const void *buf, size_t len)
+{
+    if (len == 0)
+        return;
+
+    uint32_t enp = 0;
+    for (size_t i = 0; i < len; i++) {
+        enp ^= ((enp << 8) | (enp >> 24)) ^ ((const uint8_t *)buf)[i];
+    }
+
+    randseed ^= enp;
+}
+
+int rand(void)
+{
+    return (randseed = randseed * 1664525 + 1013904223);
+}
diff --git a/src/bsp/lk/lib/libc/rules.mk b/src/bsp/lk/lib/libc/rules.mk
new file mode 100644
index 0000000..8b488a1
--- /dev/null
+++ b/src/bsp/lk/lib/libc/rules.mk
@@ -0,0 +1,30 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+MODULE := $(LOCAL_DIR)
+
+MODULE_DEPS := \
+	lib/heap
+
+MODULE_SRCS += \
+	$(LOCAL_DIR)/atoi.c \
+	$(LOCAL_DIR)/bsearch.c \
+	$(LOCAL_DIR)/ctype.c \
+	$(LOCAL_DIR)/errno.c \
+	$(LOCAL_DIR)/printf.c \
+	$(LOCAL_DIR)/scanf.c \
+	$(LOCAL_DIR)/rand.c \
+	$(LOCAL_DIR)/strtol.c \
+	$(LOCAL_DIR)/strtoll.c \
+	$(LOCAL_DIR)/stdio.c \
+	$(LOCAL_DIR)/qsort.c \
+	$(LOCAL_DIR)/eabi.c
+
+ifeq ($(WITH_CPP_SUPPORT),true)
+MODULE_SRCS += \
+	$(LOCAL_DIR)/atexit.c \
+	$(LOCAL_DIR)/pure_virtual.cpp
+endif
+
+include $(LOCAL_DIR)/string/rules.mk
+
+include make/module.mk
diff --git a/src/bsp/lk/lib/libc/scanf.c b/src/bsp/lk/lib/libc/scanf.c
new file mode 100644
index 0000000..b3d4cd7
--- /dev/null
+++ b/src/bsp/lk/lib/libc/scanf.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2020 MediaTek Inc.
+ *
+ * Use of this source code is governed by a MIT-style
+ * license that can be found in the LICENSE file or at
+ * https://opensource.org/licenses/MIT
+ */
+
+#include <assert.h>
+#include <ctype.h>
+#include <debug.h>
+#include <limits.h>
+#include <platform/debug.h>
+#include <printf.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <trace.h>
+
+#define LOCAL_TRACE 0
+
+#define FLAG_SHORT      (0x1 << 2)
+#define FLAG_INT        (0x1 << 3)
+
+static int xchar_to_int(char c)
+{
+    if (isdigit(c))
+        return c - '0';
+    else if (c >= 'a' && c <= 'f')
+        return 10 + c - 'a';
+    else if (c >= 'A' && c <= 'F')
+        return 10 + c - 'A';
+    else
+        return 0;   // not xdigit: return 0!
+}
+
+static int get_int(const char **buf, int *val)
+{
+    const char *p = *buf;
+    int i = 0;
+    int err = -1;
+    int sign = 0;
+
+    // ignore blank
+    while (isspace(*p)) {
+        ++p;
+    }
+
+    if (*p == '+')
+        ++p;
+    else if (*p == '-') {
+        sign = 1;
+        ++p;
+    }
+
+    while (1) {
+        char c = *p;
+
+        if (isdigit(c)) {
+            i = i * 10 + (c - '0');
+            err = 0;        // find at least one digit
+
+            LTRACEF("buf:%s, i:%d, c:%c\n", p, i, c);
+
+            ++p;
+            continue;
+        } else {
+            if (err == -1)
+                return -1;
+
+            *buf = p;
+
+            *val = sign ? -i : i;
+            break;
+        }
+    }
+
+    return 0;
+}
+
+static int get_hex_int(const char **buf)
+{
+    const char *p = *buf;
+    int i = 0;
+    int err = -1;
+    int found_hex_prefix = 0, ignore_hex_prefix = 0;
+
+    // ignore blank
+    while (isspace(*p)) {
+        ++p;
+    }
+
+    while (1) {
+        char c = *p;
+
+        if (isspace(c)) {
+            *buf = p;
+            break;
+        }
+
+        // hex prefix
+        if (!ignore_hex_prefix && !found_hex_prefix && c == '0') {
+            c = *++p;
+            if (c == 'x' || c == 'X') {
+                found_hex_prefix = 1;
+                ignore_hex_prefix = 1;
+                ++p;
+                continue;
+            } else if (isxdigit(c)) {
+                i = i * 16 + (xchar_to_int(c));
+                ignore_hex_prefix = 1;
+                ++p;
+            } else
+                goto error;
+        }
+
+        if (isxdigit(c)) {
+            i = i * 16 + xchar_to_int(c);
+            ignore_hex_prefix = 1;
+            err = 0;        // find at least one digit
+
+            LTRACEF("buf:%s, i:0x%x, c:%c\n", p, i, c);
+
+            ++p;
+            continue;
+        } else if (err == 0)
+            break;
+        else
+            goto error;
+    }
+
+    if (err == 0)
+        *buf = p;
+    return i;
+
+error:
+    return -1;
+}
+
+/* support interger scanf  */
+static int vsscanf(const char *buf, const char *fmt, va_list ap)
+{
+    int err = 0;
+    char c;
+    size_t item;
+    int n;
+    int *p;
+    char *pch;
+    short *psh;
+    int flag;
+
+    item = 0;
+    flag = FLAG_INT;
+
+    for (;;) {
+        while ((c = *fmt++) != 0) {
+            if (isspace(c))
+                continue;
+
+            if (c == '%')
+                break;
+            else {
+                while (isspace(*buf)) {
+                    ++buf;
+                }
+                if (c != *buf)
+                    return 0;
+
+                ++buf;
+            }
+        }
+
+        /* make sure we haven't just hit the end of the string */
+        if (c == 0)
+            break;
+
+        c = *fmt++;
+        if (c == 0)
+            break;
+
+format_continue:
+        switch (c) {
+            case 'h':   /* short interger: %hd */
+                flag = FLAG_SHORT;
+                c = *fmt++;
+                goto format_continue;
+            case 'd':   /* interger: %d */
+                if (flag == FLAG_SHORT)
+                    psh = va_arg(ap, short *);
+                else
+                    p = va_arg(ap, int *);
+
+                err = get_int(&buf, &n);
+
+                if (err < 0)
+                    goto exit;
+
+                if (flag == FLAG_SHORT)
+                    *psh = n;
+                else
+                    *p = n;
+                item++;
+                break;
+
+            case 'x':  /* hex interger */
+            case 'X':
+                p = va_arg(ap, int *);
+
+                n = get_hex_int(&buf);
+
+                if (n < 0)
+                    goto exit;
+
+                *p = n;
+                item++;
+                break;
+
+            default:
+                err = -1;
+                break;
+        }
+
+        continue;
+    }
+
+exit:
+    return (err < 0) ? 0 : (int)item;
+}
+
+// a simple sscanf: %d, %x
+int sscanf(const char *buf, const char *fmt, ...)
+{
+    va_list ap;
+    int err;
+
+    va_start(ap, fmt);
+    err = vsscanf(buf, fmt, ap);
+    va_end(ap);
+
+    return err;
+}
+
diff --git a/src/bsp/lk/lib/libc/stdio.c b/src/bsp/lk/lib/libc/stdio.c
new file mode 100644
index 0000000..2c96e94
--- /dev/null
+++ b/src/bsp/lk/lib/libc/stdio.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <debug.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <platform/debug.h>
+
+int fputc(int c, FILE *fp)
+{
+    return fp->fputc(fp->ctx, c);
+}
+
+int putchar(int c)
+{
+    return fputc(c, stdout);
+}
+
+int puts(const char *str)
+{
+    int err = fputs(str, stdout);
+    if (err >= 0)
+        err = fputc('\n', stdout);
+    return err;
+}
+
+int fputs(const char *s, FILE *fp)
+{
+    return fp->fputs(fp->ctx, s);
+}
+
+int getc(FILE *fp)
+{
+    return fp->fgetc(fp->ctx);
+}
+
+int getchar(void)
+{
+    return getc(stdin);
+}
+
+int vfprintf(FILE *fp, const char *fmt, va_list ap)
+{
+    return fp->vfprintf(fp->ctx, fmt, ap);
+}
+
+int fprintf(FILE *fp, const char *fmt, ...)
+{
+    va_list ap;
+    int err;
+
+    va_start(ap, fmt);
+    err = vfprintf(fp, fmt, ap);
+    va_end(ap);
+    return err;
+}
+
+int _printf(const char *fmt, ...)
+{
+    va_list ap;
+    int err;
+
+    va_start(ap, fmt);
+    err = vfprintf(stdout, fmt, ap);
+    va_end(ap);
+
+    return err;
+}
diff --git a/src/bsp/lk/lib/libc/string/arch/arm/arm-m/memcpy.S b/src/bsp/lk/lib/libc/string/arch/arm/arm-m/memcpy.S
new file mode 100644
index 0000000..46ce8cb
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/arm/arm-m/memcpy.S
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2014 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+#include <arch/arm/cores.h>
+
+.text
+.syntax unified
+.thumb
+.align 2
+
+/* void bcopy(const void *src, void *dest, size_t n); */
+FUNCTION(bcopy)
+    // swap args for bcopy
+    mov     r12, r0
+    mov     r0, r1
+    mov     r1, r12
+
+/* void *memcpy(void *dest, const void *src, size_t count) */
+FUNCTION(memcpy)
+    push    { r0, r14 }
+
+    // test for zero length or pointers being equivalent
+    cbz     r2, .L_done
+    cmp     r0, r1
+    beq     .L_done
+
+    // check for a short copy len
+    cmp     r2, #16
+    blt     .L_bytewise
+
+    // check to see if the pointers are similarly dword aligned
+    eors    r3, r0, r1
+    ands    r3, #7
+    beq     .L_prepare_dword
+
+    // see how many bytes we need to move to align dest to word boundary
+    and     r3, r0, #3
+    cbz     r3, .L_prepare_wordwise
+    rsb     r3, #4
+    subs    r2, r3
+
+    .align 2
+.L_bytewise_align:
+    // bytewise to align memcpy
+    ldrb    r12, [r1], #1
+    subs    r3, r3, #1
+    strb    r12, [r0], #1
+    bgt     .L_bytewise_align
+
+.L_prepare_wordwise:
+    // load the number of words left
+    lsrs    r3, r2, #2
+
+    .align 2
+.L_wordwise:
+    // wordwise copy
+    ldr     r12, [r1], #4
+    subs    r3, r3, #1
+    str     r12, [r0], #4
+    bgt     .L_wordwise
+
+    // remaining bytes
+    ands     r2, #3
+    beq     .L_done
+
+    .align 2
+.L_bytewise:
+    // simple bytewise copy
+    ldrb    r12, [r1], #1
+    subs    r2, r2, #1
+    strb    r12, [r0], #1
+    bgt     .L_bytewise
+
+.L_done:
+    pop     { r0, pc }
+
+// Handle copying by dword (8 bytes at a time) increments
+.L_prepare_dword:
+    // see how many bytes we need to move to align dest to dword boundary
+    and     r3, r0, #7
+    cbz     r3, .L_prepare_dwordwise
+    rsb     r3, #8
+    subs    r2, r3
+
+    .align 2
+.L_bytewise_align_dword:
+    // bytewise to align memcpy
+    ldrb    r12, [r1], #1
+    subs    r3, r3, #1
+    strb    r12, [r0], #1
+    bgt     .L_bytewise_align_dword
+
+.L_prepare_dwordwise:
+    // load the number of dwords left
+    lsrs    r3, r2, #3
+
+    push    { r5 }
+
+    .align 2
+.L_dwordwise:
+    // dwordwise copy
+    ldrd    r5, r12, [r1], #8
+    subs    r3, r3, #1
+    strd    r5, r12, [r0], #8
+    bgt     .L_dwordwise
+
+    pop     { r5 }
+
+    // remaining bytes
+    ands     r2, #7
+    beq     .L_done
+
+    // finish the remaining bytes and exit
+    b       .L_bytewise
+
diff --git a/src/bsp/lk/lib/libc/string/arch/arm/arm-m/memset.S b/src/bsp/lk/lib/libc/string/arch/arm/arm-m/memset.S
new file mode 100644
index 0000000..0b54e3c
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/arm/arm-m/memset.S
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+#include <arch/arm/cores.h>
+
+.text
+.syntax unified
+.thumb
+.align 2
+
+/* void bzero(void *s, size_t n); */
+FUNCTION(bzero)
+    mov     r2, r1
+    movs    r1, #0
+
+/* void *memset(void *s, int c, size_t n); */
+FUNCTION(memset)
+    // save the original pointer
+    push    { r0, lr }
+
+    // check for zero length
+    cbz     r2, .L_done
+
+    // short memsets aren't worth optimizing and make sure we have
+    // enough headroom to try to do dwordwise move optimization
+    cmp     r2, #16
+    blt     .L_bytewise
+
+    // see how many bytes we need to move to align to dword boundaries
+    and     r3, r0, #7
+    cbz     r3, .L_prepare_dwordwise
+    rsb     r3, #8
+    subs    r2, r3
+
+.L_bytewise_align:
+    // bytewise to align memset
+    subs    r3, r3, #1
+    strb    r1, [r0], #1
+    bgt     .L_bytewise_align
+
+.L_prepare_dwordwise:
+    // fill a pair of 32 bit registers with the 8 bit value
+    uxtb    r1, r1
+    orr     r1, r1, r1, lsl #8
+    orr     r1, r1, r1, lsl #16
+    mov     r12, r1
+
+    // load the number of dwords left
+    lsrs    r3, r2, #3
+
+.L_dwordwise:
+    // dwordwise memset
+    subs    r3, r3, #1
+    strd    r1, r12, [r0], #8
+    bgt     .L_dwordwise
+
+    // remaining bytes
+    ands     r2, #7
+    beq     .L_done
+
+.L_bytewise:
+    // bytewise memset
+    subs    r2, r2, #1
+    strb    r1, [r0], #1
+    bgt     .L_bytewise
+
+.L_done:
+    // restore the base pointer as return value
+    pop     { r0, pc }
+
diff --git a/src/bsp/lk/lib/libc/string/arch/arm/arm/memcpy.S b/src/bsp/lk/lib/libc/string/arch/arm/arm/memcpy.S
new file mode 100644
index 0000000..efe46df
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/arm/arm/memcpy.S
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+#include <arch/arm/cores.h>
+
+.text
+.align 2
+
+/* void bcopy(const void *src, void *dest, size_t n); */
+FUNCTION(bcopy)
+    // swap args for bcopy
+    mov     r12, r0
+    mov     r0, r1
+    mov     r1, r12
+
+/* void *memcpy(void *dest, const void *src, size_t n); */
+FUNCTION(memmove)
+FUNCTION(memcpy)
+    // check for zero length copy or the same pointer
+    cmp     r2, #0
+    cmpne   r1, r0
+    bxeq    lr
+
+    // save a few registers for use and the return code (input dst)
+    stmfd   sp!, {r0, r4, r5, lr}
+
+    // check for forwards overlap (src > dst, distance < len)
+    subs    r3, r0, r1
+    cmphi   r2, r3
+    bhi     .L_forwardoverlap
+
+    // check for a short copy len.
+    // 20 bytes is enough so that if a 16 byte alignment needs to happen there is at least a 
+    //   wordwise copy worth of work to be done.
+    cmp     r2, #(16+4)
+    blo     .L_bytewise
+
+    // see if they are similarly aligned on 4 byte boundaries
+    eor     r3, r0, r1
+    tst     r3, #3
+    bne     .L_bytewise     // dissimilarly aligned, nothing we can do (for now)
+
+    // check for 16 byte alignment on dst.
+    // this will also catch src being not 4 byte aligned, since it is similarly 4 byte 
+    //   aligned with dst at this point.
+    tst     r0, #15
+    bne     .L_not16bytealigned
+
+    // check to see if we have at least 32 bytes of data to copy.
+    // if not, just revert to wordwise copy
+    cmp     r2, #32
+    blo     .L_wordwise
+
+.L_bigcopy:
+    // copy 32 bytes at a time. src & dst need to be at least 4 byte aligned, 
+    // and we need at least 32 bytes remaining to copy
+
+    // save r6-r7 for use in the big copy
+    stmfd   sp!, {r6-r11}
+
+    sub     r2, r2, #32     // subtract an extra 32 to the len so we can avoid an extra compare
+
+.L_bigcopy_loop:
+    pld     [r1, #64]
+    ldmia   r1!, {r4-r11}
+    subs    r2, r2, #32
+    stmia   r0!, {r4-r11}
+    bhs     .L_bigcopy_loop
+
+    // restore r6-r7
+    ldmfd   sp!, {r6-r11}
+
+    // see if we are done
+    adds    r2, r2, #32
+    beq     .L_done
+
+    // less then 4 bytes left?
+    cmp     r2, #4
+    blo     .L_bytewise
+
+.L_wordwise:
+    // copy 4 bytes at a time.
+    // src & dst are guaranteed to be word aligned, and at least 4 bytes are left to copy.
+    subs    r2, r2, #4
+
+.L_wordwise_loop:
+    ldr     r3, [r1], #4
+    subs    r2, r2, #4
+    str     r3, [r0], #4
+    bhs     .L_wordwise_loop
+
+    // correct the remaining len and test for completion
+    adds    r2, r2, #4  
+    beq     .L_done
+
+.L_bytewise:
+    // simple bytewise copy
+    ldrb    r3, [r1], #1
+    subs    r2, r2, #1
+    strb    r3, [r0], #1
+    bhi     .L_bytewise
+
+.L_done:
+    // load dst for return and restore r4,r5
+#if ARM_ARCH_LEVEL >= 5
+    ldmfd   sp!, {r0, r4, r5, pc}
+#else
+    ldmfd   sp!, {r0, r4, r5, lr}
+    bx      lr
+#endif
+
+.L_not16bytealigned:
+    // dst is not 16 byte aligned, so we will copy up to 15 bytes to get it aligned.
+    // src is guaranteed to be similarly word aligned with dst.
+
+    // set the condition flags based on the alignment.
+    lsl     r12, r0, #28
+    rsb     r12, r12, #0
+    msr     CPSR_f, r12             // move into NZCV fields in CPSR
+
+    // move as many bytes as necessary to get the dst aligned
+    ldrvsb  r3, [r1], #1            // V set
+    ldrcsh  r4, [r1], #2            // C set
+    ldreq   r5, [r1], #4            // Z set
+
+    strvsb  r3, [r0], #1
+    strcsh  r4, [r0], #2
+    streq   r5, [r0], #4
+
+    ldmmiia r1!, {r3-r4}            // N set
+    stmmiia r0!, {r3-r4}
+
+    // fix the remaining len
+    sub     r2, r2, r12, lsr #28
+
+    // test to see what we should do now
+    cmp     r2, #32
+    bhs     .L_bigcopy
+    b       .L_wordwise
+
+    // src and dest overlap 'forwards' or dst > src
+.L_forwardoverlap:
+
+    // do a bytewise reverse copy for now
+    add     r1, r1, r2
+    add     r0, r0, r2
+    sub     r1, r1, #1
+    sub     r0, r0, #1
+
+.L_bytewisereverse:
+    // simple bytewise reverse copy
+    ldrb    r3, [r1], #-1
+    subs    r2, r2, #1
+    strb    r3, [r0], #-1
+    bhi     .L_bytewisereverse
+
+    b       .L_done
+
diff --git a/src/bsp/lk/lib/libc/string/arch/arm/arm/memset.S b/src/bsp/lk/lib/libc/string/arch/arm/arm/memset.S
new file mode 100644
index 0000000..1307e1c
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/arm/arm/memset.S
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+#include <arch/arm/cores.h>
+
+.text
+.align 2
+
+/* void bzero(void *s, size_t n); */
+FUNCTION(bzero)
+    mov     r2, r1
+    mov     r1, #0
+
+/* void *memset(void *s, int c, size_t n); */
+FUNCTION(memset)
+    // check for zero length
+    cmp     r2, #0
+    bxeq    lr
+
+    // save the original pointer
+    mov     r12, r0
+
+    // short memsets aren't worth optimizing
+    cmp     r2, #(32 + 16)
+    blt     .L_bytewise
+
+    // fill a 32 bit register with the 8 bit value
+    and     r1, r1, #0xff
+    orr     r1, r1, r1, lsl #8
+    orr     r1, r1, r1, lsl #16
+
+    // check for 16 byte alignment
+    tst     r0, #15
+    bne     .L_not16bytealigned
+
+.L_bigset:
+    // dump some registers to make space for our values
+    stmfd   sp!, { r4-r5 }
+
+    // fill a bunch of registers with the set value
+    mov     r3, r1
+    mov     r4, r1
+    mov     r5, r1
+
+    // prepare the count register so we can avoid an extra compare
+    sub     r2, r2, #32
+
+    // 32 bytes at a time
+.L_bigset_loop:
+    stmia   r0!, { r1, r3, r4, r5 }
+    subs    r2, r2, #32
+    stmia   r0!, { r1, r3, r4, r5 }
+    bge     .L_bigset_loop
+
+    // restore our dumped registers
+    ldmfd   sp!, { r4-r5 }
+
+    // see if we're done
+    adds    r2, r2, #32
+    beq     .L_done
+
+.L_bytewise:
+    // bytewise memset
+    subs    r2, r2, #1
+    strb    r1, [r0], #1
+    bgt     .L_bytewise
+
+.L_done:
+    // restore the base pointer as return value
+    mov     r0, r12
+    bx      lr
+
+.L_not16bytealigned:
+    // dst is not 16 byte aligned, so we will set up to 15 bytes to get it aligned.
+
+    // set the condition flags based on the alignment.
+    lsl     r3, r0, #28
+    rsb     r3, r3, #0
+    msr     CPSR_f, r3             // move into NZCV fields in CPSR
+
+    // move as many bytes as necessary to get the dst aligned
+    strvsb  r1, [r0], #1            // V set
+    strcsh  r1, [r0], #2            // C set
+    streq   r1, [r0], #4            // Z set
+    strmi   r1, [r0], #4            // N set
+    strmi   r1, [r0], #4            // N set
+
+    // fix the remaining len
+    sub     r2, r2, r3, lsr #28
+
+    // do the large memset
+    b       .L_bigset
+
diff --git a/src/bsp/lk/lib/libc/string/arch/arm/rules.mk b/src/bsp/lk/lib/libc/string/arch/arm/rules.mk
new file mode 100644
index 0000000..8674a9d
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/arm/rules.mk
@@ -0,0 +1,41 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+ifeq ($(SUBARCH),arm)
+
+ASM_STRING_OPS := bcopy bzero memcpy memmove memset
+
+MODULE_SRCS += \
+	$(LOCAL_DIR)/arm/memcpy.S \
+	$(LOCAL_DIR)/arm/memset.S
+
+# filter out the C implementation
+C_STRING_OPS := $(filter-out $(ASM_STRING_OPS),$(C_STRING_OPS))
+endif
+
+ifeq ($(SUBARCH),arm-m)
+ifeq ($(ARM_CPU),cortex-m0)
+
+ASM_STRING_OPS :=
+
+MODULE_SRCS += \
+
+else ifeq ($(ARM_CPU),cortex-m0plus)
+
+ASM_STRING_OPS :=
+
+MODULE_SRCS += \
+
+else
+
+ASM_STRING_OPS := bcopy bzero memcpy memset
+
+MODULE_SRCS += \
+	$(LOCAL_DIR)/arm-m/memcpy.S \
+	$(LOCAL_DIR)/arm-m/memset.S
+endif
+
+# filter out the C implementation
+C_STRING_OPS := $(filter-out $(ASM_STRING_OPS),$(C_STRING_OPS))
+endif
+
+
diff --git a/src/bsp/lk/lib/libc/string/arch/arm64/rules.mk b/src/bsp/lk/lib/libc/string/arch/arm64/rules.mk
new file mode 100644
index 0000000..7a97451
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/arm64/rules.mk
@@ -0,0 +1,2 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
diff --git a/src/bsp/lk/lib/libc/string/arch/microblaze/rules.mk b/src/bsp/lk/lib/libc/string/arch/microblaze/rules.mk
new file mode 100644
index 0000000..3dc080b
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/microblaze/rules.mk
@@ -0,0 +1,11 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+ASM_STRING_OPS := #bcopy bzero memcpy memmove memset
+
+MODULE_SRCS += \
+	#$(LOCAL_DIR)/memcpy.S \
+	#$(LOCAL_DIR)/memset.S
+
+# filter out the C implementation
+C_STRING_OPS := $(filter-out $(ASM_STRING_OPS),$(C_STRING_OPS))
+
diff --git a/src/bsp/lk/lib/libc/string/arch/mips/rules.mk b/src/bsp/lk/lib/libc/string/arch/mips/rules.mk
new file mode 100644
index 0000000..3dc080b
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/mips/rules.mk
@@ -0,0 +1,11 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+ASM_STRING_OPS := #bcopy bzero memcpy memmove memset
+
+MODULE_SRCS += \
+	#$(LOCAL_DIR)/memcpy.S \
+	#$(LOCAL_DIR)/memset.S
+
+# filter out the C implementation
+C_STRING_OPS := $(filter-out $(ASM_STRING_OPS),$(C_STRING_OPS))
+
diff --git a/src/bsp/lk/lib/libc/string/arch/or1k/rules.mk b/src/bsp/lk/lib/libc/string/arch/or1k/rules.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/or1k/rules.mk
diff --git a/src/bsp/lk/lib/libc/string/arch/x86-64/memcpy.S b/src/bsp/lk/lib/libc/string/arch/x86-64/memcpy.S
new file mode 100644
index 0000000..84aec44
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/x86-64/memcpy.S
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2009 Corey Tabaka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+
+/* TODO: */
+
+.text
+.align 2
+
+/* void bcopy(const void *src, void *dest, size_t n); */
+FUNCTION(bcopy)
+    ret
+
+/* void *memcpy(void *dest, const void *src, size_t n); */
+FUNCTION(memmove)
+FUNCTION(memcpy)
+    ret
+
diff --git a/src/bsp/lk/lib/libc/string/arch/x86-64/memset.S b/src/bsp/lk/lib/libc/string/arch/x86-64/memset.S
new file mode 100644
index 0000000..43367f6
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/x86-64/memset.S
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Corey Tabaka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+
+/* TODO: */
+
+.text
+.align 2
+
+/* void bzero(void *s, size_t n); */
+FUNCTION(bzero)
+    ret
+
+/* void *memset(void *s, int c, size_t n); */
+FUNCTION(memset)
+    ret
+
diff --git a/src/bsp/lk/lib/libc/string/arch/x86-64/rules.mk b/src/bsp/lk/lib/libc/string/arch/x86-64/rules.mk
new file mode 100644
index 0000000..3dc080b
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/x86-64/rules.mk
@@ -0,0 +1,11 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+ASM_STRING_OPS := #bcopy bzero memcpy memmove memset
+
+MODULE_SRCS += \
+	#$(LOCAL_DIR)/memcpy.S \
+	#$(LOCAL_DIR)/memset.S
+
+# filter out the C implementation
+C_STRING_OPS := $(filter-out $(ASM_STRING_OPS),$(C_STRING_OPS))
+
diff --git a/src/bsp/lk/lib/libc/string/arch/x86/memcpy.S b/src/bsp/lk/lib/libc/string/arch/x86/memcpy.S
new file mode 100644
index 0000000..84aec44
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/x86/memcpy.S
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2009 Corey Tabaka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+
+/* TODO: */
+
+.text
+.align 2
+
+/* void bcopy(const void *src, void *dest, size_t n); */
+FUNCTION(bcopy)
+    ret
+
+/* void *memcpy(void *dest, const void *src, size_t n); */
+FUNCTION(memmove)
+FUNCTION(memcpy)
+    ret
+
diff --git a/src/bsp/lk/lib/libc/string/arch/x86/memset.S b/src/bsp/lk/lib/libc/string/arch/x86/memset.S
new file mode 100644
index 0000000..43367f6
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/x86/memset.S
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Corey Tabaka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <asm.h>
+
+/* TODO: */
+
+.text
+.align 2
+
+/* void bzero(void *s, size_t n); */
+FUNCTION(bzero)
+    ret
+
+/* void *memset(void *s, int c, size_t n); */
+FUNCTION(memset)
+    ret
+
diff --git a/src/bsp/lk/lib/libc/string/arch/x86/rules.mk b/src/bsp/lk/lib/libc/string/arch/x86/rules.mk
new file mode 100644
index 0000000..3dc080b
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/arch/x86/rules.mk
@@ -0,0 +1,11 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+ASM_STRING_OPS := #bcopy bzero memcpy memmove memset
+
+MODULE_SRCS += \
+	#$(LOCAL_DIR)/memcpy.S \
+	#$(LOCAL_DIR)/memset.S
+
+# filter out the C implementation
+C_STRING_OPS := $(filter-out $(ASM_STRING_OPS),$(C_STRING_OPS))
+
diff --git a/src/bsp/lk/lib/libc/string/bcopy.c b/src/bsp/lk/lib/libc/string/bcopy.c
new file mode 100644
index 0000000..cc025ff
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/bcopy.c
@@ -0,0 +1,34 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+void bcopy(void const *src, void *dest, size_t count)
+{
+    memcpy(dest, src, count);
+}
+
diff --git a/src/bsp/lk/lib/libc/string/bzero.c b/src/bsp/lk/lib/libc/string/bzero.c
new file mode 100644
index 0000000..b787d4e
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/bzero.c
@@ -0,0 +1,35 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+void
+bzero(void *dst, size_t count)
+{
+    memset(dst, 0, count);
+}
+
diff --git a/src/bsp/lk/lib/libc/string/memchr.c b/src/bsp/lk/lib/libc/string/memchr.c
new file mode 100644
index 0000000..cb3b4bf
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/memchr.c
@@ -0,0 +1,45 @@
+/*
+** Copyright 2001, Manuel J. Petit. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+void *
+memchr(void const *buf, int c, size_t len)
+{
+    size_t i;
+    unsigned char const *b= buf;
+    unsigned char        x= (c&0xff);
+
+    for (i= 0; i< len; i++) {
+        if (b[i]== x) {
+            return (void*)(b+i);
+        }
+    }
+
+    return NULL;
+}
+
diff --git a/src/bsp/lk/lib/libc/string/memcmp.c b/src/bsp/lk/lib/libc/string/memcmp.c
new file mode 100644
index 0000000..d6c0abd
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/memcmp.c
@@ -0,0 +1,40 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+int
+memcmp(const void *cs, const void *ct, size_t count)
+{
+    const unsigned char *su1, *su2;
+    signed char res = 0;
+
+    for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
+        if ((res = *su1 - *su2) != 0)
+            break;
+    return res;
+}
diff --git a/src/bsp/lk/lib/libc/string/memcpy.c b/src/bsp/lk/lib/libc/string/memcpy.c
new file mode 100644
index 0000000..f0e439c
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/memcpy.c
@@ -0,0 +1,69 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+
+#if !_ASM_MEMCPY
+
+typedef long word;
+
+#define lsize sizeof(word)
+#define lmask (lsize - 1)
+
+void *memcpy(void *dest, const void *src, size_t count)
+{
+    char *d = (char *)dest;
+    const char *s = (const char *)src;
+    int len;
+
+    if (count == 0 || dest == src)
+        return dest;
+
+    if (((long)d | (long)s) & lmask) {
+        // src and/or dest do not align on word boundary
+        if ((((long)d ^ (long)s) & lmask) || (count < lsize))
+            len = count; // copy the rest of the buffer with the byte mover
+        else
+            len = lsize - ((long)d & lmask); // move the ptrs up to a word boundary
+
+        count -= len;
+        for (; len > 0; len--)
+            *d++ = *s++;
+    }
+    for (len = count / lsize; len > 0; len--) {
+        *(word *)d = *(word *)s;
+        d += lsize;
+        s += lsize;
+    }
+    for (len = count & lmask; len > 0; len--)
+        *d++ = *s++;
+
+    return dest;
+}
+
+#endif
diff --git a/src/bsp/lk/lib/libc/string/memmove.c b/src/bsp/lk/lib/libc/string/memmove.c
new file mode 100644
index 0000000..c7da350
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/memmove.c
@@ -0,0 +1,93 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+#if !_ASM_MEMMOVE
+
+typedef long word;
+
+#define lsize sizeof(word)
+#define lmask (lsize - 1)
+
+void *
+memmove(void *dest, void const *src, size_t count)
+{
+    char *d = (char *)dest;
+    const char *s = (const char *)src;
+    int len;
+
+    if (count == 0 || dest == src)
+        return dest;
+
+    if ((long)d < (long)s) {
+        if (((long)d | (long)s) & lmask) {
+            // src and/or dest do not align on word boundary
+            if ((((long)d ^ (long)s) & lmask) || (count < lsize))
+                len = count; // copy the rest of the buffer with the byte mover
+            else
+                len = lsize - ((long)d & lmask); // move the ptrs up to a word boundary
+
+            count -= len;
+            for (; len > 0; len--)
+                *d++ = *s++;
+        }
+        for (len = count / lsize; len > 0; len--) {
+            *(word *)d = *(word *)s;
+            d += lsize;
+            s += lsize;
+        }
+        for (len = count & lmask; len > 0; len--)
+            *d++ = *s++;
+    } else {
+        d += count;
+        s += count;
+        if (((long)d | (long)s) & lmask) {
+            // src and/or dest do not align on word boundary
+            if ((((long)d ^ (long)s) & lmask) || (count <= lsize))
+                len = count;
+            else
+                len = ((long)d & lmask);
+
+            count -= len;
+            for (; len > 0; len--)
+                *--d = *--s;
+        }
+        for (len = count / lsize; len > 0; len--) {
+            d -= lsize;
+            s -= lsize;
+            *(word *)d = *(word *)s;
+        }
+        for (len = count & lmask; len > 0; len--)
+            *--d = *--s;
+    }
+
+    return dest;
+}
+
+#endif
+
diff --git a/src/bsp/lk/lib/libc/string/memscan.c b/src/bsp/lk/lib/libc/string/memscan.c
new file mode 100644
index 0000000..babe3d3
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/memscan.c
@@ -0,0 +1,41 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <libc/string.h>
+#include <libc/ctype.h>
+
+void *memscan(void *addr, int c, size_t size)
+{
+    unsigned char *p = (unsigned char *)addr;
+
+    while (size) {
+        if (*p == c)
+            return (void *)p;
+        p++;
+        size--;
+    }
+    return (void *)p;
+}
diff --git a/src/bsp/lk/lib/libc/string/memset.c b/src/bsp/lk/lib/libc/string/memset.c
new file mode 100644
index 0000000..9a19e16
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/memset.c
@@ -0,0 +1,63 @@
+/*
+** Copyright 2005, Michael Noisternig. All rights reserved.
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+void *
+memset(void *s, int c, size_t count)
+{
+    char *xs = (char *) s;
+    size_t len = (-(size_t)s) & (sizeof(size_t)-1);
+    size_t cc = c & 0xff;
+
+    if ( count > len ) {
+        count -= len;
+        cc |= cc << 8;
+        cc |= cc << 16;
+        if (sizeof(size_t) == 8)
+            cc |= (uint64_t)cc << 32; // should be optimized out on 32 bit machines
+
+        // write to non-aligned memory byte-wise
+        for ( ; len > 0; len-- )
+            *xs++ = c;
+
+        // write to aligned memory dword-wise
+        for ( len = count/sizeof(size_t); len > 0; len-- ) {
+            *((size_t *)xs) = (size_t)cc;
+            xs += sizeof(size_t);
+        }
+
+        count &= sizeof(size_t)-1;
+    }
+
+    // write remaining bytes
+    for ( ; count > 0; count-- )
+        *xs++ = c;
+
+    return s;
+}
diff --git a/src/bsp/lk/lib/libc/string/rules.mk b/src/bsp/lk/lib/libc/string/rules.mk
new file mode 100644
index 0000000..4e28e3e
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/rules.mk
@@ -0,0 +1,42 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+C_STRING_OPS := \
+	bcopy \
+	bzero \
+	memchr \
+	memcmp \
+	memcpy \
+	memmove \
+	memset \
+	strcat \
+	strchr \
+	strcmp \
+	strcoll \
+	strcpy \
+	strdup \
+	strerror \
+	strlcat \
+	strlcpy \
+	strlen \
+	strncat \
+	strncpy \
+	strncmp \
+	strnicmp \
+	strnlen \
+	strpbrk \
+	strrchr \
+	strspn \
+	strstr \
+	strtok \
+	strxfrm
+
+LIBC_STRING_C_DIR := $(LOCAL_DIR)
+
+# include the arch specific string routines
+#
+# the makefile may filter out implemented versions from the C_STRING_OPS variable
+include $(LOCAL_DIR)/arch/$(ARCH)/rules.mk
+
+MODULE_SRCS += \
+	$(addprefix $(LIBC_STRING_C_DIR)/,$(addsuffix .c,$(C_STRING_OPS)))
+
diff --git a/src/bsp/lk/lib/libc/string/strcat.c b/src/bsp/lk/lib/libc/string/strcat.c
new file mode 100644
index 0000000..c665519
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strcat.c
@@ -0,0 +1,42 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strcat(char *dest,  char const*src)
+{
+    char *tmp = dest;
+
+    while (*dest)
+        dest++;
+    while ((*dest++ = *src++) != '\0')
+        ;
+
+    return tmp;
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strchr.c b/src/bsp/lk/lib/libc/string/strchr.c
new file mode 100644
index 0000000..f57e5d1
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strchr.c
@@ -0,0 +1,37 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strchr(const char *s, int c)
+{
+    for (; *s != (char) c; ++s)
+        if (*s == '\0')
+            return NULL;
+    return (char *) s;
+}
diff --git a/src/bsp/lk/lib/libc/string/strcmp.c b/src/bsp/lk/lib/libc/string/strcmp.c
new file mode 100644
index 0000000..a89d57c
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strcmp.c
@@ -0,0 +1,41 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+int
+strcmp(char const *cs, char const *ct)
+{
+    signed char __res;
+
+    while (1) {
+        if ((__res = *cs - *ct++) != 0 || !*cs++)
+            break;
+    }
+
+    return __res;
+}
diff --git a/src/bsp/lk/lib/libc/string/strcoll.c b/src/bsp/lk/lib/libc/string/strcoll.c
new file mode 100644
index 0000000..549cb89
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strcoll.c
@@ -0,0 +1,34 @@
+/*
+** Copyright 2004, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+
+int
+strcoll(const char *s1, const char *s2)
+{
+    return strcmp(s1, s2);
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strcpy.c b/src/bsp/lk/lib/libc/string/strcpy.c
new file mode 100644
index 0000000..f8f43e1
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strcpy.c
@@ -0,0 +1,39 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strcpy(char *dest, char const *src)
+{
+    char *tmp = dest;
+
+    while ((*dest++ = *src++) != '\0')
+        ;
+    return tmp;
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strdup.c b/src/bsp/lk/lib/libc/string/strdup.c
new file mode 100644
index 0000000..ee292c4
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strdup.c
@@ -0,0 +1,43 @@
+/*
+** Copyright 2004, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdlib.h>
+#include <string.h>
+
+char *
+strdup(const char *str)
+{
+    size_t len;
+    char *copy;
+
+    len = strlen(str) + 1;
+    copy = malloc(len);
+    if (copy == NULL)
+        return NULL;
+    memcpy(copy, str, len);
+    return copy;
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strerror.c b/src/bsp/lk/lib/libc/string/strerror.c
new file mode 100644
index 0000000..49941ac
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strerror.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strerror(int errnum)
+{
+    if (errnum < 0) {
+        return (char *)"General Error";
+    } else {
+        return (char *)"No Error";
+    }
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strlcat.c b/src/bsp/lk/lib/libc/string/strlcat.c
new file mode 100644
index 0000000..4760e91
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strlcat.c
@@ -0,0 +1,50 @@
+/*
+** Copyright 2002, Manuel J. Petit. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <sys/types.h>
+
+size_t
+strlcat(char *dst, char const *src, size_t s)
+{
+    size_t i;
+    size_t j= strnlen(dst, s);
+
+    if (!s) {
+        return j+strlen(src);
+    }
+
+    dst+= j;
+
+    for (i= 0; ((i< s-1) && src[i]); i++) {
+        dst[i]= src[i];
+    }
+
+    dst[i]= 0;
+
+    return j + i + strlen(src+i);
+}
diff --git a/src/bsp/lk/lib/libc/string/strlcpy.c b/src/bsp/lk/lib/libc/string/strlcpy.c
new file mode 100644
index 0000000..7c76be6
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strlcpy.c
@@ -0,0 +1,47 @@
+/*
+** Copyright 2002, Manuel J. Petit. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <sys/types.h>
+
+size_t
+strlcpy(char *dst, char const *src, size_t s)
+{
+    size_t i= 0;
+
+    if (!s) {
+        return strlen(src);
+    }
+
+    for (i= 0; ((i< s-1) && src[i]); i++) {
+        dst[i]= src[i];
+    }
+
+    dst[i]= 0;
+
+    return i + strlen(src+i);
+}
diff --git a/src/bsp/lk/lib/libc/string/strlen.c b/src/bsp/lk/lib/libc/string/strlen.c
new file mode 100644
index 0000000..1659f78
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strlen.c
@@ -0,0 +1,41 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+size_t
+strlen(char const *s)
+{
+    size_t i;
+
+    i= 0;
+    while (s[i]) {
+        i+= 1;
+    }
+
+    return i;
+}
diff --git a/src/bsp/lk/lib/libc/string/strncat.c b/src/bsp/lk/lib/libc/string/strncat.c
new file mode 100644
index 0000000..078c33d
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strncat.c
@@ -0,0 +1,48 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strncat(char *dest, char const *src, size_t count)
+{
+    char *tmp = dest;
+
+    if (count > 0) {
+        while (*dest)
+            dest++;
+        while ((*dest++ = *src++)) {
+            if (--count == 0) {
+                *dest = '\0';
+                break;
+            }
+        }
+    }
+
+    return tmp;
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strncmp.c b/src/bsp/lk/lib/libc/string/strncmp.c
new file mode 100644
index 0000000..4185482
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strncmp.c
@@ -0,0 +1,42 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+int
+strncmp(char const *cs, char const *ct, size_t count)
+{
+    signed char __res = 0;
+
+    while (count > 0) {
+        if ((__res = *cs - *ct++) != 0 || !*cs++)
+            break;
+        count--;
+    }
+
+    return __res;
+}
diff --git a/src/bsp/lk/lib/libc/string/strncpy.c b/src/bsp/lk/lib/libc/string/strncpy.c
new file mode 100644
index 0000000..70ea19b
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strncpy.c
@@ -0,0 +1,40 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strncpy(char *dest, char const *src, size_t count)
+{
+    char *tmp = dest;
+
+    while (count-- && (*dest++ = *src++) != '\0')
+        ;
+
+    return tmp;
+}
+
diff --git a/src/bsp/lk/lib/libc/string/strnicmp.c b/src/bsp/lk/lib/libc/string/strnicmp.c
new file mode 100644
index 0000000..67c7b9f
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strnicmp.c
@@ -0,0 +1,57 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+
+int
+strnicmp(char const *s1, char const *s2, size_t len)
+{
+    unsigned char c1 = '\0';
+    unsigned char c2 = '\0';
+
+    if (len > 0) {
+        do {
+            c1 = *s1;
+            c2 = *s2;
+            s1++;
+            s2++;
+            if (!c1)
+                break;
+            if (!c2)
+                break;
+            if (c1 == c2)
+                continue;
+            c1 = tolower(c1);
+            c2 = tolower(c2);
+            if (c1 != c2)
+                break;
+        } while (--len);
+    }
+    return (int)c1 - (int)c2;
+}
+#pragma weak strncasecmp=strnicmp
diff --git a/src/bsp/lk/lib/libc/string/strnlen.c b/src/bsp/lk/lib/libc/string/strnlen.c
new file mode 100644
index 0000000..07e56e8
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strnlen.c
@@ -0,0 +1,38 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+size_t
+strnlen(char const *s, size_t count)
+{
+    const char *sc;
+
+    for (sc = s; count-- && *sc != '\0'; ++sc)
+        ;
+    return sc - s;
+}
diff --git a/src/bsp/lk/lib/libc/string/strpbrk.c b/src/bsp/lk/lib/libc/string/strpbrk.c
new file mode 100644
index 0000000..0812037
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strpbrk.c
@@ -0,0 +1,44 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strpbrk(char const *cs, char const *ct)
+{
+    const char *sc1;
+    const char *sc2;
+
+    for (sc1 = cs; *sc1 != '\0'; ++sc1) {
+        for (sc2 = ct; *sc2 != '\0'; ++sc2) {
+            if (*sc1 == *sc2)
+                return (char *)sc1;
+        }
+    }
+
+    return NULL;
+}
diff --git a/src/bsp/lk/lib/libc/string/strrchr.c b/src/bsp/lk/lib/libc/string/strrchr.c
new file mode 100644
index 0000000..f0dc21c
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strrchr.c
@@ -0,0 +1,45 @@
+/*
+** Copyright 2001, Manuel J. Petit. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strrchr(char const *s, int c)
+{
+    char const *last= c?0:s;
+
+
+    while (*s) {
+        if (*s== c) {
+            last= s;
+        }
+
+        s+= 1;
+    }
+
+    return (char *)last;
+}
diff --git a/src/bsp/lk/lib/libc/string/strspn.c b/src/bsp/lk/lib/libc/string/strspn.c
new file mode 100644
index 0000000..bfeb7ac
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strspn.c
@@ -0,0 +1,48 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+size_t
+strspn(char const *s, char const *accept)
+{
+    const char *p;
+    const char *a;
+    size_t count = 0;
+
+    for (p = s; *p != '\0'; ++p) {
+        for (a = accept; *a != '\0'; ++a) {
+            if (*p == *a)
+                break;
+        }
+        if (*a == '\0')
+            return count;
+        ++count;
+    }
+
+    return count;
+}
diff --git a/src/bsp/lk/lib/libc/string/strstr.c b/src/bsp/lk/lib/libc/string/strstr.c
new file mode 100644
index 0000000..15dc6af
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strstr.c
@@ -0,0 +1,46 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+char *
+strstr(char const *s1, char const *s2)
+{
+    int l1, l2;
+
+    l2 = strlen(s2);
+    if (!l2)
+        return (char *)s1;
+    l1 = strlen(s1);
+    while (l1 >= l2) {
+        l1--;
+        if (!memcmp(s1,s2,l2))
+            return (char *)s1;
+        s1++;
+    }
+    return NULL;
+}
diff --git a/src/bsp/lk/lib/libc/string/strtok.c b/src/bsp/lk/lib/libc/string/strtok.c
new file mode 100644
index 0000000..4839614
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strtok.c
@@ -0,0 +1,51 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+static char *___strtok = NULL;
+
+char *
+strtok(char *s, char const *ct)
+{
+    char *sbegin, *send;
+
+    sbegin  = s ? s : ___strtok;
+    if (!sbegin) {
+        return NULL;
+    }
+    sbegin += strspn(sbegin,ct);
+    if (*sbegin == '\0') {
+        ___strtok = NULL;
+        return ( NULL );
+    }
+    send = strpbrk( sbegin, ct);
+    if (send && *send != '\0')
+        *send++ = '\0';
+    ___strtok = send;
+    return (sbegin);
+}
diff --git a/src/bsp/lk/lib/libc/string/strxfrm.c b/src/bsp/lk/lib/libc/string/strxfrm.c
new file mode 100644
index 0000000..0eff870
--- /dev/null
+++ b/src/bsp/lk/lib/libc/string/strxfrm.c
@@ -0,0 +1,42 @@
+/*
+** Copyright 2004, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include <sys/types.h>
+
+size_t
+strxfrm(char *dest, const char *src, size_t n)
+{
+    size_t len = strlen(src);
+
+    if (n) {
+        size_t copy_len = len < n ? len : n - 1;
+        memcpy(dest, src, copy_len);
+        dest[copy_len] = 0;
+    }
+    return len;
+}
+
diff --git a/src/bsp/lk/lib/libc/strtol.c b/src/bsp/lk/lib/libc/strtol.c
new file mode 100644
index 0000000..d87bde0
--- /dev/null
+++ b/src/bsp/lk/lib/libc/strtol.c
@@ -0,0 +1,140 @@
+/*  $OpenBSD: strtol.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+
+/*
+ * Convert a string to a long integer.
+ *
+ * Ignores `locale' stuff.  Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+long
+strtol(const char *nptr, char **endptr, int base)
+{
+    const char *s;
+    long acc, cutoff;
+    int c;
+    int neg, any, cutlim;
+
+    /*
+     * Skip white space and pick up leading +/- sign if any.
+     * If base is 0, allow 0x for hex and 0 for octal, else
+     * assume decimal; if base is already 16, allow 0x.
+     */
+    s = nptr;
+    do {
+        c = (unsigned char) *s++;
+    } while (isspace(c));
+    if (c == '-') {
+        neg = 1;
+        c = *s++;
+    } else {
+        neg = 0;
+        if (c == '+')
+            c = *s++;
+    }
+    if ((base == 0 || base == 16) &&
+            c == '0' && (*s == 'x' || *s == 'X')) {
+        c = s[1];
+        s += 2;
+        base = 16;
+    }
+    if (base == 0)
+        base = c == '0' ? 8 : 10;
+
+    /*
+     * Compute the cutoff value between legal numbers and illegal
+     * numbers.  That is the largest legal value, divided by the
+     * base.  An input number that is greater than this value, if
+     * followed by a legal input character, is too big.  One that
+     * is equal to this value may be valid or not; the limit
+     * between valid and invalid numbers is then based on the last
+     * digit.  For instance, if the range for longs is
+     * [-2147483648..2147483647] and the input base is 10,
+     * cutoff will be set to 214748364 and cutlim to either
+     * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
+     * a value > 214748364, or equal but the next digit is > 7 (or 8),
+     * the number is too big, and we will return a range error.
+     *
+     * Set any if any `digits' consumed; make it negative to indicate
+     * overflow.
+     */
+    cutoff = neg ? LONG_MIN : LONG_MAX;
+    cutlim = cutoff % base;
+    cutoff /= base;
+    if (neg) {
+        if (cutlim > 0) {
+            cutlim -= base;
+            cutoff += 1;
+        }
+        cutlim = -cutlim;
+    }
+    for (acc = 0, any = 0;; c = (unsigned char) *s++) {
+        if (isdigit(c))
+            c -= '0';
+        else if (isalpha(c))
+            c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+        else
+            break;
+        if (c >= base)
+            break;
+        if (any < 0)
+            continue;
+        if (neg) {
+            if (acc < cutoff || (acc == cutoff && c > cutlim)) {
+                any = -1;
+                acc = LONG_MIN;
+                errno = ERANGE;
+            } else {
+                any = 1;
+                acc *= base;
+                acc -= c;
+            }
+        } else {
+            if (acc > cutoff || (acc == cutoff && c > cutlim)) {
+                any = -1;
+                acc = LONG_MAX;
+                errno = ERANGE;
+            } else {
+                any = 1;
+                acc *= base;
+                acc += c;
+            }
+        }
+    }
+    if (endptr != 0)
+        *endptr = (char *) (any ? s - 1 : nptr);
+    return (acc);
+}
diff --git a/src/bsp/lk/lib/libc/strtoll.c b/src/bsp/lk/lib/libc/strtoll.c
new file mode 100644
index 0000000..e63c66a
--- /dev/null
+++ b/src/bsp/lk/lib/libc/strtoll.c
@@ -0,0 +1,142 @@
+/* $OpenBSD: strtoll.c,v 1.6 2005/11/10 10:00:17 espie Exp $ */
+/*-
+ * Copyright (c) 1992 The Regents of the University of California.
+ * 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+/*
+ * Convert a string to a long long.
+ *
+ * Ignores `locale' stuff.  Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+long long
+strtoll(const char *nptr, char **endptr, int base)
+{
+    const char *s;
+    long long acc, cutoff;
+    int c;
+    int neg, any, cutlim;
+
+    /*
+     * Skip white space and pick up leading +/- sign if any.
+     * If base is 0, allow 0x for hex and 0 for octal, else
+     * assume decimal; if base is already 16, allow 0x.
+     */
+    s = nptr;
+    do {
+        c = (unsigned char) *s++;
+    } while (isspace(c));
+    if (c == '-') {
+        neg = 1;
+        c = *s++;
+    } else {
+        neg = 0;
+        if (c == '+')
+            c = *s++;
+    }
+    if ((base == 0 || base == 16) &&
+            c == '0' && (*s == 'x' || *s == 'X')) {
+        c = s[1];
+        s += 2;
+        base = 16;
+    }
+    if (base == 0)
+        base = c == '0' ? 8 : 10;
+
+    /*
+     * Compute the cutoff value between legal numbers and illegal
+     * numbers.  That is the largest legal value, divided by the
+     * base.  An input number that is greater than this value, if
+     * followed by a legal input character, is too big.  One that
+     * is equal to this value may be valid or not; the limit
+     * between valid and invalid numbers is then based on the last
+     * digit.  For instance, if the range for long longs is
+     * [-9223372036854775808..9223372036854775807] and the input base
+     * is 10, cutoff will be set to 922337203685477580 and cutlim to
+     * either 7 (neg==0) or 8 (neg==1), meaning that if we have
+     * accumulated a value > 922337203685477580, or equal but the
+     * next digit is > 7 (or 8), the number is too big, and we will
+     * return a range error.
+     *
+     * Set any if any `digits' consumed; make it negative to indicate
+     * overflow.
+     */
+    cutoff = neg ? LLONG_MIN : LLONG_MAX;
+    cutlim = cutoff % base;
+    cutoff /= base;
+    if (neg) {
+        if (cutlim > 0) {
+            cutlim -= base;
+            cutoff += 1;
+        }
+        cutlim = -cutlim;
+    }
+    for (acc = 0, any = 0;; c = (unsigned char) *s++) {
+        if (isdigit(c))
+            c -= '0';
+        else if (isalpha(c))
+            c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+        else
+            break;
+        if (c >= base)
+            break;
+        if (any < 0)
+            continue;
+        if (neg) {
+            if (acc < cutoff || (acc == cutoff && c > cutlim)) {
+                any = -1;
+                acc = LLONG_MIN;
+                errno = ERANGE;
+            } else {
+                any = 1;
+                acc *= base;
+                acc -= c;
+            }
+        } else {
+            if (acc > cutoff || (acc == cutoff && c > cutlim)) {
+                any = -1;
+                acc = LLONG_MAX;
+                errno = ERANGE;
+            } else {
+                any = 1;
+                acc *= base;
+                acc += c;
+            }
+        }
+    }
+    if (endptr != 0)
+        *endptr = (char *) (any ? s - 1 : nptr);
+    return (acc);
+}
