summaryrefslogtreecommitdiff
path: root/Source/Applications/Shell
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-20 19:21:34 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-20 19:21:34 +0200
commit9836acd720988af30250c2c1ec18d618664dea4e (patch)
tree9e26d7d65e1693d1a7f9fd93c9fd33b41d175464 /Source/Applications/Shell
parent90b49b6f171108f272ff529f7546bd9625ca7d17 (diff)
downloadMelon-9836acd720988af30250c2c1ec18d618664dea4e.tar.gz
Melon-9836acd720988af30250c2c1ec18d618664dea4e.zip
Started working on a userland shell
This means I'll have to do syscalls for everything I need.
Diffstat (limited to 'Source/Applications/Shell')
-rw-r--r--Source/Applications/Shell/Makefile31
-rw-r--r--Source/Applications/Shell/main.cpp13
2 files changed, 44 insertions, 0 deletions
diff --git a/Source/Applications/Shell/Makefile b/Source/Applications/Shell/Makefile
new file mode 100644
index 0000000..205fc2f
--- /dev/null
+++ b/Source/Applications/Shell/Makefile
@@ -0,0 +1,31 @@
+.PHONY: clean, mrproper
+
+CXX = g++
+CXXFLAGS = -nostartfiles -nostdlib -fno-exceptions -fno-rtti -I ../../Library/Common -I ../../Library/Interface -I ../../Library/Userland -D THIS_IS_MELON_USERLAND
+
+LD = ld
+LDFLAGS = -T ../../Library/Link.ld
+
+Objects = main.o
+OutFile = Shell
+
+all: $(OutFile)
+ echo "* Done with $(OutFile)."
+
+rebuild: mrproper all
+
+$(OutFile): $(Objects)
+ echo "* Linking $@.o..."
+ $(LD) $(LDFLAGS) ../../Library/Melon.o $^ -o $@
+
+%.o: %.cpp
+ echo "* Compiling $<..."
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+clean:
+ echo "* Removing object files..."
+ rm -rf *.o
+
+mrproper: clean
+ echo "* Removing applications..."
+ rm -rf $(OutFile)
diff --git a/Source/Applications/Shell/main.cpp b/Source/Applications/Shell/main.cpp
new file mode 100644
index 0000000..fabf30c
--- /dev/null
+++ b/Source/Applications/Shell/main.cpp
@@ -0,0 +1,13 @@
+#include <Binding/VirtualTerminal.class.h>
+#include <Binding/FSNode.class.h>
+#include <String.class.h>
+
+int main() {
+ VirtualTerminal vt = VirtualTerminal::get();
+ FSNode node = FSNode::getRoot();
+ while (1) {
+ vt << node.getName() << " : ";
+ String s = vt.readLine();
+ }
+ return 0;
+}