diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-26 23:17:55 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-26 23:17:55 +0100 |
| commit | 7393db6692c861bc66164c0dd9b83f23a554775b (patch) | |
| tree | d60c9deb33630d5fb6117c7c1bbc098e62a66f28 /userspace/foolshell.c | |
| parent | 9c8cfc2e52b0446f7cab14325028075760869b45 (diff) | |
changes, improvements and cleanup
Diffstat (limited to 'userspace/foolshell.c')
| -rw-r--r-- | userspace/foolshell.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c index faa46be..e010c18 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -16,11 +16,12 @@ void hello() " / __/ / /_/ / /_/ / / / /_/ /___/ / \n" " /_/ \\____/\\____/_/ \\____//____/ \n" " \n" - "Welcome to FoolShell v0.3 (Compiled on " __DATE__ " at " __TIME__ "\n" + "Welcome to FoolShell v0.4 (Compiled on " __DATE__ " at " __TIME__ "\n" "------------------------------------------------------------------\n\n" "Please type 'help' anytime, to show shell \"built-ins\" or execute \n" "user programms that are in you $PATH directory by simply typing \n" - "their filenames.\n" + "their filenames. You can get additional information for many commands\n" + "by invking them with the --help or -h flag (e.g. ls --help) \n" ); printf("Your $PATH is currently set to: %s\n\n",getenv("PATH")); @@ -210,13 +211,23 @@ int process(char *buf) } else { - execve(token[0],token,0); char buf[256]; - sprintf(buf,"/bin/%s",token[0]); + sprintf(buf,"%s/%s",getenv("PATH"),token[0]); + asm("mov $0x05bff,%esp"); // set stack pointer execve(buf,token,environ); + asm("mov $0x07000,%esp"); // set stack pointer + puts("foolshell: command not found"); + + asm("mov $0x05bff,%esp"); // set stack pointer + static char *argv[]={"shell","--silent",NULL}; + execve("/bin/foolshell",argv,environ); // start shell + + + } + return 0; } |
