Elektrine lite

← Feed

@sunfish@hachyderm.io

Post #1136743

2022-12-06 16:58 UTC

In hardware designs, memory-mapped registers (MMRs) are widely used because they're a way to add I/O devices without making changes to the CPU. Exposing these features to Wasm doesn't necessarily require them to be represented as memory-mapped at the Wasm level though. We can have imported host functions that do loads and stores to the desired hardware addresses. #wasm #wasi

Replies (1)

  • @sunfish@hachyderm.io 2022-12-06 17:00

    And when we represent I/O as calls to imported functions, instead of loads and stores to mapped memory, we make the code easier to virtualize. For example, one could write an emulator for the hardware just by having an implementation of the functions.

    Open ##2085723