From a1a4ab33cd75f0bc1d5e71989b01ba3446c998ae Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 6 Jan 2023 21:11:44 +0100 Subject: kernel: basic procfs --- src/user/app/shell/shell.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/user/app/shell') 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) -- cgit v1.2.3