4 ms·
OpenBSD is certainly taking it quite far. They want to disallow system calls from all non-libc code segments so that only whitelisted code can interface with it
by matheusmoreira 3y ago
OpenBSD is certainly taking it quite far. They want to disallow system calls from all non-libc code segments so that only whitelisted code can interface with it.
It is not the only operating system in the "unstable kernel interface" group though. Linux is actually the only one with a stable system call interface.
I've written somewhat at length about this:
https://www.matheusmoreira.com/articles/linux-system-calls https://www.matheusmoreira.com/articles/linux-system-calls
- masklinn 3y agoFWIW your website is unusable on desktop: the font is unreadably huge. And while Firefox's reader mode does seem to mitigate the issue correctly, Safari's cuts off at the second paragraph.
- matheusmoreira 3y agoThank you. I'll try to fix it. I gotta get better at this.
- matheusmoreira 3y agoI reduced the font size to 24px. Does it read better despite the margins? I appreciate the feedback. My intention was to maximize the use of space with big fonts even on the desktop but there's no point if the resulting text is unreadable.
- matheusmoreira 3y agoImproved the look of the site as well while I was at it.
- deleted 3y ago[deleted]
- LegionMammal978 3y ago> It is not the only operating system in the "unstable kernel interface" group though. Linux is actually the only one with a stable system call interface. It's wrong to say that Linux stands alone in having a stable syscall interface. FreeBSD [0] and NetBSD [1] both retain syscall compatibility for old binaries (the former apparently with some exceptions permitted); DragonFly BSD also appears to keep old syscalls in place. In fact, I only know of Windows, OpenBSD, and presumably macOS as mainstream desktop OSes without mostly-stable syscalls. [0] https://wiki.freebsd.org/AddingSyscalls#Backward_compatibily https://wiki.freebsd.org/AddingSyscalls#Backward_compatibily [1] https://www.netbsd.org/docs/internals/en/chap-processes.html#syscall_versioning https://www.netbsd.org/docs/internals/en/chap-processes.html...
- matheusmoreira 3y agoWhen I wrote the article I searched the web for the kernel-userspace ABI situation in the BSDs. I found posts that contradict that. https://forums.freebsd.org/threads/what-is-meant-by-abi.86224/ https://forums.freebsd.org/threads/what-is-meant-by-abi.8622... > I keep reading that the ABI of FreeBSD is constantly changing. > Someone's system has random crashes and someone else says it's that pesky ABI changing again. It seems FreeBSD has a reputation of changing binary interfaces. Even when they clarified that they meant the kernel-userspace interface, it was pointed out they're only stable for current releases. There seems to be some emulation but I can't figure out how hard of a guarantee that is. https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-trouble https://docs.freebsd.org/en/books/handbook/kernelconfig/#ker... > If the kernel version differs from the one that the system utilities have been built with > for example, a kernel built from -CURRENT sources is installed on a -RELEASE system > many system status commands like ps(1) and vmstat(8) will not work. > To fix this, recompile and install a world built with the same version of the source tree as the kernel. > It is never a good idea to use a different version of the kernel than the rest of the operating system. How could the ABI be stable if you have to recompile user space when you update the kernel? Linux is said to be able to run binaries from the 90s. https://old.reddit.com/r/BSD/comments/8vysxg/a_question_about_bsd_kernel_syscallsabi/ https://old.reddit.com/r/BSD/comments/8vysxg/a_question_abou... > FreeBSD breaks syscall ABI compatibility with some regularity. > Like Windows and unlike Linux, the compatibility layer is considered to be libc, rather than the syscall interface.
- KRAKRISMOTT 3y agoWe need more fat kernels and less libcs, libc ties us forcibly to the C legacy. Time for more type safe and richer interfaces with the kernel.
- LanzVonL 3y ago[dead]
- trealira 3y agoWhat do you mean when you say "fat kernel"? Also, FYI, OpenBSD is never going to stop being written in C, and is never going to introduce a language like Rust into the kernel [1], so there's little point in wishing for this. If you wish to rid yourself of legacy of C (and therefore that of Unix), then OpenBSD, which is Unix (or derived from it) and will always be written in C, is not a good operating system for you. Edit: Changed to be less rude; it wasn't my intention to be rude. [1]: https://marc.info/?t=151233221700001&r=1&w=2 https://marc.info/?t=151233221700001&r=1&w=2
- arp242 3y agoI'm not the person you're replying to, but I don't really mind the kernel (or anything else) being written in C as such, but interacting with C from $other_language can be rather painful for various reasons. In Go the reason they do what they do is because integrating it with how the Go scheduler works is tricky, and getting rid of libc makes cross-compilation a lot easier. So in short, it's a pragmatic thing more than anything else. (Aside: that thread is a little bit outdated by the way, as I do believe there's a reasonably complete Rust coreutils implementation now. Not that I think Rust is a good fit for OpenBSD though – I wish people would stop conflating "safety" with "Rust".)
- trealira 3y agoI understand. I don't actually like it, and I wouldn't want Linux to adopt the same practice; exposing raw syscalls in assembly rather than libc functions allows for a more flexible runtime, since C is a lot more limited (although that in itself invites greater security risk). I was saying that because, if you're asking for more type-safe kernel interfaces and frown upon uses of C, then the OpenBSD team seems like the last people you'd want to talk to. They're true Unix believers, love writing C and assembly, and dislike modern programming languages. > Aside: that thread is a little bit outdated by the way, ... Yeah, that thread was more to show that they really dislike the idea of replacing C with memory safe language, and instead say that people who can't program safely in C shouldn't be programming. bytevolcano: > I've always subscribed to the idea that too much safety results in too may idiots, and the same is true for all these "safe" programming languages. "Oh I don't have to write any form of bounds-checking, because the language will do it for me." Nick Holland: > Idiots who shouldn't be coding, coding. "safe" languages being trusted to be safe when in the hands of idiots. Like you said. > The more I see of "safe" languages, the more I love assembly. Most people who call themselves programmers...shouldn't. bytevolcano again (in the context of memory safe languages): > A good programmer won't even need these languages in the first place. Case in point, the entire OpenBSD dev team. :) They'd probably be fine if Go dropped support for OpenBSD altogether; they don't seem to have a high opinion of managed languages or their users.