basic led gpio driver
[cortex-from-scratch] / term.c
1 #include <stdbool.h>
2 #include <stddef.h>
3 #include <stdint.h>
4
5 #include <sys/robsys.h>
6 #include <sys/mmap.h>
7
8 #include <lib/stdio.h>
9
10 #define SERIAL 1
11 #define BUFSIZE 200
12
13
14 int help(int, char**);
15
16 /* 
17  * Built in commands
18  *      info -- shows basic info of system
19  *      reset -- software reset
20  *      show [ADDRESS-ADDRESS] -- shows SRAM range
21  *      switchmode -- switch to unprivileged mode
22  * */
23
24 static char buf[BUFSIZE];
25
26
27 struct cmd {
28         char * name;
29         char * description;
30         int (*function)(int argc, char ** argsv);
31 };
32
33 static struct cmd builtin[] = 
34         { "info", "show info", help};
35
36 int help(int argc, char ** argsv) {
37         sysinfo();
38         return 0;
39 }
40
41 void terminal() {
42  
43         char *buf;
44         cputs("Terminal running!\n");
45  
46          while (1) {
47                  buf = readline("root# ");
48                  /* if (buf != NULL)
49                          if (runcmd(buf, tf) < 0)
50                                  break; */
51          }
52 }