feat: add cwd tracking to kernel, remove shell hack, update system utilities to use getcwd, fix tcc libc stub, fix nonexistent directory issue

This commit is contained in:
2026-03-25 15:45:22 +01:00
parent 9c9a0a9712
commit ea087769f5
22 changed files with 389 additions and 265 deletions
+8 -14
View File
@@ -11,22 +11,16 @@ extern "C" void _start() {
char args[256];
montauk::getargs((char *)&args, 256);
if (*args) {
const char* arg = montauk::skip_spaces((const char *)&args);
if (*arg != '\0') {
int fd = montauk::open(arg);
if (fd < 0) {
montauk::print("file not found\n");
} else {
montauk::close(fd);
montauk::fdelete(arg);
}
}
} else {
const char* path = montauk::skip_spaces((const char *)&args);
if (*path == '\0') {
montauk::print("usage: rm [file]\n");
montauk::exit(-1);
}
if (montauk::fdelete(path) < 0) {
montauk::print("rm: failed to remove file\n");
montauk::exit(-1);
}
montauk::exit(0);
}
}