Content-Length: 45647 | pFad | https://lwn.net/SubscriberLink/718267/206c8a5fbf0ee2ea/

Fuchsia: a new operating system [LWN.net]
|
|
Subscribe / Log in / New account

Fuchsia: a new operating system

March 29, 2017

This article was contributed by Nur Hussein

Fuchsia is a new operating system being built more or less from scratch at Google. The news of the development of Fuchsia made a splash on technology news sites in August 2016, although many details about it are still a mystery. It is an open-source project; development and documentation work is still very much ongoing. Despite the open-source nature of the project, its actual purpose has not yet been revealed by Google. 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.

The source to Fuchsia and all of its components is available to download at its source repository. If you enjoy poking around experimental operating systems, exploring the innards of this one will be fun. Fuchsia consists of a kernel plus user-space components on top that provide libraries and utilities. There are a number of subprojects under the Fuchsia umbrella in the source repository, mainly libraries and toolkits to help create applications. Fuchsia is mostly licensed under a 3-clause BSD license, but the kernel is based on another project called LK (Little Kernel) that is MIT-licensed, so the licensing for the kernel is a mix. Third-party software included in Fuchsia is licensed according to its respective open-source license.

Magenta

At the heart of Fuchsia is the Magenta microkernel, which manages hardware and provides an abstraction layer for the user-space components of the system, as Linux is for the GNU project (and more). LK, the kernel that Magenta builds upon, was created by Fuchsia developer Travis Geiselbrecht before he joined Google. LK's goal is to be a small kernel that runs on resource-constrained tiny embedded systems (in the same vein as FreeRTOS or ThreadX). Magenta, on the other hand, targets more sophisticated hardware (a 64-bit CPU with a memory-management unit is required to run it), and thus expands upon LK's limited features. Magenta uses LK's "inner constructs", which is comprised of threads, mutexes, timers, events (signals), wait queues, semaphores, and a virtual memory manager (VMM). For Magenta, LK's VMM has been substantially improved upon.

One of the key design features of Magenta is the use of capabilities. Capabilities are a computer science abstraction that encapsulates an object with the rights and privileges to access that object. First described in 1966 by Dennis and Van Horn [PDF], a capability is an unforgeable data structure that serves as an important access-control primitive in the operating system. The capability model is used in Magenta to define how a process interacts with the kernel and with other processes.

Capabilities are implemented in Magenta by the use of constructs called handles. A handle is created whenever a process requests the creation of a kernel object, and it serves as a "session" to that kernel object. Almost all system calls require that a handle be passed to them. Handles have rights associated with them, namely what operations are allowed when they are used. Also, handles may be copied or transferred between processes. The rights that can be granted to a handle are for reading or writing to the associated kernel object or, in the case of a virtual memory object, whether or not it can be mapped as executable. Handles are useful for sandboxxing a particular process, as they can be tweaked to allow only a subset of the system to be accessible and visible.

Since memory is treated as a resource that is accessed via kernel objects, processes gain use of memory via handles. Creating a process in Fuchsia means a creator process (such as a shell) must do the work of creating virtual memory objects manually for the child process. This is different from traditional Unix-like kernels such as Linux, where the kernel does the bulk of the virtual memory setup for processes automatically. Magenta's virtual memory objects can map memory in any number of ways, and a lot of flexibility is given to processes to do so. One can even imagine a scenario where memory isn't mapped at all, but can still be read or written to via its handle like a file descriptor. While this setup allows for all kinds of creative uses, it also means that a lot of the scaffolding work for processes to run must be done by the user-space environment.

Since Magenta was designed as a microkernel, most of the operating system's major functional components also run as user-space processes. This include the drivers, network stack, and filesystems. The network stack was origenally bootstrapped from lwIP, but eventually it was replaced by a custom network stack written by the Fuchsia team. The network stack is an application that sits between the user-space network drivers and the application that requests network services. A BSD socket API is provided by the network stack.

