Skip to content
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

PoC: Persistent storage #273

Closed
wants to merge 26 commits into from
Closed

PoC: Persistent storage #273

wants to merge 26 commits into from

Conversation

dehanj
Copy link
Member

@dehanj dehanj commented Oct 14, 2024

Description

Draft PR, WIP. Some parts of this are still to be considered as a proof of concept.

Fixes # (issues)

Type of change

  • Feature (non breaking change which adds functionality)
  • Breaking Change (a change which would cause existing functionality to not work as expected)

Submission checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my changes
  • I have tested and verified my changes on target
  • My changes are well written and CI is passing
  • I have squashed my work to relevant commits and rebased on main for linear history
  • I have added a "Co-authored-by: x" if several people contributed, either pair programming or by squashing commits from different authors.
  • I have updated the documentation where relevant (readme, dev.tillitis.se etc.)
  • QEMU is updated to reflect changes

@dehanj dehanj requested a review from mchack-work October 14, 2024 12:41
@mchack-work mchack-work changed the title Persistant storage fw Persistent storage fw Oct 14, 2024
@dehanj dehanj changed the title Persistent storage fw PoC: Persistent storage Oct 14, 2024
@mchack-work mchack-work linked an issue Oct 14, 2024 that may be closed by this pull request
@dehanj dehanj force-pushed the persistant_storage_fw branch 2 times, most recently from 7189f4b to baeff05 Compare October 23, 2024 09:48
@mchack-work
Copy link
Member

mchack-work commented Oct 26, 2024

I have tested the firmware in a patched qemu running in firmware mode all the time. I tried the management app, installed preloaded app, started it, and watched the partition table while all this was happening. The syscalls seem to work fine.

I was a bit surprised that the preloaded app wasn't started automatically but I understand that part isn't implemented yet. Perhaps it's good to wait, because I think it's still unclear (#214) how we even would signal back to the firmware how not to start the preloaded app. On the other hand, perhaps now is the time to experiment with different solutions?

There are more things that aren't yet implemented. The TODO notes are fine, of course, but they're often just shorthand notes and doesn't explain what more needs to be done. I suggest we track these things in issues or just tasks in an issue, but at least flesh them out a little.

Since the current PoC just reuses the BLAKE2S MMIO to get to the firmware syscall handler it requires support in the hardware to watch PC all the time and raise the privelege when PC hits the blessed address stored in BLAKE2S. I'm worried about if this solution is possible to do in the hardware design without changing PicoRV32. It's certainly not easy to emulate in qemu.

I looked a lot in qemu and did some experiments with the other suggestion in #234, that is to write something to an MMIO to trigger the syscall. That is certainly easier to catch in both hardware and qemu, even if affecting PC directly might still be unsolved.

@dehanj dehanj force-pushed the persistant_storage_fw branch from baeff05 to 92cf6a9 Compare November 4, 2024 07:48
Add an erase command to let the user have more control over the
allocated area. This will also be more familiar to embedded developers.
As a bonus it minimizes the logic needed in firmware, and in theory we
can now increase the current write limit of one sector.
@dehanj dehanj force-pushed the persistant_storage_fw branch from 92cf6a9 to 3771726 Compare November 11, 2024 11:38
@dehanj
Copy link
Member Author

dehanj commented Nov 14, 2024

See #298 instead, this branch is stale now.

@dehanj dehanj closed this Nov 14, 2024
@dehanj dehanj mentioned this pull request Nov 14, 2024
12 tasks
@dehanj dehanj deleted the persistant_storage_fw branch November 22, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants