4 ms·
Making NetBSD Multiboot-Compatible (2007)
- RuggedPineapple 3y agoI feel bad because NetBSD is a stable, mature and well supported OS with a multitude of positives. Do I associate it with any of those things? Absolutely not. The sole thing that NetBSD sticks in my head for is its what you use when you want to port unix to something that has absolutely no business running unix.
- rjsw 3y agoNetBSD doesn't have any support for running without a MMU, so by definition you can only port it to things designed to be able to run UNIX.
- jmmv 3y agoDidn’t Minix support running without a MMU? And there seems to be an option to disable MMU support in Linux too. Obviously you lose on memory protection… but does that make these setups “not Unix”?
- rollcat 3y agoMMU is also responsible for translating between physical and virtual memory addresses. Making virtual memory support optional is a non-trivial design goal; you're not only allowing userspace to peek at (or straight up overwrite) kernel memory, you also need every executable to be a PIE, or to swap it out to disk as a part of a context switch. Check out RetroBSD <https://github.com/RetroBSD/retrobsd https://github.com/RetroBSD/retrobsd> and LiteBSD <https://github.com/sergev/LiteBSD https://github.com/sergev/LiteBSD>; there's a PID 0 (or 1? IIRC) that is called the "swapper" process, which is in charge of implementing the context switching. Fascinating stuff!
- jmmv 3y agoYes, of course, the MMU also does that. But I'm not sure what that has to do with Unix systems requiring an MMU _by definition_ as the post I was replying to claimed. Obviously running a Unix-like system without an MMU will lack certain functionality, but it could feel very much like "a real Unix".
- rollcat 3y agoI agree. My comment was meant to supplement and support yours.
- numpad0 3y agoTIL there was a version of UNIX for PDP-7, and PDP-7 did not have MMU, therefore UNIX by definition do not require MMU, and that version of UNIX had been archeologied in a runnable form on GitHub[1] 1: https://github.com/DoctorWkt/pdp7-unix https://github.com/DoctorWkt/pdp7-unix
- RuggedPineapple 3y agoHave you looked through it's supported platforms list? There's current support for a handheld PDA from 1997, and several flavors of 16 bit Motorola 68k based system. Systems that haven't had an official Unix port in 30+ years if at all, have modern, supported releases from NetBSD.
- rjsw 3y agoI am a NetBSD developer, I know exactly what it runs on. The 68k systems are all 32 bit, the supported PDAs can run Linux as well.
- RuggedPineapple 3y agoYou're not even a little bit tickled that NetBSD runs and supports the VAX, a computer released in the 70s? Get excited about your project, man. I'm sure you're a fantastic developer, but you're an absolutely terrible evangelist.
- liveoneggs 3y agoThat is how NetBSD is and always has been.
- rollcat 3y agoEh RIP OpenBSD/VAX. I do wonder if NetBSD/VAX actually boots on real hardware. The reason why these machines are/were supported for this long is because of how different they are (keeping your software portable is a good way of ensuring high quality/correctness); but they also suck power like mad, and do eventually just die.
- matrix12 3y agoNetBSD devs are like ants in a colony without a queen. As a former dev, I can attest to this.
- jmmv 3y agoHey folks. The excellent "FreeBSD on Firecraker" post from yesterday (https://news.ycombinator.com/item?id=37253035 https://news.ycombinator.com/item?id=37253035) made me remember the pain I went through many years ago to make NetBSD Multiboot-compliant (aka bootable natively via GRUB), so I dug this post of mine from the archives. I did not have to play the "hlt" trick that Colin describes--it wouldn't have made sense in my context anyway--but I did play have to play other tricks to debug issues. If I remember correctly, poking directly into video memory to draw a single character on the top-left corner of the screen was one of them. In any case, it was a fun experience!
- deleted 3y ago[deleted]
- rjsw 3y agoDoing the reverse, getting the native NetBSD bootloader to load a multiboot kernel, wasn't particularly hard, it worked first time.
- snvzz 3y agoSomeday, Linux will too be compatible.
- yjftsjthsd-h 3y agoActually, that's an interesting questions - last I recall, Linux didn't use the multiboot specification, and mostly got away with it by being so popular that everything just also supports it directly? If that's true, then it would be interesting to see what it took to make it compatible.
- iJohnDoe 3y agoLove NetBSD. It’s how I learned UNIX and Linux. Owe a lot to the OS. Got NetBSD running on old SPARCs and old Mac PPC systems. Used them as servers. Lots of knowledge gained. Unfortunately, when I would want to try out cool new software or utilities, they were only for Linux. It forced me to embrace Linux and have used CentOS ever since. My knowledge and experience of iptables has also made me commit to Linux.
- 1vuio0pswjnm7 3y agoIt's been a while but many years ago I was able to boot NetBSD kernels using the FreeBSD bootloader. The goal at the time was having both NetBSD and FreeBSD kernels on bootable USB stick, without GRUB.