From 98eb242e282650e9c6645dd2e5290e144b105bb4 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Sat, 23 May 2015 23:44:44 +0200 Subject: improved params and environment passing and started snake-game :) --- userspace/Makefile | 3 ++- userspace/foolshell.c | 21 +++++++++++++-------- userspace/init.c | 2 +- userspace/snake.c | 11 +++++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 userspace/snake.c (limited to 'userspace') diff --git a/userspace/Makefile b/userspace/Makefile index 48d9b1f..801326b 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -13,7 +13,7 @@ LDFLAGS=-lfool #CFLAGS+=$(SYSROOT)/usr/lib/crt0.o -PROGS=foolshell ls simple brainfuck add checker clear task1 task2 init cat +PROGS=foolshell ls simple brainfuck add checker clear task1 task2 init cat snake include ../Makefile.common @@ -40,6 +40,7 @@ ext2.img: $(PROGS) ../mp/mp.bin rm mnt -rf brainfuck: brainfuck.o +snake: snake.o foolshell: foolshell.o simple: simple.o add: add.o diff --git a/userspace/foolshell.c b/userspace/foolshell.c index 2abb549..0ec7e88 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -4,6 +4,7 @@ #include extern char **environ; + // void hello() { @@ -13,7 +14,7 @@ void hello() puts( "\033c" - "\033[37;44m" + "\033[36m" " ______ __ ____ _____ \n" " / ____/___ ____ / / / __ \\/ ___/ \n" @@ -21,10 +22,11 @@ void hello() " / __/ / /_/ / /_/ / / / /_/ /___/ / \n" " /_/ \\____/\\____/_/ \\____//____/ \n" " \n" - "\033[37;43m" + + "\033[37;44m" " \n" - " Welcome to FoolShell v0.7 (Compiled on " __DATE__ " at " __TIME__ "\n" + " Welcome to FoolShell v0.8 (Compiled on " __DATE__ " at " __TIME__")\n" " ------------------------------------------------------------------\n\n" " Please type 'help' anytime, to show shell \"built-ins\". You can execute \n" " user programms that are in your $PATH directory by simply typing \n" @@ -41,15 +43,20 @@ void hello() void prompt() { - printf("%s%s",getenv("PWD"),getenv("PS1")); + printf("\033[36mfool\033[37m@\033[32mhill\033[33m:%s%s\033[37m",getenv("PWD"),getenv("PS1")); } + int main(int argc, char **argv) { - +/* + printf("argv= 0x%08x \n",argv); + printf("environ= 0x%08x \n",environ); +*/ bool silent=false; for(int i=0;i + +int main() +{ + printf("Hello I am FoolSnake 0.1\n"); + + while(1) + { + printf("%c",getc(stdin)); + } +} -- cgit v1.2.3