From 61eff36a01a2639efeb515ec32f578ba99d97ff4 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Sun, 23 Nov 2014 19:53:48 +0100 Subject: moved ls to own binary --- userspace/shell.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'userspace/shell.c') diff --git a/userspace/shell.c b/userspace/shell.c index 06a03d2..83f1e6f 100644 --- a/userspace/shell.c +++ b/userspace/shell.c @@ -2,15 +2,16 @@ #include #include -#include "../fs/fs.h" -void hello() { +void hello() +{ puts( "Welcome to FoolShell v0.1" ); } -void prompt() { +void prompt() +{ printf( "$ " ); @@ -87,20 +88,7 @@ int process(char *buf) if(!strcmp(command,"help")) { - puts("foolshell: supported built-in commands: 'help', 'echo [string]', 'ls [inode_nr]', exec [inode_nr],'malloc [bytes]', 'free [address]', 'getenv [var]', 'putenv [var] [val]'"); - } - else if(!strcmp(command,"ls")) - { - fs_dirent *dirs=malloc(sizeof(fs_dirent)*25); - - int ls=readdir(atoi(token[1]),dirs,25); - - int i; - for(i=0;i