# coredevices/pebbleos architecture

> Architecture diagram of the GitHub repository coredevices/pebbleos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coredevices/pebbleos
- Repository: https://github.com/coredevices/pebbleos

## Overview

PebbleOS is smartwatch firmware: it hosts watch applications and provides device, connectivity, and user-facing services. A representative runtime path is a running app using firmware services, which in turn interact with device hardware or persistent state. The tree documents these capabilities broadly, but sampled implementation excerpts are mostly storage-focused; edges below emphasize only wiring directly supported by those excerpts, and omit uncertain service-to-service flows.

Main entry points: [`include/pbl/services/process_management`](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/process_management) (App runtime), [`include/pbl/services/comm_session`](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/comm_session) (Communication session), [`include/pbl/drivers/flash.h`](https://github.com/coredevices/pebbleos/blob/main/include/pbl/drivers/flash.h) (Flash hardware), [`src/fw/services/process_management/process_loader_storage.c`](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/process_management/process_loader_storage.c) (Process loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Apps and execution"]
  node_apps_runtime["App runtime"]
  node_process_loader["Process loader"]
  node_app_storage[("App storage")]
end

subgraph group_services["Watch services"]
  node_timeline["Timeline"]
  node_notifications["Notifications"]
  node_activity["Activity and health"]
  node_data_logging["Data logging"]
end

subgraph group_connectivity["Connectivity"]
  node_comm_session["Communication session"]
  node_bluetooth["Bluetooth services"]
end

subgraph group_platform["Platform and storage"]
  node_kernel["Kernel"]
  node_drivers["Device drivers"]
  node_timeline_store[("Timeline item store")]
  node_notification_store[("Notification store")]
  node_logging_store[("Logging storage<br/>[dls_storage.c]")]
  node_resource_store[("Resource storage<br/>[resource_storage.c]")]
  node_firmware_store[("Firmware storage<br/>[firmware_storage.c]")]
  node_bonding_store[("Bluetooth pairing store")]
  node_shared_prf[("Shared PRF flash")]
  node_flash["Flash hardware<br/>[flash.h]"]
  node_settings[("Settings files<br/>[settings_file.h]")]
end

node_wearer(("Watch wearer"))
node_phone(("Paired phone"))

node_wearer -->|"uses watch"| node_apps_runtime
node_apps_runtime -->|"loads processes"| node_process_loader
node_process_loader -->|"reads binaries"| node_app_storage
node_apps_runtime -->|"uses services"| node_timeline
node_apps_runtime -->|"communicates via"| node_comm_session
node_phone -->|"exchanges messages"| node_comm_session
node_comm_session -->|"uses Bluetooth"| node_bluetooth
node_apps_runtime -->|"records data"| node_data_logging
node_wearer -->|"receives alerts"| node_notifications
node_wearer -->|"uses health features"| node_activity
node_apps_runtime -->|"runs on"| node_kernel
node_kernel -->|"coordinates hardware"| node_drivers
node_timeline -->|"stores items"| node_timeline_store
node_timeline_store -->|"reads and writes"| node_settings
node_notifications -->|"stores notifications"| node_notification_store
node_data_logging -->|"reads and writes"| node_logging_store
node_resource_store -->|"reads resources"| node_flash
node_firmware_store -->|"checks firmware"| node_flash
node_bluetooth -->|"persists pairings"| node_bonding_store
node_bonding_store -->|"syncs pairing data"| node_shared_prf
node_shared_prf -->|"reads and writes"| node_flash

click node_apps_runtime "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/process_management"
click node_process_loader "https://github.com/coredevices/pebbleos/blob/main/src/fw/services/process_management/process_loader_storage.c"
click node_app_storage "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/process_management"
click node_timeline "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/timeline"
click node_notifications "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/notifications"
click node_activity "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/activity"
click node_data_logging "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/data_logging"
click node_comm_session "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/comm_session"
click node_bluetooth "https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/bluetooth"
click node_kernel "https://github.com/coredevices/pebbleos/tree/main/kernel"
click node_drivers "https://github.com/coredevices/pebbleos/tree/main/include/pbl/drivers"
click node_timeline_store "https://github.com/coredevices/pebbleos/blob/main/src/fw/services/blob_db/timeline_item_storage.c"
click node_notification_store "https://github.com/coredevices/pebbleos/blob/main/src/fw/services/notifications/notification_storage.c"
click node_logging_store "https://github.com/coredevices/pebbleos/blob/main/src/fw/services/data_logging/dls_storage.c"
click node_resource_store "https://github.com/coredevices/pebbleos/blob/main/src/fw/resource/resource_storage.c"
click node_firmware_store "https://github.com/coredevices/pebbleos/blob/main/src/fw/system/firmware_storage.c"
click node_bonding_store "https://github.com/coredevices/pebbleos/blob/main/src/fw/services/bluetooth/bluetooth_persistent_storage_normal.c"
click node_shared_prf "https://github.com/coredevices/pebbleos/blob/main/src/fw/services/shared_prf_storage/shared_prf_storage.c"
click node_flash "https://github.com/coredevices/pebbleos/blob/main/include/pbl/drivers/flash.h"
click node_settings "https://github.com/coredevices/pebbleos/blob/main/include/pbl/services/settings/settings_file.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_apps_runtime,node_process_loader,node_app_storage toneBlue
class node_timeline,node_notifications,node_activity,node_data_logging toneAmber
class node_comm_session,node_bluetooth toneMint
class node_kernel,node_drivers,node_timeline_store,node_notification_store,node_logging_store,node_resource_store,node_firmware_store,node_bonding_store,node_shared_prf,node_flash,node_settings toneRose
class node_wearer,node_phone toneIndigo
```

## Components

### Apps and execution

- [App runtime](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/process_management): `include/pbl/services/process_management`
- [Process loader](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/process_management/process_loader_storage.c): `src/fw/services/process_management/process_loader_storage.c`
- [App storage](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/process_management): `include/pbl/services/process_management`

### Watch services

- [Timeline](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/timeline): `include/pbl/services/timeline`
- [Notifications](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/notifications): `include/pbl/services/notifications`
- [Activity and health](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/activity): `include/pbl/services/activity`
- [Data logging](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/data_logging): `include/pbl/services/data_logging`

### Connectivity

- [Communication session](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/comm_session): `include/pbl/services/comm_session`
- [Bluetooth services](https://github.com/coredevices/pebbleos/tree/main/include/pbl/services/bluetooth): `include/pbl/services/bluetooth`

### Platform and storage

- [Kernel](https://github.com/coredevices/pebbleos/tree/main/kernel): `kernel`
- [Device drivers](https://github.com/coredevices/pebbleos/tree/main/include/pbl/drivers): `include/pbl/drivers`
- [Timeline item store](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/blob_db/timeline_item_storage.c): `src/fw/services/blob_db/timeline_item_storage.c`
- [Notification store](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/notifications/notification_storage.c): `src/fw/services/notifications/notification_storage.c`
- [Logging storage](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/data_logging/dls_storage.c): `src/fw/services/data_logging/dls_storage.c`
- [Resource storage](https://github.com/coredevices/pebbleos/blob/main/src/fw/resource/resource_storage.c): `src/fw/resource/resource_storage.c`
- [Firmware storage](https://github.com/coredevices/pebbleos/blob/main/src/fw/system/firmware_storage.c): `src/fw/system/firmware_storage.c`
- [Bluetooth pairing store](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/bluetooth/bluetooth_persistent_storage_normal.c): `src/fw/services/bluetooth/bluetooth_persistent_storage_normal.c`
- [Shared PRF flash](https://github.com/coredevices/pebbleos/blob/main/src/fw/services/shared_prf_storage/shared_prf_storage.c): `src/fw/services/shared_prf_storage/shared_prf_storage.c`
- [Flash hardware](https://github.com/coredevices/pebbleos/blob/main/include/pbl/drivers/flash.h): `include/pbl/drivers/flash.h`
- [Settings files](https://github.com/coredevices/pebbleos/blob/main/include/pbl/services/settings/settings_file.h): `include/pbl/services/settings/settings_file.h`

### Other components

- **Watch wearer**
- **Paired phone**

## Connections

- Watch wearer → App runtime: uses watch
- App runtime → Process loader: loads processes
- Process loader → App storage: reads binaries
- App runtime → Timeline: uses services
- App runtime → Communication session: communicates via
- Paired phone → Communication session: exchanges messages
- Communication session → Bluetooth services: uses Bluetooth
- App runtime → Data logging: records data
- Watch wearer → Notifications: receives alerts
- Watch wearer → Activity and health: uses health features
- App runtime → Kernel: runs on
- Kernel → Device drivers: coordinates hardware
- Timeline → Timeline item store: stores items
- Timeline item store → Settings files: reads and writes
- Notifications → Notification store: stores notifications
- Data logging → Logging storage: reads and writes
- Resource storage → Flash hardware: reads resources
- Firmware storage → Flash hardware: checks firmware
- Bluetooth services → Bluetooth pairing store: persists pairings
- Bluetooth pairing store → Shared PRF flash: syncs pairing data
- Shared PRF flash → Flash hardware: reads and writes
