New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard code require kernel version in process loading #3839
Comments
When we added kernel version checking, we decided that it is up to the specific kernel (ie board) if it wanted to enforce the check or not, hence the argument to We might only have code in the upstream repo that sets it to |
I understand that downstream projects might not want to require a minimum kernel version. However, my general expectation is that one shouldn't dive into kernel's source code if they want to configure it. In my opinion, kernel configuration should be done either at board level or through configuration parameters. Note that my second proposed solution doesn't prevent Tock upstream code to continue enforcing minimum kernel version:
The difference between the two approaches is evident:
I would opt for the second approach since it allows finer configuration. However, such fine configuration may be considered unnecessary. In this case, the first approach is more suitable. |
I'd be happy with a const generic for this. However, boolean const generics don't carry much inherent meaning when you just look at the instantiation. Similar to how such runtime parameters are more cleanly passed as trait KernelVersionEnforcement {
fn enforce_mininum_kernel_version() -> bool;
}
enum EnforceMinimumKernelVersion {}
impl KernelVersionEnforcement for EnforceMinimumKernelVersion { ... }
enum SkipVersionCheck {}
impl KernelVersionEnforcement for SkipVersionCheck { ... } Perhaps with better type names. This would allow us to also ship more granular policies in the future, while not breaking any APIs. |
Calling |
This can be easily avoided by using a const: const MY_CONST: bool = true;
my_function::<MY_CONST>(...)
I always thought process loading should be done through process loading functions. Is there any upstream board that doesn't use the process loading functions? Do you know any downstream project that doesn't rely on process loading functions? |
No, and, well, no. But it is a very conscious design choice since we added shared process loading functions back in #511. |
I think Ti50 has their own process loading logic, though I'm not 100% sure of that. |
Boards need the option to be able to disable version checking, but they do not need to be able to dynamically choose whether to check versions or not (say to do it for some process binaries but not others). I think a reasonable next step would be to:
|
Currently, required kernel version is hard coded in the code. I suggest changing this in two ways:
If newer Tock kernel versions are designed to always ask for a minimum required kernel version, then remove the parameter from ProcessStandard::create
If the current design still envisages the option not to require a minimum kernel version, then:
What do you think? I'm willing to implement either solution.
The text was updated successfully, but these errors were encountered: