9 ms·
MINIX from Scratch
- bogomipz 4y agoI was curious about the statement in the README: >"Until now, I have not been able to find a MINIX 3 project that allows you to compile the code that is referenced in the book Operating Systems: Design and Implementation (3e) (v3.1.0)." For such a well-known and longstanding project I was surprised to read this. Are the sources available at https://git.minix3.org https://git.minix3.org just too old or is this more to do with the book?
- funkytrousers 4y agoI tried with a group of friends about 2 years ago, and this rings true with our experience. I think we did eventually get a build working, but there were many build issues, and they were different on different linux distros. Much documentation seemed out of date, especially with respect to the migration to the BSD toolchain (IIRC).
- avinassh 4y agoIf we put this on docker, that would avoid a similar situation in future right
- cxr 4y agoIt doesn't fix the issue of code comments and other documentation being out of date (read: wrong).
- sitzkrieg 4y agoi had similar experience a few years ago, ended up playing with xv6. not the same of course
- bogomipz 4y agoInteresting. I wonder if every university that uses the textbook just maintains it's own repo then?
- TedDoesntTalk 4y agoMy class used the textbook, but we never built minix from scratch or even used it in real-life. Still a lot to be learned that way.
- cxr 4y agoFrom an 8 year old HN comment: > if someone thinks they're going to be able to pick up the latest edition of Operating Systems: Design and Implementation in search of documentation for either MINIX-the-project or MINIX-the-software, they will be sorely disappointed. The fact that the book is now about a decade out of date is one reason for the latter. There are a number of reasons for the former. <https://news.ycombinator.com/item?id=9894961 https://news.ycombinator.com/item?id=9894961>
- maartenh 4y agoWell, Tanenbaum retired in 2014 [1], so the book probably won't get updated anymore. [1] http://www.few.vu.nl/~ast/afscheid/ http://www.few.vu.nl/~ast/afscheid/
- jdc0589 4y agooh man, this was part of my intro to operating systems programming (not that I have a clue what I'm doing) in school 13 years ago. a month or two of "os" work in a simulated kernel on the JVM, and then in the last 3 or 4 weeks the professor hit me with "here's minix, play with some these changes for homework", and then the final exam was "make these changes to the filesystem module". Worst I ever did in a CS class. I did not deserve whatever grade he gave me, but I was the only person that stuck it out and didn't drop the class.
- lloydatkinson 4y agoSometimes the disconnect between what is taught and what is expected by lecturers in assignments is very big, don't feel too bad! It could be because they are coming at it from the "experts bubble" (I'm sure someone will know the proper name) where they can't conceive of the types of problems someone coming at it with no experience will encounter. Going from a tiny "hello world" OS you've made by following instructions and notes to being dropped into a totally different codebase that uses probably entirely different patterns and conventions seems a little unfair. It's like expecting someone who has played around with some graphics API for drawing pixels to expecting them to make changes to the DirectX shader compiler. I had a similar experience - a totally new professor gave us a about 5 lectures on parsers, compilers, AST's, BNF etc, and then just expected us to design a whole language that would be compiled to C for the assignment, using classic tools like yacc etc. For reference, the average programming ability of the students in the class was "What's a switch statement?". Absolutely everybody failed to achieve anything, and the only reason I even passed it was because I took an example language the professor provided and reviewed it and stated how I would liked the language to work instead. It's all a bit absurd.
- kif 4y ago> It could be because they are coming at it from the "experts bubble" I believe you mean the curse of knowledge [0]. [0]: https://en.wikipedia.org/wiki/Curse_of_knowledge https://en.wikipedia.org/wiki/Curse_of_knowledge
- 4y ago
- justin66 4y agoNice. It is a pity that this is necessary, but a quick look at the Minix online presence makes it seem as though it has been largely abandoned. Interesting, since Minix is one of those projects that is really everywhere. Still an important component in lots of firmware.
- wkat4242 4y agoYeah and most notably Intel management engine. If it were GPL they'd have to give back their modifications to the community..
- codetrotter 4y agoIf it were GPL they wouldn’t have used it in the first place for that. And instead they would have based it off of something else, or written it from scratch.
- wrycoder 4y agoWithout MINIX and the GPL, the world might be vastly different: https://news.ycombinator.com/item?id=34917014 https://news.ycombinator.com/item?id=34917014
- justin66 4y agoWe'd have BSD instead of Linux, and all the people who poured their effort into Linux would have poured it into BSD. It would be different, but maybe not vastly different.
- dmazin 4y agoI promise that this is a good-faith question: is MINIX still the best OS teaching tool? Personally, I enjoyed the lectures of https://rust-class.org/ https://rust-class.org/, though the Rust code itself may be a little outdated (it's from 2014).
- Decabytes 4y agoI think that they answer that here^1 But the short answer is the author seems to believe so. 1. https://github.com/o-oconnell/minixfromscratch#why-minix https://github.com/o-oconnell/minixfromscratch#why-minix
- adastra22 4y agoYes. The MINIX book is still the most accessible text, and MINIX is small enough to be comprehended by a student in a semester.
- yjftsjthsd-h 4y agoAny idea how it compares to xv6?
- Koshkin 4y agoxv6 is a toy, compared.
- efficax 4y agothe foundational aspects of actually-used operating systems have been basically the same for 25 years or so. Lots of improvements, sure, but the basic ideas remain the same. MINIX3 is even kind of advanced compared to, say, Linux, since it uses a microkernel architecture. So it's as fine place to start as any.
- wkat4242 4y agoMinix always used a microkernel even in early versions. It was the source of a big flamewar between Linus and Tanenbaum back in the day :) Microkernels are not really modern as such. Just different.
- hungryforcodes 4y agoI don't get it. Tannenbaum would normally keep it in a buildable state -- he's basically the Linus of Minix no? As an aside I enjoy the irony that we are trying to build Minix on Linux systems many years after the debate...
- kybernetikos 4y ago> As an aside I enjoy the irony that we are trying to build Minix on Linux systems many years after the debate... To add another layer - as I understand it, the processors we are mostly running those Linux systems on are secretly running a minix based system for their management functions [1]. [1] https://www.networkworld.com/article/3236064/minix-the-most-popular-os-in-the-world-thanks-to-intel.html https://www.networkworld.com/article/3236064/minix-the-most-...
- atleta 4y agoInteresting. But it seems that MINIX does not run on the (same) processor as we're running Linux on (which would have been pretty surprising) but there is a separate low power CPU on the mother board that runs the management software under MINIX. Reference: https://en.wikipedia.org/wiki/Intel_Management_Engine https://en.wikipedia.org/wiki/Intel_Management_Engine
- kybernetikos 4y agoYes, it looks like I was confusing it with the AMD equivalent, which does have an ARM core literally in the CPU silicon to run the management software (but looks like it doesn't run minix).
- taftster 4y agoThis is a good link, appropriate for the conversation, thank you for providing it! Just to rant about this article though, I really dislike this statement by the author: > Why on this green Earth is there a web server in a hidden part of my CPU? WHY? > The only reason I can think of is if the makers of the CPU wanted a way to serve up content via the internet without you knowing about it. That's absolutely not the use case here. Intel is not on some secret conspiracy to collude with governments to serve content from your computer. The management system is a legitimately useful functionality for the support teams of large corporations, public entities (schools, local government), etc. enabling management of their fleet of user devices. It's a very unforgiving and thankless task to be able to support a worldwide workforce, for example, or large non-computer savvy users. Now, does the Intel Management Engine pose a security risk. Absolutely! We tech folk should absolutely know about this capability and be able to make decisions if this functionality should be enabled for our fleet. Having it default "on" without a way to sensibly turn it off broadly or update it when necessary is a big issue. But this is nothing more than Intel giving the majority of its user base functionality that is desirable, not some deep laden conspiracy. I don't like the Intel Management Engine running on my personal device. But I sure appreciate it for its intended use case and audience.
- hardware2win 4y agoHow about creating an OS from scratch without bias from existing designs?
- layer8 4y agoIt’s difficult to eliminate bias without also eliminating the lessons learned by history.
- pjmlp 4y agoApparently not much was learned in 50 years from doing systems programing in languages like C in regards to safety.
- eggy 4y agoI was a Minix fan before Linux, and Linus studied Minix to write Linux. I thought a microkernel was better than a monolithic kernel for security, reliability, portability, and simplicity reasons. But then again, Betamax was the better videotape format and VHS one out, so the best tech doesn't always win. I remember the heated exchanges between Linus and Andy back in the day. Funny someone commented above about Minix being antiquated from the 80s, and Andy had posted that Linux was technology from the 70s due to it choosing a monolithic kernel and being tied to x86 processors. I had MachTen, a BSD, Unix-like microkernel, running on my PowerMac in the early 90s.
- pjmlp 4y agoIronically, Minix runs Linux on Intel CPUs, and the Linux kernel jungling containers on top of an hypervisor, with DPKG, FUSE,... looks like a fat microkernel. On the cloud workloads, with kubernetes on top of hypervisors, the workload is more akin to microservers than anything else. Likewise on Android, since Project Treble and starting with Android 8, all newer drivers are userspace processes with Android IPC.
- eggy 4y ago
- matesz 4y agoAmazing to see that every file and directory name is short single word with very few exceptions.
- snvzz 4y agoThe one thing MINIX really needs is a maintainer. The 3.3.0-rc8 or whatever version has been sitting there for several years, despite all blockers already fixed. Just because there's nobody at the helm to push the release out. There's also significant unmerged work that's just waiting for someone to merge it.
- roywashere 4y agoI noticed the same. During lockdown I felt bored and thought about porting my fav software to minix only to find out that minix is really dead nowadays
- boricj 4y agoIt's not just the lack of active maintainers. MINIX 3 is a technological dead-end on multiple fronts and the various grants and funding sources have dried up. The micro-kernel is mostly unchanged from its previous incarnations. It can be described as an hollowed-out Unix-like kernel design from the 80's, to the point where a fair number of its syscalls are direct equivalent to Unix ones. Basic features taken for granted nowadays, like 64-bit support, SMP or kernel threads are missing. Its code is especially old and difficult to work with. The driver layer works best with a computer from 20 years ago. There's no support for USB (on x86), NVMe, display controllers, UEFI and so on. I don't think that booting on modern hardware would be even possible at this point without some major overhaul. The service layer is similarly outdated. The most modern filesystem supported is ext2 and it wasn't very stable from what I remember. The native MINIX 3 file-system implementation is solid, but its design is very similar to the System V file system from the early 80's. The most advanced isolation mechanism available is chroot and there's no support for running multiple, isolated userspace instances, which is a shame for a micro-kernel, service-based operating system. Replacing the outdated MINIX userland with a source port of NetBSD's userland a decade ago was a colossal mistake in hindsight. The NetBSD source tree required a lot of modifications to make this work and back-porting newer versions of NetBSD's source tree is extremely difficult. Instead, a NetBSD syscall translation layer to achieve binary compatibility would've probably been a far more maintainable solution. Additionally, pkgsrc support wouldn't be a problem either. Finally, I'm pretty sure no one used it as a daily driver back in the 2010's. While it was reasonably functional through SSH inside a VM, trying to use it on real hardware was an exercise in frustration because of all the sharp edges. Don't get me wrong, MINIX 3 has extremely cool features like the ability to transparently updating system services on-the-fly or extreme resiliency against device driver crashes. The presentation talks done by Andrew Tanenbaum [1] are in my opinion still extremely good to this day and a fair number of the research papers on the MINIX 3 are worth the read. I'm not trying to discourage anyone from trying it out or stepping up as a maintainer, but there's a reason why it became unmaintained. [1] https://www.youtube.com/watch?v=MG29rUtvNXg https://www.youtube.com/watch?v=MG29rUtvNXg (there are multiple versions of it done over the years) Source: I'm a former contributor.
- hulitu 4y ago> MINIX from Scratch Can you install gcc and X ?
- bodyfour 4y agoX: yes, minix has X11R7 binaries: https://wiki.minix3.org/doku.php?id=usersguide:introductiontox https://wiki.minix3.org/doku.php?id=usersguide:introductiont... I don't think I've run an X server on it ever, but I can verify you can at least get it to pop up xterm's on a remote machine. gcc: I don't think any recent gcc's work, but the latest minix (3.4.0rc6) does have clang-3.6 as /usr/bin/cc
- darig 4y ago[dead]
- deleted 4y ago[deleted]
- smasher164 4y agoI think xv6 is a much more palatable intro to operating systems than minux. It's a tiny codebase, with an annotated guide, and a book explaining its core ideas and implementation in a very direct way.
- Koshkin 4y agoI agree, and Minix has been (advertized as) production-quality for a while now.
- rashkov 4y agoI've been going through the xv6 book and source code over the past week, and it has been a delight. It's ready to compile, the source code is very easy to read and very small with the biggest files weighing in at 500 lines. The book is written really well. Just delighted to be learning this material in such a nice way.
- Tepix 4y agoImpossible, it's not even written in Rust! /s
- murdoze 4y agoWell... https://github.com/Ko-oK-OS/xv6-rust https://github.com/Ko-oK-OS/xv6-rust well... https://github.com/Jaic1/xv6-riscv-rust https://github.com/Jaic1/xv6-riscv-rust
- znpy 4y agoIs the book worth reading?
- yazantapuz 4y agoYes. It is a good introduction to some of the basics of OS design and implementation. And imho it is nicely written.
- znpy 4y agoThanks!
- jmorenoamor 4y agoI remember having to rewrite the file blocking primitives to allow blocking only some sections of each file as a class assignment in college. It was fun, and I learned a lot about OSs in that class.
- revskill 4y agoDo we have virtual memory API at the network level ? The goal is i can use Redis as my real memory.
- randombits0 4y agoHow can it be from scratch if you start with MINIX?
- schemescape 4y agoIn case anyone else is interested, I ran across a similar project called Fiwix yesterday, and it compiles and boots: https://www.fiwix.org/ https://www.fiwix.org/ > Fiwix is an operating system kernel written from scratch, based on the UNIX architecture and fully focused on being POSIX compatible. It is designed and developed mainly as a hobby OS and, since it serves also for educational purposes, the kernel code is kept as simple as possible for the benefit of students and OS enthusiasts. It is small in size (less than 50K lines of code), runs on the i386 hardware platform and is compatible with a good base of existing GNU applications.