|
| 1 | +New in 2.2 |
| 2 | +========== |
| 3 | + |
| 4 | +Tock 2.2 represents almost two years of Tock development since v2.1.1. This |
| 5 | +release contains 3882 commits made across 836 PRs by 90 contributors (of which |
| 6 | +48 are new contributors!). It is the first Tock release that can compile on a |
| 7 | +stable Rust toolchain, and contains many other important fixes, new subsystems, |
| 8 | +new platforms, new drivers, and major refactors. |
| 9 | + |
| 10 | +* Backwards Compatibility |
| 11 | + |
| 12 | + Tock 2.2 extends its system call interface through one new system call |
| 13 | + ([`Yield-WaitFor`](https://github.com/tock/tock/pull/3577)), but retains |
| 14 | + backwards compatbility with Tock 2.1.1 for its core system call interface and |
| 15 | + all [stabilized |
| 16 | + drivers](https://github.com/tock/tock/tree/7c88a6209e3960c0eb2081c5071693dc1987964d/doc/syscalls). |
| 17 | + |
| 18 | + In this release, we revised Tock's alarm system call driver implementation to |
| 19 | + predictably wrap its `ticks` values at `(2**32 - 1)` ticks, across all |
| 20 | + platforms. Before this change, hardware alarm implementations that were less |
| 21 | + than 32 bit wide would wrap before reaching `(2**32 - 1)` ticks, which |
| 22 | + complicated correct alarm handling in userspace. In Tock 2.2, these alarm |
| 23 | + implementations are scaled to 32 bit, while also scaling their advertised |
| 24 | + frequency appropriately. While this change is non-breaking and compatible with |
| 25 | + the previous alarm implementation, it can expose such scaled alarms to |
| 26 | + userspace at significantly higher advertised `frequency` values. Userspace |
| 27 | + alarm implementations that did not correctly handle such high frequencies may |
| 28 | + need to be fixed to support this new driver implementation. |
| 29 | + |
| 30 | +* Security and `arch`-crate Fixes |
| 31 | + |
| 32 | + Tock 2.2 includes important and security-relevant fixes for its Cortex-M and |
| 33 | + RISC-V architecture support. |
| 34 | + |
| 35 | + * When switching between applications, the RISC-V PMP implementation did not |
| 36 | + correctly invalidate any additional memory protection regions that are not |
| 37 | + overwritten by the target app's PMP configuration. Under certain conditions |
| 38 | + this can allow an application to access private memory regions belonging to |
| 39 | + a different applications (such as when using IPC). |
| 40 | + |
| 41 | + * The Cortex-M (Armv7-M) and Cortex-M0/M0+ (Armv6-M) hard fault, interrupt and |
| 42 | + `svc` handlers contained a bug that could allow an application to execute in |
| 43 | + `privileged` mode after returning from the handler. This allows an |
| 44 | + application to execute code at kernel privileges and read / write arbitrary |
| 45 | + memory. |
| 46 | + |
| 47 | +* Stable Rust Support |
| 48 | + |
| 49 | + This release removes all nightly Rust features from all of Tock's core kernel |
| 50 | + crates (such as `kernel`, `arch/*`, and `chips/*`). This allows Tock to be |
| 51 | + built on the Rust stable toolchain for the first time! |
| 52 | + |
| 53 | + We demonstrate this by switching the `hail` board to a stable toolchain in |
| 54 | + this release. We continue to compile other boards on the Rust nightly |
| 55 | + toolchain, as this enables some important code-size optimizations (such as by |
| 56 | + compiling our own, size-optimized core library). |
| 57 | + |
| 58 | +* `AppID`, Credentials and Storage Permissions |
| 59 | + |
| 60 | + This Tock release revisits how applications are identified in the kernel, and |
| 61 | + introduces a set of mechanisms that allow developers to identify, verify, and |
| 62 | + restrict applications that are running on a Tock kernel. AppIDs are the core |
| 63 | + mechanism to enable this and identify an application contained in a userspace |
| 64 | + binary. AppIDs allow the kernel to apply security policies to applications as |
| 65 | + their code evolves and their binaries change. We specify AppIDs, Credentials |
| 66 | + and their interactions with process loading in [a draft |
| 67 | + TRD](https://github.com/tock/tock/blob/7c88a6209e3960c0eb2081c5071693dc1987964d/doc/reference/trd-appid.md). |
| 68 | + |
| 69 | + Additionally, we introduce a mechanism to assign applications permissions to |
| 70 | + access some persistent storage (e.g., keys in a key value store). This |
| 71 | + mechanism interacts with AppIDs (ShortIDs) and is also specified in a [a draft |
| 72 | + TRD](https://github.com/tock/tock/blob/7c88a6209e3960c0eb2081c5071693dc1987964d/doc/reference/trd-storage-permissions.md). |
| 73 | + |
| 74 | +* Major Refactors and Interface Changes |
| 75 | + |
| 76 | + We implement a number of kernel-internal refactors and interface changes: |
| 77 | + |
| 78 | + - System call drivers are now mandated to either return `Success` or |
| 79 | + `Failure(ErrorCode::NODEVICE)` for a `command` system call with command |
| 80 | + number `0`. Previously, some drivers used this command number to also convey |
| 81 | + additional information to userspace. This release does not change the |
| 82 | + interface of any [stabilized |
| 83 | + drivers](https://github.com/tock/tock/tree/7c88a6209e3960c0eb2081c5071693dc1987964d/doc/syscalls), |
| 84 | + which will be updated as part of Tock 3.0. |
| 85 | + |
| 86 | + - Tock 2.2 introduces [a new policy to support external |
| 87 | + dependencies][external-deps] in the upstream Tock codebase. As part of this |
| 88 | + effort, we split up the existing, single `capsules` crate into multipe |
| 89 | + crates (such as `capsules-core`, `capsules-extra`, and `capsules-system`) |
| 90 | + with different guarantees concerning stability and use of external |
| 91 | + dependencies. The `core` capsules crate contains capsules deemed essential |
| 92 | + to most Tock systems, as well as virtualizers which enable a given single |
| 93 | + peripheral to be used by multiple clients. Other capsules have been moved to |
| 94 | + the `extra` capsules crate. The `system` capsules crate contains components |
| 95 | + that extend the functionality of the Tock core kernel, while not requiring |
| 96 | + `unsafe`. |
| 97 | + |
| 98 | + - Furthermore, the `DeferredCall` and `DynamicDeferredCall` subsystems have |
| 99 | + been replaced with a more lightweight and unified deferred call |
| 100 | + infrastructure. This new approach has a smaller code size overhead and |
| 101 | + requires less setup boilerplate code than `DynamicDeferredCall`. |
| 102 | + |
| 103 | + - `LeasableBuffer` has been renamed to `SubSlice` and features a significantly |
| 104 | + improved API. Multiple subsystems have been ported to this new type. |
| 105 | + |
| 106 | + - Tock 2.2 introduces "configuration boards": variants of in-tree board |
| 107 | + definition showcasing certain subsystems or peripherals. These boards (under |
| 108 | + `boards/configurations`) are implemented by converting some Tock boards into |
| 109 | + combined "lib + bin" crates and extending these boards. |
| 110 | + |
| 111 | + - Tock can now be built entirely using `cargo` and without its Makefiles. This |
| 112 | + change also simplifies downstream board definitions: |
| 113 | + |
| 114 | + - A new `StreamingProcessSlice` helper provides a reusable data structure to |
| 115 | + convey a "stream" of data from capsures to userspace. This is used in Tock's |
| 116 | + new CAN driver, and is useful for ADC, networking, etc. |
| 117 | + |
| 118 | + - Tock introduces a new interface for custom implementations of the |
| 119 | + userspace-syscall boundary to hook into the RISC-V trap handler, by |
| 120 | + specifying which registers are clobbered and providing a generic trampoline |
| 121 | + to jump to custom code on a trap. |
| 122 | + |
| 123 | +* New Boards |
| 124 | + |
| 125 | + This release features support for 7 new boards in the upstream Tock codebase: |
| 126 | + * sma_q3 by @dcz-self in https://github.com/tock/tock/pull/3182 |
| 127 | + * particle_boron by @twilfredo in https://github.com/tock/tock/pull/3196 |
| 128 | + * BBC HiFive Inventor by @mateibarbu19 in |
| 129 | + https://github.com/tock/tock/pull/3225 |
| 130 | + * SparkFun LoRa Thing Plus by @alistair23 in |
| 131 | + https://github.com/tock/tock/pull/3273 |
| 132 | + * makepython-nrf52840 by @bradjc in https://github.com/tock/tock/pull/3817 |
| 133 | + * Nano33BLE Sense Rev2 by @TheButterMineCutter in |
| 134 | + https://github.com/tock/tock/pull/3717 |
| 135 | + * VeeR EL2 simulation target by @wsipak in |
| 136 | + https://github.com/tock/tock/pull/4118 |
| 137 | + |
| 138 | +* New HILs, Drivers and Features |
| 139 | + |
| 140 | + Tock 2.2 features 6 new HILs: |
| 141 | + * CAN bus by @teonaseverin in https://github.com/tock/tock/pull/3301 |
| 142 | + * `Buzzer` by @TeodoraMiu in https://github.com/tock/tock/pull/3084 |
| 143 | + * `DateTime` by @Remus7 in https://github.com/tock/tock/pull/3559 |
| 144 | + * `CycleCounter` by @codingHahn and @hudson-ayers in |
| 145 | + https://github.com/tock/tock/pull/3934 |
| 146 | + * `public_key_crypto/SignatureVerify` by @bradjc in |
| 147 | + https://github.com/tock/tock/pull/3878 |
| 148 | + * `Servo` by @inesmaria08 in https://github.com/tock/tock/pull/4126 |
| 149 | + |
| 150 | + An additional 40 PRs added support for various hardware peripherals, subsystems and other features. |
| 151 | + |
| 152 | +* IEEE 802.15.4 and 6LoWPAN Stack |
| 153 | + |
| 154 | + We can now join a Thread network by running OpenThread as a libtock-c |
| 155 | + userspace implementation, thanks to a major refactor and redesign of Tock's |
| 156 | + IEEE 802.15.4 and 6LoWPAN stack. |
| 157 | + |
| 158 | + **Known issue**: UDP transmit functionality is currently broken with a bug / |
| 159 | + inconsistency between the kernel and libtock-c implementation. When executing |
| 160 | + the transmit syscall, the libtock-c application fails to provide the src |
| 161 | + address and fails the error check that occurs for the transmit syscall. For |
| 162 | + more information, see the Tock 2.2 release testing issue: |
| 163 | + https://github.com/tock/tock/issues/4272#issuecomment-2569993915 |
| 164 | + |
| 165 | +In addition to the above, this release includes a plethora of other fixes, |
| 166 | +improvements and refactors. You can see the full list of changes at |
| 167 | +https://github.com/tock/tock/compare/release-2.1...release-2.2 |
| 168 | + |
1 | 169 | New in 2.1
|
2 | 170 | ==========
|
3 | 171 |
|
|
0 commit comments