summaryrefslogtreecommitdiff
path: root/userspace
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-23 20:48:34 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-23 20:48:34 +0100
commit50300fa573bf2bc00f9732e812d54ab77cf03dd7 (patch)
tree7a998723578e601b427e17f9e90e7ce8dbb7c5d2 /userspace
parent61eff36a01a2639efeb515ec32f578ba99d97ff4 (diff)
mostly pr and cosmetics
Diffstat (limited to 'userspace')
-rw-r--r--userspace/Makefile7
-rw-r--r--userspace/clear.c9
-rw-r--r--userspace/shell.c30
-rw-r--r--userspace/smalltest.c4
4 files changed, 41 insertions, 9 deletions
diff --git a/userspace/Makefile b/userspace/Makefile
index d66afd2..55e78bc 100644
--- a/userspace/Makefile
+++ b/userspace/Makefile
@@ -1,7 +1,10 @@
CC=i686-foolos-gcc
-CFLAGS=-w
-PROGS=shell simple brainfuck add checker ls
+CFLAGS=
+CFLAGS+=-w
+CFLAGS+=-std=gnu11
+
+PROGS=shell simple brainfuck add checker ls clear
ext2.img: $(PROGS)
dd if=/dev/zero of=ext2.img bs=512 count=5000
diff --git a/userspace/clear.c b/userspace/clear.c
new file mode 100644
index 0000000..ab0eb51
--- /dev/null
+++ b/userspace/clear.c
@@ -0,0 +1,9 @@
+int main()
+{
+ for(int i=0;i<24;i++)
+ {
+ puts();
+ }
+
+ return 0;
+}
diff --git a/userspace/shell.c b/userspace/shell.c
index 83f1e6f..bb8b873 100644
--- a/userspace/shell.c
+++ b/userspace/shell.c
@@ -1,12 +1,30 @@
#include <stdio.h>
#include <stdint.h>
+#include <stdbool.h>
#include <string.h>
-
+// ascci art: http://patorjk.com/software/taag/#p=testall&f=Cards&t=Fool%20OS
+//
void hello()
{
puts(
- "Welcome to FoolShell v0.1"
+
+ " ______ __ ____ _____\n"
+ " / ____/___ ____ / / / __ \\/ ___/\n"
+ " / /_ / __ \\/ __ \\/ / / / / /\\__ \\ \n"
+ " / __/ / /_/ / /_/ / / / /_/ /___/ / \n"
+ " /_/ \\____/\\____/_/ \\____//____/ \n"
+ "\n"
+
+
+
+
+
+
+ "Welcome to FoolShell v0.2 (Compiled on " __DATE__ " at " __TIME__ "\n"
+ "--------------------------------------------------------------------\n\n"
+ "type 'help' anytime to show shell built-ins\n"
+ "or execute programms/commands that are on your $PATH (e.g. ls)\n"
);
}
@@ -20,7 +38,13 @@ void prompt()
int main(int argc, char **argv)
{
-// hello();
+ bool silent=false;
+ for(int i=0;i<argc;i++)
+ {
+ if(!strcmp(argv[i],"--silent"))silent=true;
+ }
+
+ if(!silent)hello();
char *buf=malloc(256);
diff --git a/userspace/smalltest.c b/userspace/smalltest.c
deleted file mode 100644
index 905869d..0000000
--- a/userspace/smalltest.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main()
-{
- return 0;
-}