Added ability to load an arbitrary binary from an ethernet server and launch it
[akaros.git] / user / apps / parlib / matrix.c
1 #include <stdlib.h>
2 #include <string.h>
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <arch/types.h>
6
7 extern char * readline(const char *prompt);
8 extern void draw_nanwan();
9 extern void clrscrn(int leaverows);
10 extern void change_user();
11 extern void set_default_user();
12 extern void file_io();
13 extern void file_error();
14 extern void run_binary();
15 extern char prompt[256];
16
17 void help() {
18         printf("Possible commands to run:\n"
19                "  draw_nanwan:      Draw a picture of Nanwan, our mascot giraffe\n"
20                "  clear_screen:     Clear the Screen\n"
21                "  change_user:      Change Username\n"
22            "  file_io:          Run File Related IO Tests\n"
23            "  file_error:       Run File Error Related Tests\n"
24            "  run_binary:       Load and run a binary located on the remote server\n"
25               );
26 }
27
28 int main(int argc, char** argv)
29 {       
30         set_default_user();
31         printf("Welcome to the Tessellation OS newlib test suite!\n");
32         printf("Enter at you're own risk....\n");
33         clrscrn(2);
34         while(1) {
35                 char* s = readline(prompt);
36
37                 if (s == NULL)
38                         continue;
39
40                 if(strcmp(s, "draw_nanwan") == 0)
41                         draw_nanwan();          
42                 else if(strcmp(s, "clear_screen") == 0)
43                         clrscrn(0);             
44                 else if (strcmp(s, "change_user") == 0)
45                         change_user();
46                 else if (strcmp(s, "file_io") == 0)
47                         file_io();
48                 else if (strcmp(s, "file_error") == 0)
49                         file_error();
50                 else if (strcmp(s, "run_binary") == 0)
51                         run_binary();
52                 else
53                         help(); 
54
55         }       
56         return 0;
57 }