RebbleOS is an open-source reimplementation of the firmware for the devices formerly manufactured by Pebble Technologies, Inc. The firmware is based on FreeRTOS, and aims to be binary-compatible with applications that were written for the original Pebble OS, as well as radio-compatible with smartphone applications that are designed to work with Pebble.
RebbleOS needs your help! This section discusses what you need to know to get started working on the project.
RebbleOS currently can be built for snowy
(Pebble Time and Pebble Time
Steel) and tintin
(Pebble and Pebble Steel). To build RebbleOS, follow
these steps:
- Obtain a checkout of the RebbleOS source code.
- Create a
localconfig.mk
if your cross-compiler is in an unusual location. For instance, if you have the SDK installed in/home/me
, add the following line to yourlocalconfig.mk
:PEBBLE_TOOLCHAIN_PATH=/home/me/Pebble/SDK/pebble-sdk-4.5-linux64/arm-cs-tools/bin
. For more information onlocalconfig.mk
variables, consult theMakefile
. - Build the firmware:
make
- If you wish to run the firmware in
qemu
, copy the resources necessary intoResources/
. Take a look at Utilities/mk_resources.sh for more information on that. - To run the firmware in
qemu
, trymake snowy_qemu
.
For example, the following builds RebbleOS on Debian Stretch:
apt install -y gcc-arm-none-eabi
git clone https://github.com/ginge/FreeRTOS-Pebble.git
cd FreeRTOS-Pebble
make
The Pebble SDK is a prerequisite for portions of RebbleOS. The SDK is available at https://developer.pebble.com/sdk/download/. As an example, on Debian, one may create an installation directory for the SDK using the following.
mkdir ~/pebble-dev/
cd ~/pebble-dev/
wget https://s3.amazonaws.com/assets.getpebble.com/pebble-tool/pebble-sdk-4.5-linux64.tar.bz2
tar -jxf pebble-sdk-4.5-linux64.tar.bz2
echo 'export PATH=~/pebble-dev/pebble-sdk-4.5-linux64/bin:$PATH' >> ~/.bash_profile
. ~/.bash_profile
sudo apt-get install python-pip python2.7-dev python-gevent
sudo pip install virtualenv
cd ~/pebble-dev/pebble-sdk-4.5-linux64
virtualenv --no-site-packages .env
source .env/bin/activate
pip install -r requirements.txt
deactivate
The Pebble emulator requires the following libraries.
sudo apt-get install libsdl1.2debian libfdt1 libpixman-1-0
If you wish to build firmware to run on your device, you may also wish to consider a script like buildfw.sh. Running RebbleOS on hardware is currently out of scope for this document.
(This section is, admittedly, somewhat aspirational. Do not be surprised if code within RebbleOS does not necessarily conform to this structure yet!)
RebbleOS is composed of four major components: the hardware abstraction layer, the core operating system, the PebbleOS compatibility layer, and system applications. We break down these components as follows:
-
Hardware abstraction layer. This subsystem provides a unified interface for the rest of the system, and abstracts away platform-specific elements. The HAL lives in the directory
hw/
; symbols that the HAL exports to the rest of the system are prefixed withhw_
. The main entity that the HAL works on is a "platform"; for an example, take a look at hw/platform/snowy/config.mk. A platform depends on various chip components, and potentially other driver components; it exports a platform.h that includes all defines that the rest of the system may need. The HAL is, in theory, independent of the rest of the OS; it does not call into the rest of the system other than through debugging mechanisms and through callbacks that it is provided. -
Core OS. This subsystem provides basic services that any smartwatch OS, even if not implementing a Pebble-like API, might need. HAL accesses are marshalled through concurrency protection; higher-level power management takes place; and, flash wear leveling and filesystem management happens in the core OS. The core OS lives in
rcore/
, and symbols exported from the core OS are prefixed withrcore_
. It calls on FreeRTOS, which lives inFreeRTOS/
. -
Pebble compatibility layer. The core OS provides basic isolation between threads and framebuffer management primitives, but the Pebble compatibility layer provides higher level operations, like Pebble-style layers, input management and routing, and UI services. The Pebble compatibility layer lives in
rwatch/
, and symbols exported from it are prefixed withrwatch_
. (Functions that are exactly analogous to Pebble APIs may be named with their exact name.) -
System applications. We'll, uh, get there when we have some. Yeah.
RebbleOS is an open-source project licensed (primarily) under a BSD-style license. For more information, please see the LICENSE and AUTHORS files. Additionally, contributors and members of the RebbleOS community are expected to abide by our code of conduct; for more information on that, please see the CODE-OF-CONDUCT.md file. Reuse of this project is not only permitted, but encouraged! If you do something cool with RebbleOS, please get in touch with us. The easiest way to do so is through the Rebble Discord server, channel #firmware. We look forward to meeting you!