Architecture

KaiOS Architecture

Gaia (Front-End)

Gaia is the user interface of the KaiOS platform. Anything drawn on the screen once KaiOS has launched is a product of the Gaia layer. Gaia implements the lock screen, home screen, and all the standard applications you expect on a smart feature phone. Gaia on KaiOS is implemented using HTML, CSS, and JavaScript. Its only interfaces to the underlying operating system are through open Web APIs, which are implemented by the Gecko layer. Third-party applications can be installed alongside the Gaia layer.

Gaia is the core web app of the device and user interface layer, all written in HTML5, CSS and JavaScript, with a number of exposed APIs to allow the UI code to interact with the phone hardware and Gecko functionality.

Gecko

Gecko forms the KaiOS application runtime; that is, the layer that provides all of the support for the trifecta of open standards: HTML, CSS, and JavaScript. It makes sure those APIs work well on every operating system Gecko supports. This means Gecko includes, among other things, a networking stack, graphics stack, layout engine, a JavaScript virtual machine, and porting layers.

Gecko is the web engine and presentation layer in KaiOS that connects hardware to HTML by serving as the interface between web content and the underlying device. Gecko provides an HTML5 parsing and rendering engine, programmatic access to hardware functionality via secure web APIs, a comprehensive security framework, update management, and other core services.

Gonk

Gonk is the lower level operating system of the KaiOS platform, consisting of a Linux kernel (based on the Android Open Source Project (AOSP)) and a userspace Hardware Abstraction Layer (HAL). The kernel and several of the userspace libraries are common open-source projects: Linux, libusb, bluez, and so forth. Some of the other parts of the HAL are shared with the AOSP: GPS, camera, and others.

You could say that Gonk is a very simple Linux distribution. Gonk is a porting target of Gecko; that is, there's a port of Gecko to Gonk, just like there's a port of Gecko to OS X, Windows, and Android. Since the KaiOS project has full control over Gonk, we can expose interfaces to Gecko that can't be exposed on other operating systems. For example, Gecko has direct access to the full telephony stack and display frame buffer on Gonk, but doesn't have this access on any other operating system.

Gonk is the kernel-level component in the KaiOS stack that serves as the interface between Gecko and the underlying hardware. Gonk controls the underlying hardware and exposes hardware capabilities to Web APIs implemented in Gecko. Gonk can be seen as the “black box” that does all the complex, detailed work behind the scenes to control the mobile device by enacting requests at the hardware level.

Detailed flows

Flows