Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News An Early Look at Zircon, Google Fuchsia New Microkernel

An Early Look at Zircon, Google Fuchsia New Microkernel

This item in japanese

High Performance Architecture for the Internet of Things

Learn about some of the most common challenges associated with the real-time processing and storage of IoT-generated data; the common technology components, including in-memory computing technologies; and how they fit into an IoT architecture. Download Now.


Sponsored Content

Google has published the official book about Fuchsia, its new operating systems aimed at IoT and mobile devices. Fuchsia will be based on a new microkernel called Zircon.

Written in C++, Zircon is composed of a microkernel plus a set of userspace services, drivers, and libraries that are required to handle system boot, process launch, and other typical kernel tasks. Zircon syscalls are generally non-blocking, with the exception of wait_one, wait_many, port_wait and sleep. You can build Zircon on a Linux or macOS system, then create a bootable bootfs image. Zircon was originally branched for LK, another kernel developed at Google for embedded systems that could be used as a free alternative to FreeRTOS or ThreadX. However, Zircon’s requirements are less strict than LK’s, though, since it is designed to run on modern devices with plenty of RAM and fast processors.

Zircon manages the following resources: processor time, memory, I/O, interrupts, and signaling and waiting. Resources are used from user land through handles. Handles have rights associated to them which convey privileges to perform actions such as duplicating, transferring, reading, writing, executing, etc. Drivers in Zircon are implemented as ELF libraries which are loaded into processes. A device manager process, devmgr, keeps track of drivers and devices, manages the discovery of drivers, and administers access to devices. Devices may implement Protocols, using C ABI, such the PCI protocol, the USB protocol and so on.

Zircon does not support Unix-style signals and provides no way to directly implement them. Instead, it supports waiting on handles, which can be in a number of different signal states, such as ready for writing, running, stopped, etc. Similarly, Zircon does not have Unix-like fork or exec but uses the launchpad library to create processes. This is how you can create a process using launchpad:

   launchpad_t* lp;
   launchpad_create(job, "processname", &lp);
   launchpad_load_from_file(lp, argv[0]);
   launchpad_set_args(lp, argc, argv);
   launchpad_set_environ(lp, env);
//   << other launchpad_*() calls to setup initial fds, handles, etc >>
   zx_handle_t proc;
   const char* errmsg;
   zx_status_t status = launchpad_go(lp, &proc, &errmsg);
   if (status < 0)
       printf("launchpad failed: %s: %d\n", errmsg, status);

Make sure to read the full documentation to get a full picture. Zircon is still under heavy development and Google is not actively seeking contributions at the moment.

Rate this Article