503 points · by rbanffy · 9y ago · 317 comments
They are using the IPC system developed in and extracted from Chrome. They are drawing everything in userspace with fast graphics render but the logic for all system components written in Dart from the Flutter project. They use musl for the libc. They are using the little kernel for the core kernel.
As a long time Linux desktop user myself, I'm really excited about this project. A secure desktop without tons of system calls? Userspace graphics? Not HTML/JS based? But could still be used for development? Yes Please!
It's really easy to compile and get it running. Try it out!
https://events.google.com/io/schedule/?sid=fed907cf-4b51-433...
https://events.google.com/io/schedule/?sid=496d01fb-2139-4fd...
Disclaimer: I'm in one of the talks.
You can use Flutter today to write an app that runs on iOS and Android. :)
Dumb question, does this mean that it's limited to software rendering only? You need to go through the kernel to talk to the GPU, right?
That's sort of the whole point behind Mantle/Vulkan/Metal/DX12.
In the cases where it does, I imagine it's a situation where you're actually doing 3D-accelerated renders of the user interface. In which case, when the graphics subsystem craps out, hasn't your running system been rendered effectively unusable anyway?
I get that this is a nice idea in theory, but does it actually improve anything practical in practice?
Then there's the whole "GPL mafia" in the Linux world who'd like to force vendors to open up their drivers by moving as much of the critical pieces to the kernel as possible. In theory, you cannot write a kernel driver without violating the GPL. Fuchsia will have no such impositions. If someone wants to open their driver up, they could. If they believe their offering is superior, and a secret sauce needs protecting, they can keep it closed
> They aren't writing a new OS,
> at least, not in the complete sense.
Neither was Linux. It was based on Unix.Neither was Unix. "The success of UNIX lies not so much in new inventions but rather in the full exploitation of a carefully selected set of fertile ideas . . . " --- Dennis M. Ritchie and Ken Thompson, "The UNIX TimeSharing System"
OR it could be a UEFI experiment...
"This project contains some experiments in software that runs on UEFI firmware for the purpose of exploring UEFI development and bootloader development." -https://github.com/fuchsia-mirror/magenta/blob/master/bootlo...
Building user land OS's is a fascinating (if not new) idea that I really love to tinker with a myself. It really would be nice if they can pull it off.
Read through what I could find of the IPC code a while back. Currently it seems workable but a bit "baroque", then again if, as you say, it is working inside Chrome, I guess it is battle tested.
Messaging has always and still is the future for very loosely coupled systems, and driving it all the way down would be really great.
Been following this for a while and can't wait to give it a whirl. Plus everyone likes to root for shiny new OS design projects.
Are there concerns on non-dedicated graphics cards, or running say an ARM-based processor.
Also I'm not sure what you mean by '...easy to compile...' How do you compile this? I'll have to read up on it. Get that checksum bruh.
I remember trying to use Slackware and for me that was a lot of work.
Edit: Oh I see at this time it is limited to three physical machines. Interesting on the Pi 3 part. I wonder if I could try it in Virtual box. But why try it in the first place?
Moore's Law. Give it another decade and it'll be Etacs.
Compare using VS Code w/ Typescript Language Service to any type of dev stack that includes the word “Scala.”
Hopefully, when we start ripping out *nix before 2038, Fuscia and other capability-based OS's can take over.
Side-tangent, but security enthusiasts need to calm down on the "world is ending" talk. Those of us who lived through Windows ME, where logging on IRC basically gave you a 25% chance of having your computer hijacked by some random script kiddie, think it's laughable to say that security is anywhere near as bad as it used to be. Night and day.
Those were people just messing around. Annoying and harmful to your local machine certainly, but the harm that was caused was localized.
Security vulnerabilities are now industrialized, with large-scale public attacks and widespread silent compromises used to gather and sell your information for profit. The situation is still bad, it's just bad in a different way.
But there are zillions more computers, doing more things, with more interconnections than ever before. So the problems are compounded and I think the situation is worse overall.
Many of these devices aren't patched after they're sold, and can be compromised within minutes of being assigned a publicly routable IP - this is what happened with Mirai.
Security is better for desktop computers, but if you include everything with an operating system, it's much, much worse.
At the very least you should be able to stay secure if you know what you are doing. But even that’s not enough. You also need to be lucky && uninteresting && not actually using computers.
(This book is well worth reading...)
Then, people might quite reinventing the wheel or missing obvious things as much as they do now.
It's both inspiring and depressing.
On modern OSes, that aren't plain UNIX clones, C and C++ are being pushed down the stack just to provide some hardware abstraction layer, with everything else being done in more safer, productive, languages.
No one uses them. Security is useless if no one uses it. Capabilities are too hard, too complex, to manage.
Great idea. Horrible implementation.
https://nuxi.nl/ https://www.bsdcan.org/2015/schedule/attachments/330_2015-06...
Capabilities. Like fine grain locks, these are very powerful and very hard to get right. That's the lesson from Hydra, the 432, .... No, it's not a hard mechanism for the microkernel to get right; it's a hard policy for the application programmer to get right. However, that's probably more of an opportunity rather than meant as a criticism. Our tools are massively more evolved than they were in the 70s. It'll be interesting to see what happens with capabilities.
C++. Oh lord. Why are you writing a microkernel in C++? If there was anything they learned from L4 (Xen, Linux, ...) it is that C is sufficient. Why do you want to implement something small with something that is large? This one is a real head scratcher.
Provably secure. They did this with the SEL4 microkernel so this is a doable thing. If they're going to hang their hat on security (capabilities, microkernel, ...) there's no excuse for not having done this already and delivered a provably secure microkernel out of the box.
Compared to the midnight bamboo forest my company built. A challenging codebase, not by its merits but because you need to be clever just to find your way through.
Anyone know if Google is hiring webforms developers?
Why do you want to implement something small with
something that is large?
Consider the size and amount of equipment involved in making watches. Or microchips, for that matter.Because if there was anything proven from years and years of using C, it's that it is woefully insecure and should not be trusted to write a kernel with.
You can still fuck up with C++, sure, but std::shared_ptr offers more guarantees than *.
EDIT: HN stop eating my stars
seL4, a third-generation microkernel is 8,700 lines of C code and 600 lines of assembler.
http://web1.cs.columbia.edu/~junfeng/09fa-e6998/papers/sel4....
So we also empirically know that you can formally verify a microkernel written in C. Now if the Fuchsia folks had gone ahead and formally verified their microkernel, this issue would be moot. But they haven't. So we are instead left with std::shared_ptr offers more guarantees than *. While this isn't nothing, it isn't much either.
Good coding practices take no time to implement, you learn it once and you write that way. It is not bullet proof, neither are capabilities. Still, at least they're practical.
As far as I know, Google hasn't telegraphed the purpose of it. I can't tell if it's targeted at all, none, or some of the above.
https://techspecs.blog/blog/2017/2/14/googles-not-so-secret-...
https://fuchsia.googlesource.com/magenta/+show/master/docs/m...
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Fuchsia”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Fuchsia, and these people are using it, but it is just a part of the system they use.
In fact, it looks a lot like the same general design as Integrity, a microkernel capability-based architecture with as much as possible in user space.
I didn't realize that he was working for Google.
This doesn't seem like a wise path to take.
* See http://sel4.systems/
Things changed in hardware in last 20 years and maybe we've learned something about software as well.
Not to mention that sel4 is GPLv2, which is kind of problematic for a commercial company.
In the end, the micro-kernel is a very small part of the whole stack.
I can see potential problems already from looking at the Magenta kernel docs. For instance, they say that all syscalls are non-blocking except for explicit wait and sleep calls, which means the kernel is very likely vulnerable to various DoS attacks, which aren't a problem for L4 kernels.
...but your parent, in turn, has limited permissions, because the only way it can get a handle is to ask its parent. And when you ask your parent for a filesystem handle, your parent doesn't have to give you the handle it has. Your parent might give you a limited filesystem handle which only allows writes to /tmp.
...and when you, in turn, start a subprocess --- say, an instance of sqlite for use as a database --- you have to give it handles for the things it wants to do on your behalf. But your filesystem handle only allows writes to /tmp. That means that your sqlite instance can only write to /tmp too.
There's more to it than that, because in real life you also want to forward capabilities to other running services as part of RPCs, but you tend to end up with a natural container system with multiple redundant layers of isolation, all running at minimum necessary privilege, and all hardware-mediated.
Another really interesting capability-based OS is Genode:
https://genode.org/about/screenshots
https://genode.org/documentation/general-overview/index
It'll allow you to run complete OS kernels as capability-restricted Genode processes, effectively allowing virtual machines as first-class citizens.
Thanks for this explanation, it really helped the idea "click"
Most such languages only go too far by allowing "ambient authority", whereby any component in your program has the ability to turn a reference to a value that carries little authority, into one that carries significantly more authority. For instance, consider the file open API: you're essentially turning a string, which exposes no unsafe or security-critical methods, into an object that can literally destroy your computer. And literally any library or component you use can open files. It's madness!
To make a memory safe language capability secure, you simply remove all sources of ambient authority. This mainly consists of globals that permits transitive access to mutable state, like file system APIs, global static variables that can reference transitively mutable data, etc.
These insecure APIs are then replaced with equivalent object instances which you can pass around, eg. you can only receive the authority to open a file if you're given an instance to the directory object which contains that file. The entry point of your program would then change to accept various capabilities instead of just string parameters.
http://www.cl.cam.ac.uk/research/security/ctsrd/cheri.html
https://en.wikipedia.org/wiki/EROS_(microkernel)
Note: Definitely see KeyKOS as it was commercially deployed with both POLA and persistence of app data.
https://www.combex.com/tech/darpaBrowser.html
http://www.cs.washington.edu/homes/levy/capabook/index.html
Note: Especially see System/38 which became AS/400 & IBM i. Still selling. And they run and run and run. Architecture & POLA go a long way there.
I thought they were just a bit like file-descriptors or X11 window ids, or indeed pointers. Such handles do have a kind of role in authorization: once a process has convinced the system to give it some resource, then the (handle, processid) pair is all the system needs to check access.
However you typically gain the handle through something like `open()`, i.e. an ACLed request for a named resource. But with true capabilities you just inherit authorisation from some other capability -- possibly one granted to you by a different process.
That said, the difference from existing systems might be small. Namespaces are really useful, and are probably here to stay. But as long as things can be accessed by names, the access will need to be controlled by something like an ACL.
Not necessarily. If your system supports first-class namespaces, then you can just build a namespace consisting of only the objects to which a program should have access. No need for any further access control.
A file open dialog from a program is simply the program's request for you to map a file into its namespace.
Unfortunately this is usually quite heavyweight. In Unix-like systems, and in Plan 9, the canonical way to do this is to implement a filesystem. "Filesystem" is the universal IPC layer. But implementing a filesystem usually takes quite a lot of effort.
Do you know of any systems where this can be done easily enough for it to be used ubiquitously?
One would much prefer to just put together a hierarchy of objects at the language level and automatically expose it... or something like that anyway.
On the other hand, I can see how capabilities would mix with ACLed namespaces to improve security. Essentially it would define the semantics of things like cgroups and chroot jails.
In fact sometimes I think that mainstream virtualisation is slowly reinventing -- in an incremental way -- what various alternative OSes advocated in a radical way. E.g. Linux cgroups and "one process per container" sounds quite a lot like Plan9's per-process view of the system.
https://fuchsia.googlesource.com/magenta/+/master/docs/sysca...
It's early days. The API surface is still evolving.
https://en.wikipedia.org/wiki/Tanenbaum%E2%80%93Torvalds_deb...
The article says that the focus is on 'PCs, tablets, and high-end phones'. Wouldn't a more secure OS be relevant to server environment? Is the performance cost of a microkernel considered to be too high for a server OS? Is it too difficult to do?
So, I'd say evidence leans in favor of microkernels being better. The cutting-edge isn't that, though. It's hardware/software combinations that give more reliability and security with better usability & performance than microkernels. Lots of work in languages, compilers, and CPU extensions. CHERI and CHERIBSD is probably top example with Spin OS, JX OS or Redox OS on something like Watchdog-Lite CPU being representative of language-oriented work.
The majority of embedded OSes have a microkernel design.
Also Windows and OS X have a kind of hybrid design, even if not a proper mikrokernel.
On Windows case,there are now a sandboxed kernel and drivers.
https://channel9.msdn.com/events/Ignite/2016/BRK4010
https://channel9.msdn.com/Blogs/windowsserver/Device-Guard-i...
If anything, the closest thing to a microkernel that is in wide use is Xen, or Hyper-V.
In any case it is better than Linux will ever be.
Regarding Xen and Hyper-V, there is a systems paper that states hypervisors are the revenge of mikrokernels.
Plan 9 is not dead, it ideas live on in other projects.
I may be mistaken,but my understanding is that userspace servers accessible through the use of the fopen/fread/fwrite, etc. system calls was an idea that originated in Plan 9.
Furthermore, some people who worked at Bell Labs at the time now work at Google.
http://multicians.org/rjf.html
Now, the question is when was same concept applied to user-space servers? It was possibly Mach that was UNIX-like with all processes communicating through ports that were like standardized pipes.
https://en.wikipedia.org/wiki/Mach_(kernel)
You got user-space components to open them, read them, write them, etc. That was 1985 whereas Plan 9 hit universities in 1992. Both models had security and performance issues that led reliability- and security-oriented OS's to go different routes on purpose. Plan 9 was a step up from UNIX but a step down from high-assurance (eg KeyKOS, NonStop) and high-flexibility systems (eg SPIN OS, LISP machines).
In general: it gives a process a huge amount of flexibility in terms of how it sets up its own address space, communicates with other processes, and in how it can communicate with the kernel.
Hasn't this always been the way Android operates? Developed in secret, source thrown over the wall every release?
https://fuchsia.googlesource.com/docs/+/master/getting_start...
This makes it significantly easier to build a closed platform with unbreakable barriers between processes, and this is a great thing in terms of security and fine grained access controls for each process. Individual process isolation is extremely important for most of todays use cases where only a single user is logged into each system at one time and most running code is trusted.
In practice this means you can prevent user space processes from accessing anything you don't want them to touch while still giving them substantial low level access. This will be a boon with device makers because it allows them to preventing a users apps from compromising the carrier experience. Companies like Google will also have less concern about users installing malware like ad blockers. The movie and music industry will also greatly appreciate an operating system finally designed for 21st century IP protection. This will even be embraced by hardware manufacturers since they no longer need to provide open source drivers for their hardware that could be ported to other platforms. Overall a win-win for everybody.
In the end we can trust that this will result in a better user experience with more secure apps and devices.
Did anyone hear the whispers of Xooglers a few years back talking about "big changes" coming to Android that were absolutely horrible for users and done to placate industry? Hmmmm... This Fuscia thing looks pretty suspicious.
The outcome of moving drivers to user space will be proliferation of binary blobs and black box drivers. If you think binary GPU drivers are bad now, imagine an "open source" OS where every single driver is a binary blob. It will become impossible to run Fuscia devices on any other operating system because you have no drivers, sealing off the Android platform permanently.
The current situation is they're tied to a version of the kernel, and typically abandoned by the vendors. With userspace drivers and driver APIs, the "android upgrade problem" would be solved.
It'd then be a matter of reversing these drivers, which should be far easier when they're running in userspace and completely bounded.
https://www.engadget.com/2007/11/05/symbian-nokia-microsoft-...
Palm's not the only company that isn't afraid to speak out on the Open Handset Alliance. Nokia, Microsoft and Symbian made it most clear today that they don't perceive danger from the new initiative and corresponding Android OS, with Nokia stating it quite bluntly: "We don't see this as a threat." Microsoft was a bit more on the defensive. "It really sounds that they are getting a whole bunch of people together to build a phone and that's something we've been doing for five years," said Scott Horn, from Microsoft's Windows Mobile marketing team. "I don't understand the impact that they are going to have."
Google certainly has the resources to do something like this. But neither of those projects (others mentioned Android) were started from scratch at Google.
That's not necessarily a bad thing -- Google's M.O. has always been to try lots of different things at once. But it may mean they literally don't have a solid long-term plan for it yet.
Why should I rewrite my Android app just because Google can't work out their internal politics?
And yes, I know that you'll probably be able to run Android apps on Fuchsia, but what about bitrot? Will JVM-language based Android be put on Life Support?
(I work for open-source projects at Google, and don't see your claim being universally or even mostly true)
Everything at Google, from it's original product (search engine) to embedded devices, medical research, entire Alphabet portfolio is aimed at total dominance of every area in people's lifes. It's an evil company in my eyes, it's been a long time since I retained at least some trust in this company and it's vision.
> Lets throw away the last 20 years development on the linux kernel by thousands of people, and rewrite our own.
> How much will it cost?
> Ooh - I dunno - If you lend me 1000 engineers, we should be done in about 10 years, cos we're really smart and don't need to implement legacy SCSI support...
Good thing it's funded by someone who has lots and lots of money!
> Lets throw away the last 20 years development on the linux kernel by thousands of people, and rewrite our own.
To suggest that linux is as good as it gets is a mistake. Operating systems are challenging to write, but certainly not impossible. If you're Google, you see big security risks involved in Linux's design. Google tries to mitigate some of those by funding oss-fuzz and a ton of other great options that narrow the opportunity for exploits. But what if you could write your own OS and make particular security guarantees as a design goal?
Google has already designed and/or reimplemented almost every aspect of the OS excluding the OS kernel.
The biggest drawback for starting a new OS is generally the cost of porting existing software to the new OS.
Making something better than Linux in some way isn't hard. Making something consistently and sustainably better in enough ways, at the rate Linux moves, is a very hard task.
On top of that, Linux essentially sucked all the air out of the UNIX development space by killing off all the commercial UNIXes. Carrying Linux forward rests largely on the shoulders of the kernel team and whatever contributions other businesses feel like making.
So where is the next major OS coming from? Google and Microsoft are the last two companies with the talent to build a future OS and enough resources and clout to push it enough to get traction. (In theory, it could also come from the community but people like Linus only come along once in a generation.)
I think that is a stretch. Apple has significant investment in Darwin and are a huge contributor to LLVM. Also, don't count out Amazon ... they have their fingers in so many pies these days ...
Apple could make the next OS for Apple (presuming they were willing to take the leap to do something other than incremental improvements to their existing stable of OSes), but they aren't likely to make OSes for anyone else, so they aren't really relevant to the discussion.
> Also, don't count out Amazon ... they have their fingers in so many pies these days ...
Amazon seems to be pretty consistently plucking the low-hanging fruit from their current position. They might have the right talent to build a future OS, butz for a slightly different reason than Apple, it doesn't seem to be consistent with their orientation.
That's not an opinion necessarily shared by others who worked on UNIX and still do in some cases.
Certainly, there are commercial UNIX releases today that have relatively recent innovations and capabilities that still aren't available in other operating systems.
Only because they have done a really good job.
I think it won because it offered neutral grounds (a place where lots of players who don't have huge market power can meet without fear of being swindled) and, partly, out of luck (you could call it 'good timing', but I don't think Linus considered that)
(Don't get your knickers in a knot. I'm not banging on Linux.)
For good reason too. The commercial UNIXes were absurdly expensive, and they were all incompatible with each other too. There's a reason all the software developers abandoned UNIX and went to Windows. UNIX killed itself with ridiculous license fees and fragmentation. Linux saved it by making it free, open-source, and unifying it and using common standards instead of a bunch of vendors trying to make their own hoping to gain marketshare and ending up losing everything to MS. Of course, this hasn't prevented Linux from having its own share of fragmentation (the different DEs chiefly), but it's nothing like the UNIX Wars of the 80s.
Amazon does release a modified Android. They could probably spend the money and get there.
Doesn't oracle do a fair bit of linux work?
Red hat as well. Building a new OS they do have the knowledge at least.
IBM?
You do not want these companies involved in your operating system.
Android is maybe using 10% of the functionality in the linux kernel but is paying all the overhead and friction of maintaining a branch for each and every device.
I think google wants to heavily encapsulate the hardware vendors drivers and customizations and provide a stable API so google can pretty much update devices with on its own without much interaction with the hardware manufacturers. (Which are very complacent about their updating)
There's only two ways around this: 1) somehow force companies to open-source their driver code, or 2) have a static, unchanging (or at least very backwards-compatible) ABI for device drivers, and then just suffer with shoddy drivers written by vendors which cause all kinds of glitchy behavior, as Windows was infamous for for so many years.
This doesn't happen with the mainline tree because it's all open-source and gets debugged and inspected by others, but that just doesn't happen with the cellphones/Android.
Right now you can bootstrap a ROM because the manufacturer has to OS their kernel (GPL).
Now, with the kernel being proprietary, getting a custom ROM will probably be as hard as getting android to work on iPod.
Correct, they don't:
> From piecing together information from the online documentation and source code, we can surmise that Fuchsia is a complete operating system for PCs, tablets, and high-end phones.
Their baseline isn't hardware from 40 years ago, it's that of today and only a subset of it. That means that you can forego an enormous amount of things which are all potential sources of problems. The world has evolved a lot, new theories around OS design and security have come and gone.
Just because Linux serves us well doesn't mean we shouldn't explore other options, or that those other options need to support every old data exchange format and hardware port.
Chrome has more code than the Linux kernel.
The numbers I see for 2012 (way back) are: "4,490,488 lines of code, 5,448,668 lines with comments included, spread over 21,367 unique files."
Linux, on the other hand, was ~ 200K lines of code for the kernel (the rest is 7 million for drivers, about which the new OS doesn't need to concern itself, as it will on custom hardware) and 2 million lines for various architectures (ditto).
Don't overestimate the complexity of building a complete kernel -- even teams as resource lacking as NetBSD can do it.
And with other parts of the stack, they already have tons of experience (e.g Skia for graphics etc).
Your argument could have been used against almost every project Google's worked on. Email, search, Go, phones, Chrome, maps, etc. all had established proprietary and open source competitors.
It might be expensive, but it's cheaper, more practical, and more likely to succeed than something like self-driving cars or Google Glass.
Someone in a comment above noted that Rob Pike thinks Unix is obsolete. But then he was probably thinking about Plan9 which was indeed better than UNIX -- because it even more unixy. Filesystems all the way down.
Capabilities are the first new abstraction I have heard of that really go beyond the Unix model.
For starters, read the headlined article that observes that capabilities pre-date the UNIX model.
Even the "classic authorities" on this stuff, including Bach, Comer, Deitel, and Tanenbaum, pointed to many things that went beyond the UNIX model. And this was almost thirty years ago.
There is a wealth of experimentation and diversity that already exists and that has been done over the intervening many years. In addition to the operating systems already mentioned on this very page, there's Helios which was a capability-based system with a POSIX layer on top from the late 1980s/early 1990s. The BSD 4.4 Log-Structured Filesystem had global wear levelling in the filesystem in 1990. OS/2 1.0 went beyond terminal escape codes and multiple mouse protocols to a device-neutral video, keyboard, and mouse paradigm for TUI applications in 1987. People have done operating systems where everything really is a file, "object oriented" operating systems, network distributed operating systems, microkernel operating systems with multiple "personalities", ... all sorts.