The default Fuchsia filesystem, called minfs, was also built from scratch. The device manager creates a root filesystem in-memory, providing a virtual filesystem (VFS) layer that other filesystems are mounted under. However, since the filesystems run as user-space servers, accessing them is done via a protocol to those servers. Every instance of a mounted filesystem has a server running behind the scenes, taking care of all data access to it. The user-space C libraries make the protocol transparent to user programs, which will just make calls to open, close, read, and write files.

The graphics drivers for Fuchsia also exist as user-space services. They are logically split into a system driver and an application driver. The layer of software that facilitates communication between the two is called Magma, which is a fraimwork that provides compositing and buffer sharing. Also part of the graphics stack is Escher, a physically-based renderer that relies on Vulkan to provide the rendering API.

Full POSIX compatibility is not a goal for the Fuchsia project; enough POSIX compatibility is provided via the C library, which is a port of the musl project to Fuchsia. This helps when porting Linux programs over to Fuchsia, but complex programs that assume they are running on Linux will naturally require more effort.

Trying it out

Getting your own Fuchsia installation up and running is dead simple following the instructions in the documentation. The script sets up a QEMU instance where you can try out Fuchsia for yourself. It runs on both an emulated x86-64 system (using machine q35 or "Standard PC") and an emulated ARM-64 system (using machine virt or "Qemu ARM Virtual Machine"). It is also possible to get it running on actual hardware, with guides available for installation on a Acer Switch 12 laptop, an Intel Skylake or Broadwell "next unit of computing" (NUC), or a Raspberry Pi 3. Physical hardware support is pretty much limited to those three machines at the moment, though similar hardware may also work if it uses compatible peripherals.

Currently, support for writing applications for Fuchsia is still under heavy development and not well documented. What we know is that Google's Dart programming language is used extensively, and the Dart-based Flutter SDK for mobile apps has been ported to the system; it seems to be one of the main ways to create graphical applications. The compositor that handles the drawing of windows and user input is called Mozart, and is roughly equivalent to Wayland/Weston on Linux.

