diff options
author | dzwdz | 2023-01-06 21:11:44 +0100 |
---|---|---|
committer | dzwdz | 2023-01-06 21:11:44 +0100 |
commit | a1a4ab33cd75f0bc1d5e71989b01ba3446c998ae (patch) | |
tree | 4796f9ffc780dcb0336ed7c66c0cb42584320d61 /src/user/app | |
parent | e0c7bad47a54d865ef6194643e2cd20f6094e507 (diff) |
kernel: basic procfs
Diffstat (limited to 'src/user/app')
-rw-r--r-- | src/user/app/shell/shell.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c index 8aa640b..3dad1bd 100644 --- a/src/user/app/shell/shell.c +++ b/src/user/app/shell/shell.c @@ -52,6 +52,16 @@ void run_args(int argc, char **argv, struct redir *redir) { } else { _syscall_mount(HANDLE_NULLFS, argv[1], strlen(argv[1])); } + } else if (!strcmp(argv[0], "procmnt")) { + if (argc < 2) { + fprintf(stderr, "procmnt: missing mountpoint\n"); + return; + } + _syscall_mount(HANDLE_PROCFS, argv[1], strlen(argv[1])); + if (!fork2_n_mount("/")) { + fs_dir_inject(argv[1]); + exit(1); + } return; } else if (!strcmp(argv[0], "cd")) { if (chdir(argc > 1 ? argv[1] : "/") < 0) |