Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alistair23
Copy link
Collaborator

This PR first renames timer and leds to match the alarm and led capsule names used in the kernel.

It then updates the flash.sh script to automatically generate the app permissions. This requires the elf2tab PR: tock/elf2tab#28 to accept the --permissions argument.

To match the Tock drivers rename the libtock-rs timer to alarm.

Signed-off-by: Alistair Francis <[email protected]>
To match the Tock drivers rename the libtock-rs leds to led.

Signed-off-by: Alistair Francis <[email protected]>
Update the `flash.sh` script to automatically generate the app
permissions. This requires the elf2tab PR: tock/elf2tab#28
to accept the --permissions argument.

This script will parse the output to determine what capsules are being
used in the app. It then allows all of the commands in libtock-rs that
can be used by those capsules.

Signed-off-by: Alistair Francis <[email protected]>
@jrvanwhy
Copy link
Collaborator

This seems hacky and fragile.

Perhaps we can add a new elf section to the binary, and have drivers add symbols to that section indicating which driver IDs and commands they use? We could make a convenience macro, so indicating we use a command looks like declare_command_use!{driver_id: 1, command_id: 1};. The part I'm not entirely sure of is how to prevent the compiler from discarding the symbols, as they would not be referenced from .text.

@alistair23
Copy link
Collaborator Author

I'm open to better ideas. I'm not sure how we could do that. How does the compiler know what commands get used or do you just mean that users manually list them in their app?

@jrvanwhy
Copy link
Collaborator

libtock (both the Tock 1.0 libtock and the Tock 2.0 libtock I am working on) exposes all the drivers. As far as I can tell, you're relying on the compiler to include symbols related to each driver that is used in the final binary, and exclude symbols related to unused drivers. Is my understanding correct, or am I misunderstanding something?

@alistair23
Copy link
Collaborator Author

Exactly!

@alistair23 alistair23 closed this Nov 8, 2021
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.

2 participants