tock_kernel

Explain Tock kernel patterns, HIL traits, and embedded Rust conventions for chip implementation.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/tardyp/esp_tock --skill tock-kernel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tock_kernel
Source: https://github.com/tardyp/esp_tock/tree/main/.opencode/skills/tock_kernel
Command: npx skills add https://github.com/tardyp/esp_tock --skill tock-kernel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance and examples for implementing Tock kernel patterns, Hardware Interface Layer (HIL) traits, and embedded Rust conventions for chip implementations.

Core Features & Use Cases

  • Project Structure: Illustrates the typical directory layout for Tock projects.
  • HIL Traits: Demonstrates how to implement hardware abstraction using Rust traits.
  • Static Allocation: Emphasizes the use of static allocation in the kernel.
  • Deferred Calls: Shows how to handle asynchronous operations without threads.
  • Register Access: Provides examples of using the tock_registers crate.
  • Error Handling: Outlines Tock's error types and common codes.
  • Interrupt Handling: Demonstrates interrupt service routines.
  • Component Pattern: Explains the component pattern for board initialization.
  • Documentation: Highlights the importance of documenting public items.

Quick Start

Refer to the Tock kernel patterns for implementing chip-specific drivers.

Frequently Asked Questions about tock_kernel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement hardware abstraction layers for embedded Rust in the Tock kernel?

Tock kernel hardware abstraction layers are implemented using HIL traits. These Rust traits define peripheral interfaces, allowing chip implementations to securely abstract hardware details while maintaining the kernel's static allocation conventions.

What is the best way to handle asynchronous operations in embedded Rust without threads?

Asynchronous operations in embedded Rust are handled using deferred calls. The Tock kernel uses this mechanism to simulate hardware interrupts and schedule event processing without relying on threading.

How do I access hardware registers when developing Tock chip implementations?

Hardware registers in Tock chip implementations are accessed using the `tock_registers` crate. This crate provides types and macros for safely defining and interacting with memory-mapped registers.

Does the Tock operating system support dynamic memory allocation for kernel components?

The Tock operating system emphasizes static allocation for kernel components. This approach avoids dynamic memory allocation to ensure predictable memory usage and enhance the security of embedded systems.

How do I initialize board hardware using the Tock component pattern?

Board hardware in Tock is initialized using the component pattern. This pattern provides a structured way to configure peripherals and allocate static memory during the board initialization process.

Why does the Tock kernel require specific error handling conventions for HIL traits?

Tock kernel HIL traits require specific error handling conventions to standardize return types across hardware drivers. Outlining Tock's error types and common codes ensures consistent interrupt management and driver behavior.