diff options
Diffstat (limited to 'Source/Applications')
-rw-r--r-- | Source/Applications/SampleApps/cxxdemo.cpp | 15 | ||||
-rw-r--r-- | Source/Applications/Shell/Makefile | 3 | ||||
-rw-r--r-- | Source/Applications/Shell/Shell.ns.cpp | 15 | ||||
-rw-r--r-- | Source/Applications/Shell/Shell.ns.h | 9 | ||||
-rw-r--r-- | Source/Applications/Shell/main.cpp | 12 |
5 files changed, 35 insertions, 19 deletions
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 <Binding/Thread.class.h> 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 <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(); } |