-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add a crate for embeded_hal (etc.) driver adapters #25
Conversation
Currently trying to figure out why CI is failing. I previously tested on the standalone http demo. Also, I keep getting the following error when I make various changes. (I most recently got it when trying to add a
Any idea what might be going on there? |
Thank you, @protoben! This is an exciting direction.
It looks like the The The The
|
Thanks! Making Still trying to figure out the timeout issue. |
Turns out the HTTP server pexpect script for testing wasn't logging all of QEMU's output. I've fixed that in #29. Apparently this line is being executed: https://github.com/protoben/rust-seL4/blob/ed936b3749b7db329ff9a2805fd1030074b2f155/crates/sel4-hal-adapters/src/smoltcp/phy/handler.rs#L153 |
crates/examples/microkit/http-server/pds/virtio-net-driver/src/main.rs
Outdated
Show resolved
Hide resolved
By the way, I'm still working out to best lay out information about the Nix code for testing and CI for contributors who wish to use it. It might be useful for debugging in this case. So, in the meantime, here are some useful Nix invocations: Build and run the HTTP server demo:
Build and run the automated HTTP server demo test just like CI:
Drop into a Nix shell with an environment suitable for hacking on the HTTP server demo crates:
From inside the Nix shell, build a relevant crate:
( |
crates/examples/microkit/http-server/helpers/smoltcp-phy-impl/src/lib.rs
Outdated
Show resolved
Hide resolved
crates/examples/microkit/http-server/pds/virtio-net-driver/Cargo.toml
Outdated
Show resolved
Hide resolved
@nspin Any idea why the "Check source" job is still failing? Running In the CI, the error seems to be |
The Makefile target Line 45 in 8e90b88
So, while that
The stderr output right above that message is actually a diff, where
Quick fix for the failureThe code checking You removed the crate at Actual solutionManaging Cargo manifests for this many crates is tedious and error-prone: keeping all of the relative paths correct; using the same versions of dependencies throughout the project; keeping metadata up to date; etc. To make things easier and more robust, I've been managing these files using some Nix expressions. The The Cargo manifest generation process is very intentionally disentangled from the rest of the project's build + test code. However, as this PR has shown, developers who add new crates or otherwise change the dependency graph still need to interact with this automation. So, I'll spend the next few days improving it and documenting it (including how to bypass it) to make things easier for future contributors. Sorry for the trouble this time around! In the meantime, here's a suggestion to complete this PR: https://github.com/nspin/rust-sel4/tree/nspin/wip/hal-adapter-pr-suggestion |
By the way, the commit history for the |
Also, I have an idea about moving some of the code in this PR around a bit. Perhaps we should discuss this idea before you go to the effort of putting the finishing touches on the PR as it exists now. I noticed that you moved the contents of what was the What do you think about that? |
That makes sense. I mentioned above that I had moved the You make a good point, though. I didn't consider that it might be useful outside of microkit. I can re-work the PR to do as you suggest. I'll go ahead and mark it as a draft, for now. |
Hmm... I'm not sure how I managed that, since I've just been rebasing. Thanks for pointing it out. I'll try to fix it. |
I'm under the impression that the behavior of the For IPC that we ourselves have define, like the The scope of my suggestion is just the |
By the way, I'm improving the |
No, I think my stuff should be pretty much contained in |
Here is the PR: #32 |
Some work towards getting the Cargo manifest management tools into a more appropriate state for collaboration: #36 |
Here is the new Cargo management manifest tool documentation: https://github.com/seL4/rust-sel4/tree/main/hacking/cargo-manifest-management |
Sorry I haven't been keeping up on this. I got busy with other projects at work. I'm going to try and fix this up (with the changes you suggested above) this week. I'll probably start fresh on a new branch so the rebase is cleaner. |
No problem. Let me know how I can help! If the related changes that have happened underneath this PR (mentioned in this thread) get in your way, feel free to reach out here or on https://mattermost.trustworthy.systems/. |
33fbde8
to
afc95f0
Compare
@protoben Is this PR ready for review? |
Yes! Sorry, should have pinged you.
…-------- Original Message --------
On Dec 11, 2023, 6:07 PM, Nick Spinale wrote:
Is this PR ready for review?
—
Reply to this email directly, [view it on GitHub](#25 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABDLJ523YX2WLZHJSGLSB73YI636LAVCNFSM6AAAAAA5RMQMJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRGE4DSMBXGI).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Could you add copyright + license headers to the files mentioned in https://github.com/seL4/rust-sel4/actions/runs/6910861641/job/18804620813?pr=25?
|
Otherwise, code looks great. I noticed you dropped the use of this new crate in the HTTP server demo. Was that intentional? It would be cool to have a demo showing off this crate (could be separate from the HTTP serve demo), but we can add that later. |
Intentional, yes, but just because I was having trouble finding time to update that part. I suspect it won't be hard, but I haven't had time to look at it. I figured I would make that into a separate PR, if that sounds reasonable. I'd be fine with modifying the existing HTTP example or forking it off into a separate one, whichever seems best to you. |
Oops. Fixed. Also, looks like |
26c71c8
to
603e408
Compare
Sounds good to me.
Merged! Thanks. |
{ mk, versions, localCrates, smoltcpWith, serdeWith, authors }: | ||
|
||
mk { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you replace these lines with
{ mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, versions, localCrates, smoltcpWith, serdeWith, authors }:
mk {
nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // {
copyrightLines = defaultReuseFrontmatterArgs.copyrightLines ++ [
"Copyright 2023, Galois, Inc."
];
});
then the copyright lines in the adjacent generated Cargo.toml file will match those in this file.
Not sure if anyone cares about the copyright lines in the generated Cargo.toml files, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, after rebasing on top of #49,
{ mk, overrideDefaultFrontmatter, versions, localCrates, smoltcpWith, serdeWith, authors }:
mk {
nix.frontmatter = overrideDefaultFrontmatter {
extraCopyrightLines = [
"Copyright 2023, Galois, Inc."
];
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, only if you care about copyright info in the generated Cargo.toml file.
After rebasing on top of |
Signed-off-by: Ben Hamlin <hamlinb@galois.com>
Signed-off-by: Ben Hamlin <hamlinb@galois.com>
603e408
to
e5a2707
Compare
This PR adds a
sel4-hal-adapters
crate to provide generic adapters that handle IPC for HW drivers, using existing HAL traits. Currently, it only contains an adapter for thesmoltcp::phy::Device
trait, but additional adapters could be added using the same pattern.I've also modified the http-server example to use the
smoltcp::phy
adapter, as an example of how this could be used. Thesmoltcp::phy::Driver
implementation has been moved into this crate, since this is (maybe) a better place for it to live.