diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-28 10:26:07 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-28 10:28:21 +0100 |
commit | c76dc9a047c54293f148b3b35c5e538ed2871ed1 (patch) | |
tree | 9e8bd3172f8264999fffb788b8b8dde1d8bcc1b0 /Userland/sh.cpp | |
parent | 0a6a2521e8f32a434dc0bf824c7ad1e2b989088a (diff) | |
download | serenity-c76dc9a047c54293f148b3b35c5e538ed2871ed1.zip |
Add /proc/mm and a /bin/mm utility that just dumps it.
This shows some info about the MM. Right now it's just the zone count
and the number of free physical pages. Lots more can be added.
Also added "exit" to sh so we can nest shells and exit from them.
I also noticed that we were leaking all the physical pages, so fixed that.
Diffstat (limited to 'Userland/sh.cpp')
-rw-r--r-- | Userland/sh.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/sh.cpp b/Userland/sh.cpp index b172f6fa9c..3f503419a6 100644 --- a/Userland/sh.cpp +++ b/Userland/sh.cpp @@ -26,6 +26,13 @@ static int sh_pwd(int, const char**) return 0; } +static int sh_exit(int, const char**) +{ + printf("Good-bye!\n"); + exit(0); + return 0; +} + static int sh_cd(int argc, const char** argv) { if (argc == 1) { @@ -77,6 +84,10 @@ static bool handle_builtin(int argc, const char** argv, int& retval) retval = sh_pwd(argc, argv); return true; } + if (!strcmp(argv[0], "exit")) { + retval = sh_exit(argc, argv); + return true; + } return false; } |