aboutsummaryrefslogtreecommitdiff
path: root/src/sysbin/shell
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-13 15:37:30 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-13 15:37:30 +0100
commit41a4f5309ef298da764bf1dca1254e734a4417f0 (patch)
tree43e2e820f39c09db36d3a12e3fb2495cb38adca7 /src/sysbin/shell
parentd0dc9f38184956af49379d7e2585756523cfa4c1 (diff)
downloadkogata-41a4f5309ef298da764bf1dca1254e734a4417f0.tar.gz
kogata-41a4f5309ef298da764bf1dca1254e734a4417f0.zip
Basis for a shell.
Diffstat (limited to 'src/sysbin/shell')
-rw-r--r--src/sysbin/shell/Makefile12
-rw-r--r--src/sysbin/shell/main.c27
2 files changed, 39 insertions, 0 deletions
diff --git a/src/sysbin/shell/Makefile b/src/sysbin/shell/Makefile
new file mode 100644
index 0000000..80d1009
--- /dev/null
+++ b/src/sysbin/shell/Makefile
@@ -0,0 +1,12 @@
+
+OBJ = main.o
+
+LIB = ../../lib/libkogata/libkogata.lib
+
+CFLAGS = -I ./include -I ../../common/include -I ../../lib/include
+
+LDFLAGS = -T ../linker.ld -Xlinker -Map=shell.map
+
+OUT = shell.bin
+
+include ../../rules.make
diff --git a/src/sysbin/shell/main.c b/src/sysbin/shell/main.c
new file mode 100644
index 0000000..54cec06
--- /dev/null
+++ b/src/sysbin/shell/main.c
@@ -0,0 +1,27 @@
+#include <string.h>
+#include <malloc.h>
+#include <user_region.h>
+#include <debug.h>
+
+#include <stdio.h>
+
+#include <syscall.h>
+
+int main(int argc, char **argv) {
+ dbg_printf("[shell] Starting\n");
+
+ /*fctl(stdio, FC_SET_BLOCKING, 0);*/
+
+ puts("Hello, world!\n");
+
+ while(true) {
+ puts("> ");
+ char buf[256];
+ getline(buf, 256);
+ printf("You said: '%s'. I don't understand a word of that.\n\n", buf);
+ }
+
+ return 0;
+}
+
+/* vim: set ts=4 sw=4 tw=0 noet :*/