Skip to content

Add kernel version header implementation#30

Merged
bradjc merged 5 commits intotock:masterfrom
WyliodrinEmbeddedIoT:compat
Jul 30, 2021
Merged

Add kernel version header implementation#30
bradjc merged 5 commits intotock:masterfrom
WyliodrinEmbeddedIoT:compat

Conversation

@alexandruradovici
Copy link
Copy Markdown
Contributor

This PR adds the KernelVersion header implementation defined in tock/tock#2669.

Comment thread Cargo.toml Outdated
Copy link
Copy Markdown
Contributor

@hudson-ayers hudson-ayers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything in the updated diff that looks like it could interfere with Alistair's work that was merged before this, I think it is good to go

@bradjc bradjc merged commit fa12506 into tock:master Jul 30, 2021
bors Bot added a commit to tock/tock that referenced this pull request Jul 30, 2021
2669: [rfc] Comptibility header (v1) r=bradjc a=alexandruradovici

### Pull Request Overview

This pull request adds a compatibility header to the TBF. This is the first version of such a header.

The idea is to add the ability to the kernel to ignore and not load the processes that do not meet the kernel compatibility constraints defined in this header.

This defines a fixed header that contains:
- the exact kernel major version
- the minimum kernel minor version

Processes that provide a `KernelVersion` header state that the exact required kernel version and the
minimum required kernel minor version. For instance, if a process specifies kernel version 2.12, this means it requires a kernel
version that is >= 2.12 and < 3.0.

### Testing Strategy

This was tested using a Microbit v2 and libtock-c with the new elf2tab (tock/elf2tab#30).

EDIT: Tockloader seems to send over to the board unknown TLV headers as this works with the unmodified tockloader.

### TODO or Help Wanted

1. I'm not sure where to define the running kernel version. For now this is defined as two constants in `kernel/src/lib.rs`. Another idea was to define them within the `Config` structure. The printed kernel version is taken from the git release, which, at least for the development tree, is difficult to parse
2. Improvement to the debug messages

### Documentation Updated

- [x] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [x] Ran `make prepush`.


Co-authored-by: Alexandru Radovici <msg4alex@gmail.com>
Co-authored-by: Alexandru Radovici <alexandru.radovici@wyliodrin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants