summaryrefslogtreecommitdiff
path: root/Source/Applications/Shell
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Applications/Shell')
-rw-r--r--Source/Applications/Shell/Makefile3
-rw-r--r--Source/Applications/Shell/Shell.ns.cpp15
-rw-r--r--Source/Applications/Shell/Shell.ns.h9
-rw-r--r--Source/Applications/Shell/main.cpp12
4 files changed, 28 insertions, 11 deletions
diff --git a/Source/Applications/Shell/Makefile b/Source/Applications/Shell/Makefile
index 205fc2f..b33b067 100644
--- a/Source/Applications/Shell/Makefile
+++ b/Source/Applications/Shell/Makefile
@@ -6,7 +6,8 @@ CXXFLAGS = -nostartfiles -nostdlib -fno-exceptions -fno-rtti -I ../../Library/Co
LD = ld
LDFLAGS = -T ../../Library/Link.ld
-Objects = main.o
+Objects = main.o \
+ Shell.ns.o
OutFile = Shell
all: $(OutFile)
diff --git a/Source/Applications/Shell/Shell.ns.cpp b/Source/Applications/Shell/Shell.ns.cpp
new file mode 100644
index 0000000..e2433cb
--- /dev/null
+++ b/Source/Applications/Shell/Shell.ns.cpp
@@ -0,0 +1,15 @@
+#include "Shell.ns.h"
+
+namespace Shell {
+
+FSNode node(0);
+
+u32int run() {
+ node = FSNode::getRoot();
+ while (1) {
+ outvt << node.getName() << " : ";
+ String s = invt.readLine();
+ }
+}
+
+}
diff --git a/Source/Applications/Shell/Shell.ns.h b/Source/Applications/Shell/Shell.ns.h
new file mode 100644
index 0000000..7d76b33
--- /dev/null
+++ b/Source/Applications/Shell/Shell.ns.h
@@ -0,0 +1,9 @@
+#include <Binding/VirtualTerminal.class.h>
+#include <Binding/FSNode.class.h>
+#include <String.class.h>
+
+namespace Shell {
+ u32int run();
+
+ extern FSNode cwd;
+}
diff --git a/Source/Applications/Shell/main.cpp b/Source/Applications/Shell/main.cpp
index fabf30c..70da17b 100644
--- a/Source/Applications/Shell/main.cpp
+++ b/Source/Applications/Shell/main.cpp
@@ -1,13 +1,5 @@
-#include <Binding/VirtualTerminal.class.h>
-#include <Binding/FSNode.class.h>
-#include <String.class.h>
+#include "Shell.ns.h"
int main() {
- VirtualTerminal vt = VirtualTerminal::get();
- FSNode node = FSNode::getRoot();
- while (1) {
- vt << node.getName() << " : ";
- String s = vt.readLine();
- }
- return 0;
+ return Shell::run();
}