summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/foolshell.c')
-rw-r--r--userspace/foolshell.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c
index 77c78dd..36912c8 100644
--- a/userspace/foolshell.c
+++ b/userspace/foolshell.c
@@ -4,8 +4,6 @@
#include "syscalls.c"
#include "../fs/fs.h"
-char **environ;
-
void hello() {
puts(
"Welcome to FoolShell v0.1"
@@ -23,7 +21,7 @@ int main(int argc, char **argv)
hello();
FILE *input;
- input=fopen(1,"r");
+ input=fopen("input.txt","r");
char *buf=malloc(256);
while(1)
@@ -88,7 +86,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]'");
+ 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"))
{
@@ -116,12 +114,12 @@ int process(char *buf)
else if(!strcmp(command,"malloc"))
{
uint8_t *mall=malloc(atoi(token[1]));
- printf("foolshell: allocated %d bytes at 0x%8x (%i).\n",atoi(token[1]),mall,mall);
+ printf("foolshell: allocated %d bytes at 0x%08X (%i).\n",atoi(token[1]),mall,mall);
}
else if(!strcmp(command,"free"))
{
free(atoi(token[1]));
- printf("foolshell: called free(%08x).\n",atoi(token[1]));
+ printf("foolshell: called free(0x%08X).\n",atoi(token[1]));
}
else if(!strcmp(command,"getenv"))
{