summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
blob: bc0210261fb45f77925a29e9b9d41973afc50d81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <stdio.h>
#include "syscalls.c"

void hello() {
    puts(
        "Welcome to FoolShell v0.1"
    );
}

void prompt() {
    printf(
        "$ "
    );
}
int main(int argc, char **argv) 
{
    syscalls_init();
    hello();

    FILE *input;
    input=fopen(1,"r");
    char *buf=malloc(256);

    while(1)
    {
	prompt();
        fgets(buf,255,input);
	buf[strlen(buf)-1]=0;
	puts(buf);
    }


    return 0;
}