| On Linux the main boundary between user space and kernel is quite clear: the system call layer. It is stable and well documented. https://github.com/torvalds/linux/blob/master/Documentation/... System libraries like glibc are not part of the kernel, they are just components that can be replaced. I wrote an article about it: https://www.matheusmoreira.com/articles/linux-system-calls I even asked Greg Kroah-Hartman about it: https://old.reddit.com/r/linux/comments/fx5e4v/im_greg_kroah... > So we rely on different libc projects to provide this, and work with them when needed. > This ends up being more flexible as there are different needs from a libc, and for us to "pick one" wouldn't always be fair. > And yes, you can just use a "nolibc" type implementation of you like. > I know I do that for new syscalls when working on them, there's nothing stopping anyone else from doing that as well. You can trash the entire GNU system and rewrite it all in Rust or Lisp if you wanted. It doesn't have to be some POSIX-like thing either, it could be whatever you wanted it to be. It doesn't need to have things like PATH. You could write a static freestanding application and boot Linux directly into it. Nobody does stuff like this it's a lifetime of work. But it could be done. |
At issue in this article and comment thread is the boundary between the shell, environment, and Linux. This is a blurrier boundary still because the shell sets up the environment, which is passed through the kernel, and interpreted for downstream processes, generally (but not necessarily) by that shared system library.