21 ms·
Redox: Unix-Like Operating System in Rust
- brundolf 6y agoI wish they had more details up-front. Is this totally from scratch, or is it a piecemeal-replacement of some other Unix-like OS? Does it lean on any non-Rust components at all? If it's 100% bootstrapped from scratch and they already have a GUI like in the screenshot, that's extremely impressive and exciting. Edit: There are more details in the Book https://doc.redox-os.org/book/ch01-02-what-is-redox.html https://doc.redox-os.org/book/ch01-02-what-is-redox.html
- tormeh 6y agoYeah, Redox is a completely new, from scratch, OS written in Rust. Ironically, even the libc is written in Rust. It (occasionally) runs on real hardware, and I believe they're pretty close to bootstrapping, although lack of a browser is a rather big obstacle
- jarym 6y agoImpressive! World is about to find out how many bugs Rust will prevent from arising vs those OS writing in something else
- diydsp 6y agoRust is not supernatural. It addresses limited classes of bugs. Techniques to mitigate bugs in other languages have been developing rapidly. Bugs are not the only determinant of success.
- brundolf 6y agoDidn't realize it doesn't really run on hardware yet. Still impressive, though Will they refuse to ship any userland code that isn't written in Rust (a browser, for example)? Writing a whole new browser from scratch in Rust would be almost as big a task as the OS itself. Practically speaking, it could make more sense to port an existing one over to their (already POSIX-compatible) environment.
- Ericson2314 6y agoNo see my other comment https://news.ycombinator.com/item?id=24448512 https://news.ycombinator.com/item?id=24448512 . Not only do they support Unix interfaces, but you can even use a non-Redox-specicific package set with just a few tweaks.
- SAI_Peregrinus 6y agoIt does run on real hardware, it's just very limited. Graphics card support is quite basic, it can't boot from a disk with a partition table (so the current ISO image uses a bootloader to load the filesystem into memory and emulates one), only the rtl8168d and e1000d Ethernet controllers are supported, and there's no USB HID or mass storage support so you need a PS/2 mouse & keyboard.
- mark_l_watson 6y agoDoes it run on VirtualBox? That would be the way I would kick the tires, see what it is like.
- SAI_Peregrinus 6y agoHaven't tried it, but probably. I know it can run in qemu.
- kruxigt 6y agoTalking about ironic, Rust is often mentioned as the language Mozilla invented to write exactly that - a browser..
- brundolf 6y agoSure, but it's a ton of work either way and probably outside the scope of what this project wants to tackle
- vbezhenar 6y agoIt is ironic, that writing OS is easier than writing a browser.
- mkl 6y agoThat hardly seems ironic. Operating systems have been around for several decades longer than web browsers, and many are orders of magnitude simpler.
- ithkuil 6y agoIndeed you could write an order of magnitude simpler browser, and also write the web pages it could render. Probably most people wouldn't bother using it since they want to read some other, legacy web pages (you know, to pay their bills, shop online, check the weather forecast, book their flights). The analogy with operating systems is not silly, actually. Operating systems have indeed benefited/suffered from the network effect caused by "content" (programs). OSs were indeed becoming also feature-rich bahemoats that are hard to recreate faithfully enough in order to run that legacy stuff.
- Matthias247 6y agoOperating system is imho a rather wide term. There is not that much to a simple operating system. They are mostly a scheduler. Manage some tasks, have the ability to switch between them - that's it. Things like FreeRTOS are not a lot more. However when people refer to Windows or macOS as OS, they also include the whole collection of standard software as part of the OS. Control panels, browsers, GUI frameworks, etc. At that point it probably includes a browser
- GordonS 6y ago> However when people refer to Windows or macOS as OS, they also include the whole collection of standard software as part of the OS. Control panels, browsers, GUI frameworks, etc I'd add hardware drivers to that list too. Many are of course written by 3rd parties, but to the average consumer they are "part of the OS".
- 6y ago
- p1necone 6y ago"the libc is written in Rust" This is cool, are there any downsides to calling Rust code from C? I guess it's basically a black box that behaves like a regular C library from the outside?
- davidhyde 6y agoNo downsides except that the public rust function needs to be decorated with the #[no_mangle] attribute for it to be consumed by a c or c++ codebase.
- _-___________-_ 6y agoIt is a regular .so (what I assume you mean by "C library"), not a "black box that looks like a regular .so". There's no runtime wrapped around your code like with Go etc. You just need to add an attribute to tell the compiler not to mangle your names, similar to what's needed for C++ / C interop.
- vlovich123 6y agoIIRC they're syscall implementation is ABI compatible with Linux so you should be able to run unmodified Linux binaries (assuming the syscall itself is implemented).
- brundolf 6y agoVery cool
- cfcosta 6y agoIs this a recent development? As far as I know they don't even support full POSIX. Simpler software can be ported by recompiling, yes, but I don't think they support Linux binaries, at least not yet.
- vlovich123 6y agoI haven't read anything from the project on the actual status of it. Just following news reports. https://www.theregister.com/2019/11/29/after_four_years_rusty_os_nearly_selfhosting/ https://www.theregister.com/2019/11/29/after_four_years_rust... https://linux.slashdot.org/story/19/11/30/2011231/rust-based-redox-os-is-nearly-self-hosting-after-four-years https://linux.slashdot.org/story/19/11/30/2011231/rust-based... https://doc.redox-os.org/book/ch01-06-how-redox-compares.html https://doc.redox-os.org/book/ch01-06-how-redox-compares.htm... says they support the 31 most common syscalls (however that's defined).
- cfcosta 6y agoOh, they mean POSIX on it. Not binary compatibility.
- vlovich123 6y agoNo, they are talking specifically about the syscall being API and ABI compatible. That means binary compatible by definition.
- dang 6y agoIf curious see also 2019 https://news.ycombinator.com/item?id=19478720 https://news.ycombinator.com/item?id=19478720 2018 https://news.ycombinator.com/item?id=18442390 https://news.ycombinator.com/item?id=18442390 2018 https://news.ycombinator.com/item?id=16198342 https://news.ycombinator.com/item?id=16198342 2017 https://news.ycombinator.com/item?id=15290607 https://news.ycombinator.com/item?id=15290607 2016 https://news.ycombinator.com/item?id=11318004 https://news.ycombinator.com/item?id=11318004 2016 https://news.ycombinator.com/item?id=12844539 https://news.ycombinator.com/item?id=12844539 2015 https://news.ycombinator.com/item?id=10295187 https://news.ycombinator.com/item?id=10295187
- Ericson2314 6y agoNixpkgs supports Redox a bit! https://www.redox-os.org/news/redox-plus-nix-0/ https://www.redox-os.org/news/redox-plus-nix-0/ I'm excited about Redox in particular, because of the lack of C. But more broadly, I hope Nixpkgs (and eventually NixOS) can be a good way to promote kernel diversity. Every kernel having it's own distro is a huge waste, and I think the Nix in particular supports really good integration so the whole BSD "we're tighter-knit than a distro, don't call us that" argument shouldn't justify the duplicated effort.
- ori_b 6y ago> I think the Nix in particular supports really good integration so the whole BSD "we're tighter-knit than a distro, don't call us that" argument shouldn't justify the duplicated effort. That's an inaccurate representation: The difference is that BSD evolves the whole system in lockstep, userspace and kernel at the same time. When userspace wants new capabilities like pledge(2), then the kernel is updated to expose it. When the kernel adds new features like routing domains, then userspace is updated to use it. There's no coordination across a bunch of different projects: The same commit just changes things, across all the bits at once. Nix doesn't offer that.
- Ericson2314 6y agoNothing you said Nix precludes. If I were to make a Nixified BSD, there's no requirement that I have to split things into multiple repos. I can continue to use a monorepo for the core userland and kernel. If I want to add a feature to a widely used package, I can still vendor the package like BSD, or I can bump the kernel and package srcs in one commit, adding the feature in both, like Nixpkgs today. In no way am I now at the mercy of coordinating upstream devs---Nix allows any user to integrate anything they want, unilaterally, whether a monorepo is used ot not. The benefit of Nixpkgs is not to replace the core of BSD, but to replace ports. Nobody, least of all the BSDs, has the time to bespoke integrate every single package. There is always a long tail of stuff that is budgeted minimally----this isn't Linux distro ideology, put simple economics. Nixpkgs allows multiple disparate groups to better cooperate on that long tail.
- jackpot51 6y agoI'm Jeremy Soller, the creator of Redox OS. Let me know if you have questions!
- Shared404 6y agoIs Redox something that might be a viable daily driver at some point? I've been watching for a little while, and hope it gets there. Also, in what way's does the project need help? Edit: FWIW, I think this or something similar to it is the future of OS development.
- jackpot51 6y agoAt some point? Maybe. It would be in quite a long time. Right now writing drivers, porting software, and improving documentation are areas to help.
- Shared404 6y ago> At some point? Maybe. It would be in quite a long time. I'll look forward to it. > Right now writing drivers, porting software, and improving documentation are areas to help. I'll take a look and see what I can help with.
- ianai 6y agoHow mature are the network stack and FS? I see a ZFS inspired FS named TFS, very cool! I’m assuming it can run headless but see it’s got a GUI from the book.
- higerordermap 6y ago> FWIW, I think this or something similar to it is the future of OS development. Disagree. It is mostly a Unix clone in rust with few novel concepts. Not that it is not important, and no offense meant to developers.
- brylie 6y agoBut why do you disagree? What does your comment bring to the discussion? Edit: removed italics tag.
- darksaints 6y agoCan anybody here do a qualitative comparison of the redox kernel and L4 (particularly SeL4)? I'd love to see how well some of the modern microkernels perform, but I think more importantly, how do they differ and what capabilities should we care about? As a side question, how does kernel bypass networking work with a microkernel?
- jclulow 6y agoBypass networking is generally more akin to how device drivers in microkernels work: a core trusted set of functionality that needs to be in the kernel is (e.g., programming the MMU or I/O MMU, scheduling) and all the device control and network stack stuff is in some process or task outside.
- sntran 6y agoI have been curious about OS, particularly how a process for a command is handled through it's life cycle, and also things like how redirection works (for things like named pipes). Is there some resources on that topic? Searching for how OS works is very vague or too details in other aspects.
- halayli 6y agoYou'll find all the answers in the book 'Advanced Programming in the UNIX environment' by Richard Stevens. It's also referred to by the acronym APUE.
- higerordermap 6y ago> particularly how a process for a command is handled through it's life cycle fork(), execve(), waitpid() and friends > also things like how redirection works dup() ing file descriptors. dup2 is atomic alternative to separately closing a file descriptor and dup'ing to it. xv6 book is freely available on MIT website - it teaches implementation of toy Unix like operating system.. as another commenter mentioned APUE is pretty popular too.
- lex0r 6y agoI really liked the Book „Three Easy Pieces“. You can read it online for free and it gives you a good mental model of how stuff works!
- sntran 6y agoThanks y'all! I have enough material to read through!
- ezluckyfree 6y agoI support them on patreon because I'm a terrible low level programmer but I think OS diversity is a good thing!
- jackpot51 6y agoThank you!
- cultofmetatron 6y agoDidn't know there was a patreon. Just signed up myself because I love the project and I don't know enough systems dev to contribute code yet. Hoping I'll be able to run redox-os as my daily driver in a few years.
- seisvelas 6y agoI apologize in advance for such a brazenly ignorant question: But why is it that this small team is able to produce a working microkernel, yet GNU Herd and (more recently) Google's Fuchsia have languished eternally as vaporware?
- pitterpatter 6y agoWhat makes you think Fuchsia is vaporware? It's not general purpose but google is definitely shipping/going to be shipping devices with it.
- untog 6y agoIn fairness the project has been going since 2015. Don’t know about Herd but Fuchsia is a lot more than a microkernel, right?
- seisvelas 6y agoFair points! But, >the project has been going since 2015 True, but Fuchsia started only a year later >Fuchsia is a lot more than a microkernel, right? Indeed, but that is also true of Redox!
- deleted 6y ago[deleted]
- cfcosta 6y agoI don't think fuschia is vaporware. But I think the reason this seems more advanced than Hurd even being a lot younger is (also) because the concepts regarding microkernels have been expanded and solidified a lot since it started.
- gravypod 6y agoThe manager asks the developer "how long is this project going to take you?" and the developer replies "2 weeks." The manager yells "That's unacceptable! How long will it take you if I give you another engineer?" to which the developer says "4 weeks." The manager asks again "Fine, take as many resources as you need. How long if I give you 100 engineers." to which the developer replies "it'll only take us 30 years to finish the design and after that it'll pretty much be smooth sailing!" jackpot51 describes himself in his bio as a "BDFL of Redox OS" which means he's likely personally passionate and just does what he thinks is best. This will likely not lead to a better outcome than Herd and Fuchsia would lead to but it will lead to an outcome within our lifetimes. In many cases, however, "working" is better than "planned"
- snvzz 6y ago>microkernel design >unix-like You can't have your cake and eat it too. "With POSIX compatibility" would have been a better description.
- meddlepal 6y agoWait what? Minix and macOS via Mach are both microkernel designs. Minix is Unix-like but macOS is Unix. Im not following your contention.
- zokula 6y agoThe XNU kernel in macOS is not a microkernel.
- pjmlp 6y agoIt follow a mikro kernel like design though. And when Apple is finished with moving all kernel extensions to userspace, it might as well be considered as such. By the way the extensions that were deprecated in Catalina, are now removed in Big Sur, as promised by 2019 roadmap. So eventually, all extensions will be gone from the kernel.
- fortran77 6y agoWindows NT is much more of a Microkernel than MacOS is https://en.wikipedia.org/wiki/Hybrid_kernel#:~:text=The%20Windows%20NT%20design%20includes,first%2Dlevel%20interrupt%20handling%2C%20thread https://en.wikipedia.org/wiki/Hybrid_kernel#:~:text=The%20Wi...
- monocasa 6y agoMinix, mkLinux, tru64 and hurd want a word with you, just off the top of my head.
- Galanwe 6y agoThat may be a stupid question, but the comments here made me wonder: Is the objective to have an OS written in Rust, which can support programs running in any language. Or is the objective to have an OS written in Rust AND all the ecosystem in Rust too. Im wondering because the former seems easier and reachable, but from the comments mentioning the port of numerous programs, I have the impression that it is the latter.
- Shared404 6y agoThe OS and in house projects are in Rust, and there is support for programs in other languages as well.
- rcarmo 6y agoBit curious that it doesn't seem to run on a Raspberry Pi. Would seem like an obvious thing to do at this point. Looked around and found some forum threads, but nothing installable.