Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Linux is the operating system. It manages hardware and provides system calls. It's possible to write software that Linux boots directly into, no user space at all.

This GNU/Linux stuff comes from POSIX's definition of operating system. That piece of paper says operating systems have all these little commands like cp, mv, etc. Therefore, GNU gets to be part of the operating system because it provides those commands. It doesn't have to be this way though, especially on Linux where one can just trash all the GNU stuff and obtain or write custom software directly on top of the kernel.



> This GNU/Linux stuff comes from POSIX's definition of operating system

Technically true. But do you run a lot of software that works without glibc and other userland utilities?

> on Linux where one can just trash all the GNU stuff and obtain or write custom software directly on top of the kernel

True, yet most of us still use a GNU/Linux distribution.


> But do you run a lot of software that works without glibc and other userland utilities?

Yes. I made a few of these utilities for my own use. I actually started developing a Linux system call library to facillitate this but then I discovered the kernel developers themselves already made one for their own tools.

https://github.com/torvalds/linux/blob/master/tools/include/...

People can include this awesome header file in a freestanding C project and enjoy making 100% dependency-free Linux binaries. No C standard library cruft anywhere. It's amazing. You could boot Linux directly into one of these things just by writing init=/my/program in the kernel command line. You'd need to do some init stuff like mounting procfs and sysfs but it's totally fine. I've even seen graphical software running this way with OpenGL ES on top of kernel interfaces for mode setting and buffer management, people could even make video games that run this way. I really want to get into this.


> https://github.com/torvalds/linux/blob/master/tools/include/...

Cool, thanks for sharing!

> I really want to get into this.

Hope to see more links on that topic popping up on HN. Are you aware, beyond "raw" OpenGL, of any GUI/TUI frameworks for Go/Rust that would work this way?


> Are you aware, beyond "raw" OpenGL, of any GUI/TUI frameworks for Go/Rust that would work this way?

I'd like to know as well. My most recent discovery was RetroArch, a really good frontend for many emulators. It's not freestanding but it does support OpenGL graphics with Linux kernel mode setting and generic buffer management.

https://www.retroarch.net/2020/01/linux-kms-mode.html


>But do you run a lot of software that works without glibc and other userland utilities

More and more as time goes on. Most applications written in Go do not require libc. Some of my servers have nothing on them but a few Go applications, like influxdb + prometheus + grafana. Theoretically you can strip out everything but the kernel (and replace systemd with something extremely lightweight, maybe also written in Go), but mainstream distributions don't make this easy, and what's the point anyway.


Just don't forget that it goes both ways. GNU today's is much more relevant than GNU 30 years ago thanks to the Linux community.

Would not surprise me if 80% of recent GNU contributions come from the Linux crowd.


    FROM alpine:latest


If we're doing this, Linux is the kernel and it's possible to have a GNU system without the Linux kernel.

Debian GNU/kFreeBSD, the Hurd, and even Windows with a GNU userspace (such as Cygwin) all exist.


If we go down this route, we might as well name everything installed in user space. I'm running an i3/GNU/systemd/custom Linux system on my laptop. When do we stop?

Sure, it's totally possible to install GNU software on other operating systems. You can install it on Linux, the BSDs, even Windows. They're just regular programs.


I believe "Debian GNOME", "Manjaro KDE", or "guix sway" are very valid answers to "what system are you running?", don't you? I wouldn't list all userspace components for sure, but some can be relevant to include.

"GNU/Linux" is a relevant label to me so i know we're talking about a system which has common POSIX-inspired utilities... "Linux" can be Android for all i know, which is a very different system.


I agree. It makes complete sense to mention the distribution you're using. Saying you use Debian is much better than saying GNU/Linux. People understand perfectly what sort of software Debian distributes, there is no need to mention anything else.

Mentioning that I use Arch Linux annoys people for some reason so I stopped doing that. I just say I use Linux.


I think we agree more than we disagree.

I was pointing out that most definitions of operating system I've seen say it's a kernel plus a userspace, and that Linux, the kernel, is a replaceable component.



I know about that page. They too think it's absurd to name every user space software when referring to the system. This is where I disagree:

> The principal developer is the GNU Project, and the system is basically GNU.

I think the system is basically Linux.



I know about that page. I've read it. I just don't agree with it. Just because it's written in a FAQ doesn't mean it automatically refutes arguments when cited. It just represents GNU's opinon on the matter, an opinion I don't agree with.

The percentage of Linux's contribution doesn't really matter. Operating systems manage hardware and support the execution of programs. That's what Linux does. To me, most of GNU is just wrappers around Linux system calls plus some additional logic. The most significant GNU program being GCC of course.

I think this way because I'm a programmer who likes working with small Linux systems. GNU takes the perspective of a user of POSIX-like systems.


> The percentage of Linux's contribution doesn't really matter.

I think all useful code should matter, not just that which you like more. GNU "wrappers" are used by people a lot, and to most people Linux would be totally useless without them.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: