From 7708a5f335c6b3256290775e7f5deb43b681bf03 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Wed, 21 Oct 2009 17:32:50 +0200 Subject: More work --- Source/Applications/SampleApps/cxxdemo.cpp | 15 +++++++-------- Source/Applications/Shell/Makefile | 3 ++- Source/Applications/Shell/Shell.ns.cpp | 15 +++++++++++++++ Source/Applications/Shell/Shell.ns.h | 9 +++++++++ Source/Applications/Shell/main.cpp | 12 ++---------- 5 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 Source/Applications/Shell/Shell.ns.cpp create mode 100644 Source/Applications/Shell/Shell.ns.h (limited to 'Source/Applications') diff --git a/Source/Applications/SampleApps/cxxdemo.cpp b/Source/Applications/SampleApps/cxxdemo.cpp index 01644a8..cf297ec 100644 --- a/Source/Applications/SampleApps/cxxdemo.cpp +++ b/Source/Applications/SampleApps/cxxdemo.cpp @@ -4,16 +4,15 @@ #include int main() { - VirtualTerminal x = VirtualTerminal::get(); - String s = x.readLine(); - x.write(s); + String s = invt.readLine(); + outvt << s; Thread t = Thread::get(); for (char c = ' '; c <= 'z'; c++) { t.sleep((u32int)c / 4); - x.put(c); + outvt.put(c); } - x.put("\n"); - x.write("Salut les gens ! c'est le progrès !!!\nLe boeuf mort est juste là : "); - x.writeHex(0xDEADBEEF); - x.put("\n"); + outvt << "\n"; + outvt << "Salut les gens ! c'est le progrès !!!\nLe boeuf mort est juste là : "; + outvt << 0xDEADBEEF; + outvt << "\n"; } 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 +#include +#include + +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 -#include -#include +#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(); } -- cgit v1.2.3