Comments (8)
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.
from tock.
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:
- Change
ProcessBinary
to use a const to avoid the dynamic bool we don't need. - Mark this as something to remove entirely after the next 2.x release, as I think it is reasonable at this point that all boards want to do version checking.
from tock.
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 ProcessStandard::create()
. What is the reason to change that?
We might only have code in the upstream repo that sets it to true
, but the expectation was that out-of-tree boards might want to do it differently.
from tock.
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:
- config variable: set to true upstream. Downstream projects may change it depending on their needs.
- constant generic:
load_processes
andload_and_check_processes
take a boolean constant generic parameter that is set to true in upstream board files. Its value can be changed on a board by board basis by downstream projects.
The difference between the two approaches is evident:
- config variable: configuration at kernel level
- constant generic: configuration at board level
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.
from tock.
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 enum
s, we can pass this as types:
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.
from tock.
Calling ProcessStandard::create(..., true, ...)
is at the board level. The process_loading functions are just helpers that boards can choose to use, and can use different variants if they want.
from tock.
However, boolean const generics don't carry much inherent meaning when you just look at the instantiation.
This can be easily avoided by using a const:
const MY_CONST: bool = true;
my_function::<MY_CONST>(...)
Calling
ProcessStandard::create(..., true, ...)
is at the board level. The process_loading functions are just helpers that boards can choose to use, and can use different variants if they want.
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?
from tock.
Do you know any downstream project that doesn't rely on process loading functions?
I think Ti50 has their own process loading logic, though I'm not 100% sure of that.
from tock.
Related Issues (20)
- Add an Asynchronous Process Loader HOT 3
- Tracking: OpenThread Support HOT 13
- Shared references of mutable static warnings HOT 8
- Move implementations of kernel configuration tools to capsules
- Kernel Unit Testing HOT 4
- tock_memory_usage: SyntaxWarning: invalid escape sequence '\S'
- AppID Roadmap HOT 1
- RFC: Expand Alarm Range HOT 8
- License checker incorrectly rejects `.txt` files HOT 1
- Tracking: Tockbot HOT 1
- IEEE 802.15.4: Receive Raw
- RFC: Flash Storage with Isolation HOT 8
- Tracking: Implement Configuration Boards
- Writing the Tock OS kernel to the stm32f303discovery development board failed. HOT 5
- 6LoWPAN Indexing Bug HOT 3
- Alarm: Change prescaler for NRF 5x boards HOT 2
- Tracking: WiFi Support
- Process loading: applications' FLASH order must be the same as RAM order; otherwise loading fails for some HOT 2
- Tockloader: erase does not erase all apps HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tock.