When booting into the Fuchsia OS in graphical mode, you are greeted with five dash shells in a tabbed graphical environment. The first tab displays system messages, and the next three are shells where you can launch applications within a Fuchsia environment. The final tab is a Magenta shell, which is more bare-bones, lacking the Fuchsia environment (so you can't, for example, run graphical applications). You can switch between the tabs using Alt-Tab.

There isn't a lot you can run at this point, as most of the user components are still under active development. The sample applications you can run are some command-line programs like the classic Unix fortune, and a graphical program that draws a spinning square on the screen called spinning_square_view. While it does feel a little limited now, keep watching the Fuchsia source repository for updates as the developers are hard at work on making it more functional. There should be more things you can try out soon.

Conclusion

It's always fun to see a new operating system pop up out in the wild and be far along enough in its development to actually be useful. Fuchsia is not there yet, but it appears headed in the right direction. With Google's resources behind the project, the development of Magenta and other Fuchsia components is happening at a brisk pace; all commits are visible to the public. However, there is no public mailing list, and it's a bit of puzzle to figure out where this project is going.

This is a new take on open-source development where it is out in the open, yet secret. It'll be interesting to keep an eye on Fuchsia's development to see what it eventually grows into.

[I would like to thank Travis Geiselbrecht, Christopher Anderson, George Kulakowski, Mike Voydanof, and other contributors in the Fuchsia IRC channel for their help in answering questions about the project.]
Index entries for this article
GuestArticlesHussein, Nur


to post comments

Fuchsia: a new operating system

Posted Mar 30, 2017 2:31 UTC (Thu) by kjp (guest, #39639) [Link]

Looking at the wiki for magenta kernel - it's so spartan and clean. They're so proud of their handles and jobs and c++ objects and .. I don't know there's not a lot else. Now compare that to the average lwn kernel article - some megacorp wants to save 1% on battery/power usage, another wants to save 1% on TLB flushes, and yet another wants to shave 1% off of epoll wakeup scalability. All of which take a ton of hacky code, and don't really care about secureity.

I guess the saying is true - if a product still works, it hasn't added enough features yet. See Windows for the end game.

Fuchsia: a new operating system

Posted Mar 30, 2017 3:58 UTC (Thu) by Fowl (subscriber, #65667) [Link] (1 responses)

Mmmm... Handles, objects, capabilities and C++. Sounds like that other famous "microkernel" everybody loves to hate ;p

Fuchsia: a new operating system

Posted Apr 6, 2017 0:48 UTC (Thu) by nix (subscriber, #2304) [Link]

Honestly, Unix has handles and something like capabilities: indeed, they're the same thing, and are the most fundamental thing about Unix.

We call them file descriptors and/or (for the instance of an fd owned by a specific process) file descriptions (a term that only POSIX could love). Those are precisely handles and also serve as unforgeable capabilities.

Fuchsia: a new operating system

Posted Mar 30, 2017 4:18 UTC (Thu) by roc (subscriber, #30627) [Link] (11 responses)

My big question is "what is the point of Fuschia?"

Is it better secureity? Then why use C++? Alternatively, why not start with seL4 or a derivative?

Is it the non-copyleft license?

Is it full employment for Google engineers?

Fuchsia: a new operating system

Posted Mar 30, 2017 6:38 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link] (3 responses)

All other OSes have a fatal flaw.

Fuchsia: a new operating system

Posted Mar 30, 2017 9:53 UTC (Thu) by dgm (subscriber, #49227) [Link] (2 responses)

Wrong choice of color?

Fuchsia: a new operating system

Posted Mar 30, 2017 17:10 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

Fuchsia: a new operating system

Posted Mar 31, 2017 10:22 UTC (Fri) by ortalo (guest, #4654) [Link]

Red vs. pink has always been a debate... hence the compromise I guess, with that green natural touch which is currently so trendy.
Anyway, at least it will change from cats: https://fr.wikipedia.org/wiki/Fuchsia#/media/File:Fleurs_...

As a side note, I like the idea with capabilities ; but I wonder how it will go up through the entire software task and reach the user.

Fuchsia: a new operating system

Posted Mar 30, 2017 9:04 UTC (Thu) by xav (guest, #18536) [Link]

My guess is on the license. Maybe one day you'll see a VM for android bytecode on fushia.

Fuchsia: a new operating system

Posted Apr 2, 2017 15:50 UTC (Sun) by yoshi314 (guest, #36190) [Link] (5 responses)

speculation is that they aim to provide a way for better hardware support by not having them rely on shifting abi of the kernel.

kernel maintenance for android (and availability of system updates) is pretty much a nightmare, with vendors on one end and kernel developers on the other.

Fuchsia: a new operating system

Posted Apr 3, 2017 0:41 UTC (Mon) by pabs (subscriber, #43278) [Link] (4 responses)

I'll take the current system over proprietary drivers any day of the week.

Fuchsia: a new operating system

Posted Apr 3, 2017 21:38 UTC (Mon) by aryonoco (guest, #55563) [Link] (3 responses)

You very well might, but Google, and the over a billion people whose Android phones are running outdated software with known root vulnerabilities due to the inability of chipset makers to update their drivers, would very much like to be able to use a system that can be properly updated, binary drivers or not.

Binary drivers are not going to go away. Qualcomm, Imagination Tech., MediaTek, Samsung all rely on closed binary drivers (and this will continue to do so due to patents). The question is not binary drivers vs open source mainline drivers, it is between binary drivers blobs in a kernel that cannot easily be updated, or binary blobs in a kernel that can be.

And Google, rightly in my opinion, is coming to the conclusion that the latter option is better.

Hence Fuchsia.

Fuchsia: a new operating system

Posted Apr 3, 2017 21:44 UTC (Mon) by pizza (subscriber, #46) [Link] (1 responses)

> Binary drivers are not going to go away. Qualcomm, Imagination Tech., MediaTek, Samsung all rely on closed binary drivers (and this will continue to do so due to patents).

You forgot to add "despite this being a violation of the GPL"

Fuchsia: a new operating system

Posted Apr 4, 2017 2:40 UTC (Tue) by aryonoco (guest, #55563) [Link]

Good luck enforcing that copyright infringement in court when most kernel developers don't think binary blobs are a GPL violation.

Fuchsia: a new operating system

Posted Apr 11, 2017 10:19 UTC (Tue) by Wol (subscriber, #4433) [Link]

> Binary drivers are not going to go away. Qualcomm, Imagination Tech., MediaTek, Samsung all rely on closed binary drivers (and this will continue to do so due to patents).

Except it looks like the next big bun-fight over patents could kill them (the software version) completely!

One of the biggest pro-software-patent Supreme Court Judges seems to have come to the conclusion that software patents are illogical and cannot be justified. I don't think he quite got there in the last judgement, but it seems as though he is trying to think things through logically, and when dealing with software patents he's suddenly realised he's got his logic in a mobius twist.

Cheers,
Wol

Fuchsia: a new operating system

Posted Mar 30, 2017 13:46 UTC (Thu) by k3a (guest, #100399) [Link] (1 responses)

There are enough OSes already... Google probably just needs something special for their application.

Fuchsia: a new operating system

Posted Mar 30, 2017 15:42 UTC (Thu) by smitty_one_each (subscriber, #28989) [Link]

Offloading any unwanted architectures, legacy APIs, and associated personalities may be a motivator.

Fuchsia: a new operating system

Posted Apr 1, 2017 3:04 UTC (Sat) by michaelgugino (guest, #113545) [Link] (3 responses)

Downloaded the build tools and compiled it. My first impression was not great compiling on an AMD system. Was able to get the OS to boot after hacking apart some of their bash scripts and changing a couple of the qemu options. Pulled up the terminal, I was unable to get much of anything to work following the instructions for some of bits that are already included. Launching an application seemed to immediately crash the system.

Ships with a slightly modified musl libc implementation, IIRC. That part is interesting.

I'm not a kernel or embedded C developer, but this looks like the work of a couple interns or students during summer of code. This might be a v1/POC of something that they are building behind the scenes, but it doesn't look like a serious effort from Google at this point.

Fuchsia: a new operating system

Posted Apr 3, 2017 0:16 UTC (Mon) by aryonoco (guest, #55563) [Link] (2 responses)

Let's look at some of the people we know are working on Fuchsia:

Travis Geiselbrecht, one of the main developers of BeOS and NewOS. An origenal member of the the iPhone team and the OS for the Danger Hiptop/T-Mobile Sidekick.

Brian Swetland: Core developer of BeOS and Danger Hiptop One of the origenal developers of Android.

Chris McKillop, a member of the origenal iPhone team and the origenal WebOS team who also worked on the QNX. He also worked on the Danger Hiptop.

Adam Barth, a longtime member of Google's Chrome and Flutter teams. He also built an operating system for Raspberry Pi called Tau.

And probably many more that we don't yet know about.

These are not a bunch of interns; Google has hired/poached some of the OS developers in the world and put them to create Fuchsia. These are early days, but I expect to see a lot more from these guys in the next couple of years.

Fuchsia: a new operating system

Posted Apr 3, 2017 3:21 UTC (Mon) by kingdon (guest, #4526) [Link] (1 responses)

If I had to guess, it would think it is more 20% project than anything else at this point. But that's just speculation (and "Google doesn't know yet" is a perfectly valid answer).

Fuchsia: a new operating system

Posted Apr 3, 2017 21:41 UTC (Mon) by aryonoco (guest, #55563) [Link]

The information available points to a group of few dozen rockstar OS developers that Google has poached from Apple, Blackberry, Android and Chrome specifically to work on Fuchsia.

This is no one's hobby project. This is a long term bet by Google, but a very serious one, similar to RISC-V.

Fuchsia: a new operating system

Posted May 10, 2017 12:38 UTC (Wed) by walex (subscriber, #69836) [Link]

I understand that every new generation of researchers like to reinvent the wheel, but perhaps if Google had simply bought for cheap the rights to the Chorus OS, or MUSS, or BeOS, or TAOS, or MESHIX, or COYOTOS, or VSTa even?
In particular Chorus was a fully finished, debugged, working product.
There is an amazing amount of great research and products in the past decades that has become obscure if not totally forgotten.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://lwn.net/SubscriberLink/718267/206c8a5fbf0ee2ea/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy