Skip to content

feat: tbf serialization#127

Open
addrian-77 wants to merge 1 commit into
mainfrom
add/tbf-serialize
Open

feat: tbf serialization#127
addrian-77 wants to merge 1 commit into
mainfrom
add/tbf-serialize

Conversation

@addrian-77

Copy link
Copy Markdown

Pull Request Overview

This pull request adds serialization for TBF Headers

TODO or Help Wanted

Checks

Using Rust tooling

  • Ran cargo fmt
  • Ran cargo clippy
  • Ran cargo test
  • Ran cargo build

Features tested:

  • flag change
  • header serialize and reconstruction

GitHub Issue

This pull request closes #117

@addrian-77
addrian-77 requested a review from eva-cosma April 17, 2026 23:19
@addrian-77 addrian-77 self-assigned this Apr 17, 2026
Comment thread tbf-parser/src/types.rs
Comment on lines +132 to +138
bitflags! {
/// TBF flags
pub struct Flags: u32 {
const Enabled = 1;
const Sticky = 1 << 1;
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these all of the tbf flags, or are there more? Could you add a link to the tock documentation in the comment for this structure

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

https://book.tockos.org/doc/tock_binary_format?highlight=flags#tbf-header-base

> Bit 0 marks the process enabled. A 1 indicates the process is enabled. Disabled processes will not be launched at startup.
> Bit 1 marks the process as sticky. A 1 indicates the process is sticky. Sticky processes require additional confirmation to be erased. For example, tockloader requires the --force flag erase them. This is useful for services running as processes that should always be available.
> Bits 2-31 are reserved and should be set to 0.

Currently there are only 2 flags, enabled and sticky, the rest of the bits are reserved.

@addrian-77
addrian-77 requested a review from eva-cosma April 23, 2026 11:55
Signed-off-by: Adrian Lungu <lunguadrian30@gmail.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.

tbf-parser: Add serialization

2 participants