initial commit of lk (little kernel) project
diff --git a/project/armemu-lwip/armemu.conf b/project/armemu-lwip/armemu.conf
new file mode 100644
index 0000000..08acb57
--- /dev/null
+++ b/project/armemu-lwip/armemu.conf
@@ -0,0 +1,14 @@
+[cpu]
+core = arm926ejs
+
+# the rom file is loaded at address 0x0
+[rom]
+file = lk.bin
+
+[system]
+display = no
+console = yes
+network = yes
+
+[network]
+device = /dev/tap0
diff --git a/project/armemu-lwip/init.c b/project/armemu-lwip/init.c
new file mode 100644
index 0000000..2f42f9d
--- /dev/null
+++ b/project/armemu-lwip/init.c
@@ -0,0 +1,42 @@
+/*
+ * 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 <debug.h>
+#include <project.h>
+
+extern int thread_tests(void);
+extern int httpd_init(void);
+extern int lwip_init(void);
+
+void project_init(void)
+{
+
+	/* initialize the lwip stuff */
+	dprintf("project_init: initialize lwip\n");
+	lwip_init();
+
+	/* start the http server */
+	httpd_init();
+
+	dprintf("done with project_init\n");
+}
+
diff --git a/project/armemu-lwip/rules.mk b/project/armemu-lwip/rules.mk
new file mode 100644
index 0000000..3fa21ab
--- /dev/null
+++ b/project/armemu-lwip/rules.mk
@@ -0,0 +1,29 @@
+# top level project rules for the armemu-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := armemu
+LIBS += lwip
+APPS += httpd
+
+# use dhcp
+#DEFINES += \
+	WITH_DHCP=1
+
+# use static ip
+DEFINES += \
+	WITH_STATIC_IP=1 \
+	IP_ADDR=0xc0a80202 \
+	GW_ADDR=0xc0a80101 \
+	NETMASK=0xffffff00
+
+OBJS += \
+	$(LOCAL_DIR)/init.o
+
+# extra rules to copy the armemu.conf file to the build dir
+$(BUILDDIR)/armemu.conf: $(LOCAL_DIR)/armemu.conf
+	@echo copy $< to $@
+	$(NOECHO)cp $< $@
+
+EXTRA_BUILDDEPS += $(BUILDDIR)/armemu.conf
+GENERATED += $(BUILDDIR)/armemu.conf
diff --git a/project/armemu-test/armemu.conf b/project/armemu-test/armemu.conf
new file mode 100644
index 0000000..7eaea5d
--- /dev/null
+++ b/project/armemu-test/armemu.conf
@@ -0,0 +1,14 @@
+[cpu]
+core = arm926ejs
+
+# the rom file is loaded at address 0x0
+[rom]
+file = lk.bin
+
+[system]
+display = no
+console = yes
+network = no
+
+[network]
+device = /dev/tap0
diff --git a/project/armemu-test/init.c b/project/armemu-test/init.c
new file mode 100644
index 0000000..7586c24
--- /dev/null
+++ b/project/armemu-test/init.c
@@ -0,0 +1,33 @@
+/*
+ * 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 <app/tests.h>
+#include <app/console.h>
+
+void project_init(void)
+{
+	console_init();
+	tests_init();
+	
+	console_start();
+}
+
diff --git a/project/armemu-test/rules.mk b/project/armemu-test/rules.mk
new file mode 100644
index 0000000..56eecca
--- /dev/null
+++ b/project/armemu-test/rules.mk
@@ -0,0 +1,18 @@
+# top level project rules for the armemu-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := armemu
+APPS := tests \
+	console
+
+OBJS += \
+	$(LOCAL_DIR)/init.o
+
+# extra rules to copy the armemu.conf file to the build dir
+$(BUILDDIR)/armemu.conf: $(LOCAL_DIR)/armemu.conf
+	@echo copy $< to $@
+	$(NOECHO)cp $< $@
+
+EXTRA_BUILDDEPS += $(BUILDDIR)/armemu.conf
+GENERATED += $(BUILDDIR)/armemu.conf
diff --git a/project/beagle-test/init.c b/project/beagle-test/init.c
new file mode 100644
index 0000000..afa5d34
--- /dev/null
+++ b/project/beagle-test/init.c
@@ -0,0 +1,38 @@
+/*
+ * 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 <debug.h>
+#include <arch/arm.h>
+#include <app/console.h>
+#include <app/tests.h>
+
+extern int string_tests(void);
+extern int thread_tests(void);
+
+void project_init(void)
+{
+	console_init();
+	tests_init();
+	
+	console_start();
+}
+
diff --git a/project/beagle-test/rules.mk b/project/beagle-test/rules.mk
new file mode 100644
index 0000000..f20f613
--- /dev/null
+++ b/project/beagle-test/rules.mk
@@ -0,0 +1,11 @@
+# top level project rules for the armemu-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := beagle
+APPS := tests console stringtests
+DEVS := 
+
+OBJS += \
+	$(LOCAL_DIR)/init.o
+
diff --git a/project/osk5912-test/armemu.conf b/project/osk5912-test/armemu.conf
new file mode 100644
index 0000000..7eaea5d
--- /dev/null
+++ b/project/osk5912-test/armemu.conf
@@ -0,0 +1,14 @@
+[cpu]
+core = arm926ejs
+
+# the rom file is loaded at address 0x0
+[rom]
+file = lk.bin
+
+[system]
+display = no
+console = yes
+network = no
+
+[network]
+device = /dev/tap0
diff --git a/project/osk5912-test/init.c b/project/osk5912-test/init.c
new file mode 100644
index 0000000..569427f
--- /dev/null
+++ b/project/osk5912-test/init.c
@@ -0,0 +1,41 @@
+/*
+ * 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 <debug.h>
+#include <arch/arm.h>
+#include <app/console.h>
+#include <app/tests.h>
+
+extern int string_tests(void);
+extern int thread_tests(void);
+
+void project_init(void)
+{
+	console_init();
+	tests_init();
+	
+//	console_run_command("printf_tests");
+//	console_run_command("thread_tests");
+
+	console_start();
+}
+
diff --git a/project/osk5912-test/rules.mk b/project/osk5912-test/rules.mk
new file mode 100644
index 0000000..80b76ac
--- /dev/null
+++ b/project/osk5912-test/rules.mk
@@ -0,0 +1,10 @@
+# top level project rules for the armemu-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := osk5912
+APPS := tests console
+
+OBJS += \
+	$(LOCAL_DIR)/init.o
+
diff --git a/project/qemu-arm-test/init.c b/project/qemu-arm-test/init.c
new file mode 100644
index 0000000..a34f343
--- /dev/null
+++ b/project/qemu-arm-test/init.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.
+ */
+extern int thread_tests(void);
+
+void project_init(void)
+{
+	thread_tests();
+}
+
diff --git a/project/qemu-arm-test/rules.mk b/project/qemu-arm-test/rules.mk
new file mode 100644
index 0000000..71a300f
--- /dev/null
+++ b/project/qemu-arm-test/rules.mk
@@ -0,0 +1,10 @@
+# top level project rules for the qemu-arm-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := qemu-arm
+APPS := tests
+
+OBJS += \
+	$(LOCAL_DIR)/init.o
+
diff --git a/project/qemu-arm-test/runqemu b/project/qemu-arm-test/runqemu
new file mode 100755
index 0000000..a34f936
--- /dev/null
+++ b/project/qemu-arm-test/runqemu
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+qemu-system-arm -serial stdio -nographic -kernel build-qemu-arm-test/lk.bin
diff --git a/project/sam7ex256-test/init.c b/project/sam7ex256-test/init.c
new file mode 100644
index 0000000..a34f343
--- /dev/null
+++ b/project/sam7ex256-test/init.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.
+ */
+extern int thread_tests(void);
+
+void project_init(void)
+{
+	thread_tests();
+}
+
diff --git a/project/sam7ex256-test/rules.mk b/project/sam7ex256-test/rules.mk
new file mode 100644
index 0000000..1c775f3
--- /dev/null
+++ b/project/sam7ex256-test/rules.mk
@@ -0,0 +1,9 @@
+# top level project rules for the sam7ex256-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := sam7ex256
+APPS := tests
+
+OBJS += \
+	$(LOCAL_DIR)/init.o