Git Product home page Git Product logo

Comments (7)

phil-opp avatar phil-opp commented on August 16, 2024

I'm not quite sure what you mean. Could you clarify the advantage of zero padded binaries?

from bootimage.

64 avatar 64 commented on August 16, 2024

I needed to play around with binary sizes a bit for bochs to load my kernel (https://github.com/64/solstice/blob/master/scripts/bochs.sh) so it might be better to support this inside bootimage if possible

from bootimage.

vinaychandra avatar vinaychandra commented on August 16, 2024

Currently bootimage generates a "just enough" disk size. Qemu treats it as a bootable disk and works as expected.
When we develop a file system, we need a place to read and write from. Currently, bootimage neither supports adding custom files to the bootimage other than the kernel, nor supports empty space.
Adding custom file support enables us to load them dynamically from our kernels.
Adding empty space (by padding zeros) enables us to have some space to write from kernel for files and other stuff as a persistent storage.

from bootimage.

phil-opp avatar phil-opp commented on August 16, 2024

@64

I needed to play around with binary sizes a bit for bochs to load my kernel (https://github.com/64/solstice/blob/master/scripts/bochs.sh) so it might be better to support this inside bootimage if possible

I never really used bochs, but sounds reasonable.

from bootimage.

phil-opp avatar phil-opp commented on August 16, 2024

@vinaychandra Thanks for clarifying!

Adding custom file support enables us to load them dynamically from our kernels.

We had something like this before the rewrite, but it was never finished so we removed it again. I think this would need to be implemented in the bootloader crate, since bootimage does no image generation.

Adding empty space (by padding zeros) enables us to have some space to write from kernel for files and other stuff as a persistent storage.

So QEMU treats the loaded image as a hard disk, which allows a file system driver to write to the image file?

from bootimage.

vinaychandra avatar vinaychandra commented on August 16, 2024

@phil-opp,

I think this would need to be implemented in the bootloader crate

I don't know which crate should be implemented where but my point would be to not autoload these extra files (like we do for kernel) but leave them on the bin file so that we can load them dynamically as required.

So QEMU treats the loaded image as a hard disk, which allows a file system driver to write to the image file?

Yes, that is my understanding. See Image types

from bootimage.

phil-opp avatar phil-opp commented on August 16, 2024

I don't know which crate should be implemented where but my point would be to not autoload these extra files (like we do for kernel) but leave them on the bin file so that we can load them dynamically as required.

Sounds reasonable. I think it could be implemented by putting it into a separate ELF section that is not loaded. We could pass the file offset in the boot info to tell the kernel the disk location of the file.

Yes, that is my understanding. See Image types

Interesting!


Note that I'm very busy for the next four weeks, so I won't have time to implement it.

from bootimage.

Related Issues (20)

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.