summaryrefslogtreecommitdiff
path: root/src/user
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 13:09:28 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 13:09:28 +0200
commitf56aa2f7e4b8e6430e123f714507032a33955a09 (patch)
tree0381e4cbff6e5e856a3218d811da22fa12c97fcf /src/user
parentf3e03796652b792bb3fd5d3d25b687b9a7f14633 (diff)
downloadTCE-f56aa2f7e4b8e6430e123f714507032a33955a09.tar.gz
TCE-f56aa2f7e4b8e6430e123f714507032a33955a09.zip
The keyboard handling, it's getting better. + Funny screenshot.
Diffstat (limited to 'src/user')
-rw-r--r--src/user/test/main.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/user/test/main.c b/src/user/test/main.c
index a7df667..e7a6b4f 100644
--- a/src/user/test/main.c
+++ b/src/user/test/main.c
@@ -93,9 +93,29 @@ int main() {
close(f);
}
- printk(" -> Now sleeping, forever and ever...\n");
- while(1) {
- thread_sleep(1000);
+ printk(" -> YOUR SHELL IS STARTING UP, SIR.\n");
+ f = open("/.ui/klog", 0);
+ if (f <= 0) {
+ printk(" -> Error #"); printk_int(f); printk(" - too bad. Exiting.\n");
+ } else {
+ char *s = "Hello, writing from your opened file!\n";
+ write(f, 0, strlen(s), s);
+ while (1) {
+ char *s = " > ";
+ write(f, 0, strlen(s), s);
+
+ char buffer[256];
+ int l = read(f, 0, 255, buffer);
+ buffer[l] = 0;
+ if (buffer[l-1] == '\n') {
+ char *s = "You said: ";
+ write(f, 0, strlen(s), s);
+ write(f, 0, l, buffer);
+ } else {
+ char *s = "oops\n";
+ write(f, 0, strlen(s), s);
+ }
+ }
}
return 0;