The source code for Google Fuchsia first appeared on GitHub in August 2016. At the time, there was no official explanation from Google, but the source code shows that it can support cross-platform development, not only for mobile phones and PCS, but also for automotive media systems, furniture iot and other embedded devices.

Like Android before it, Fuchsia is open source and free. But unlike Chrome and Android, Fuchsia is not based on Linux, but on Google’s own new microkernel called Zircon

Zircon was developed by a programmer named Travis Geiselbrecht, who also created the NewOS kernel that supports Haiku OS. Zircon, written in C++, consists of a microkernel and a set of user-space services, drivers, and software libraries that handle classic kernel tasks such as system startup and process loading. Zircon’s system calls are generally non-blocking, except for wait_ONE, wait_many, port_wait, and sleep.

Zircon supports building on Linux or macOS to create a bootable bootFS image. Zircon was originally an offshoot of LK. LK is another kernel Google developed for embedded systems, intended as an open source alternative to FreeRTOS or ThreadX. But Zircon has less stringent requirements than LK because it was designed to run on modern devices with ample memory and high-speed processors.

Zircon manages processing time, memory, I/O, interrupts, signals, and waits. A user land uses a resource through a handle, which has rights associated with the resource and passes execution permissions for actions such as copying, passing, reading, writing, and executing. The drivers in Zircon are implemented as ELF software libraries and loaded into the process. The driver management process DevMgr tracks all drivers and devices, manages the discovery of drivers, and controls access to devices. The device can use C ABI protocols such as PCI Protocol and USB Protocol.

Zircon does not support UniX-style signaling, nor does it provide any directly implemented mechanism. It supports wait operations on handles. Wait includes a number of different signal states, such as write ready, run, stop, and so on. Similarly, Zircon does not have unix-like fork and exec operations, but instead uses the Launchpad software library to create processes. Here is a sample code snippet for creating 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); // << here you can add other launchpad_*() calls to create 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);Copy the code

For a full understanding of Zircon, it is recommended to read the full documentation. Zircon is still heavily under development, but Google is not currently actively seeking third-party contributions.

As mentioned above, Fuchsia can be embedded into hardware systems such as furniture and cars, which is currently impossible for Chrome and Android. It can be seen that Fuchsia is a strategy for Google to transition from PC and mobile terminals to the current Internet of Things field. Fuchsia is seen by many as an important part of Google’s effort to unify Chrome and Android, bringing mobile, PC, and the Internet of Things into a closed-loop Google ecosystem that, like Apple, fundamentally solves the problem of fragmentation.

Fuchsia will also support Dart, a Google development scripting language already used in projects within Google, and Flutter, a tool for building cross-platform, high-performance mobile applications within Dart. Flutter is still in beta, but judging from Google’s actions over the past two years, Flutter may also be part of Google’s Fuchsia strategy. So, as developers, keep a positive learning attitude, keep up with the technology, and wait for time to tell the rest.

https://fuchsia.googlesource.com/docs/+/master/the-book/