Giter VIP home page Giter VIP logo

Comments (8)

mkroening avatar mkroening commented on August 16, 2024 1

It would be great to have no_std support. We could make use of this in @hermit-os.

How can we help to move this forward? Can we open a PR, or would you rather do that yourself, @andreeaflorescu? :)

from vm-fdt.

andreeaflorescu avatar andreeaflorescu commented on August 16, 2024 1

It would be great to have no_std support. We could make use of this in @hermit-os.

How can we help to move this forward? Can we open a PR, or would you rather do that yourself, @andreeaflorescu? :)

Oh, I didn't get much time to work on that, so feel free to open a PR and I'll make time to review it. Here is my branch in case it helps with anything: https://github.com/andreeaflorescu/vm-fdt/commits/no_std

from vm-fdt.

rbradford avatar rbradford commented on August 16, 2024

Sounds great, I would support this as I might have a use for this in Rust Hypervisor Firmware.

from vm-fdt.

andreeaflorescu avatar andreeaflorescu commented on August 16, 2024

@danielverkamp what do you think? If this is needed sooner (before the error is stabilized), we can have it as an optional feature. I see that libc and serde also have a no_std option. The way that is implemented is by having std as the default feature. I think this could easily work for this crate as well.

Examples:

from vm-fdt.

danielverkamp avatar danielverkamp commented on August 16, 2024

I agree making it no_std would be nice. I suppose since it still requires alloc, it may not be a good fit for really limited embedded environments, but no_std alone is a good improvement. I guess this would also justify a version bump.

The proposed change looks reasonable; the only minor concern I have is that each property_phandle() call becomes an O(n) operation (where n is the number of existing phandles), since it uses a linear search in a Vec rather than a HashSet lookup, but this is probably fine for any reasonably-sized devicetree. (Perhaps we could remove the duplicate phandle checking to avoid that, although I don't have a strong opinion about it.)

from vm-fdt.

andreeaflorescu avatar andreeaflorescu commented on August 16, 2024

I agree making it no_std would be nice. I suppose since it still requires alloc, it may not be a good fit for really limited embedded environments, but no_std alone is a good improvement. I guess this would also justify a version bump.

We can extend it once we have it as no_std to also have it as no_alloc I guess. I think we can have static allocation for the data blob, but this require some significant re-working of how it currently works, so I would leave it for the next iteration.

The proposed change looks reasonable; the only minor concern I have is that each property_phandle() call becomes an O(n) operation (where n is the number of existing phandles), since it uses a linear search in a Vec rather than a HashSet lookup, but this is probably fine for any reasonably-sized devicetree. (Perhaps we could remove the duplicate phandle checking to avoid that, although I don't have a strong opinion about it.)

Yes, in my branch I did a quick and dirty fix to get it to compile, I would improve that for the actual PR.

from vm-fdt.

rbradford avatar rbradford commented on August 16, 2024

I think having alloc is very common for many no_std users so I wouldn't worry about that too much for a first version.

from vm-fdt.

mkroening avatar mkroening commented on August 16, 2024

I opened #68.

from vm-fdt.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.