Giter Site home page Giter Site logo

Comments (1)

nihalpasham avatar nihalpasham commented on May 30, 2024

rustBoot is designed to run on anything from a tiny microcontroller to a microprocessor, one important design consideration is support for various execution contexts/environments.

position-dependent code: In the context of a microcontroller, we must figure-out i.e. know 'at compile time' if we are building an image for partition A or partition B. In other words, compiled images are position dependent. Example: say, we have 2 flash partitions, partition A and partition B and we use the A/B update method

  • We would have to build two binaries for each update and serve one depending on the partition address/label (i.e. update could be programmed into either part-A or part-B).
  • Technically, this is possible but to do this in the A/B context, we must have a way to communicate extra information to an update-backend.

The firmware's update client can either

  • use an update-specific protocol or instruction when signaling the backend to return an update for partition A (or B) or
  • use some binary-encoding scheme (i.e. byte-representation) embedded in the image to signal this information.

In practice, this is a bit difficult to deploy and error-prone. The other issue with an A/B approach is that we cant use external devices/memories that are not memory mapped for updates. For ex: we cant use SPI-flash

Fixed boot partition and swapping: This approach is also referred to as the boot/update approach. All images are compiled to boot from partition A, updates are stored in partition B and swapped in the event of an update.

  • This is a more flexible approach and is generally easier to deploy in the field (without the risk of bricking or corrupting the system).
  • The flip-side though is that the 'swapping-logic or code' needs to be reliable and safe. (this is where rust comes in)

Support for A/B partitions: for rustBoot, the swap model makes sense as its supposed to be micro-architecture and OS agnostic. However, in the case of Linux, I presume none of the above applies as compiled kernel images (i.e. binary) are not position dependent.

  • In this case, instead of the direct-XIP method or execute-in-place from flash used by mcu's, we can simply do a RAM-BOOT
  • either load from the active partition (say A) into RAM or download the update image into the inactive partition (say B), verify it and if it checks-out, load into RAM and pass control to it.
  • i.e. no swapping involved
  • The plan to support ram-boot exists but since this is the preferred way to boot linux images, we can priortize this.
  • Note - for devices that support it, we will add dual-bank flash swaps as well.

from rustboot.

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.