You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@xobs moving conversation from #7 to this issue. Quoting the whole response here for continuity.
I was having a chat with @mithro, and the idea came up to use a thunked syscall interface.
The idea being that you'd have a function at a well-known address, or an address defined in a LiteX CSR, or an address defined in a RISC-V MSR, that has a function signature such as:
...or similar. Maybe the params would be different. But we'd define family and syscall as enum pairs. For example, "reboot" might be in the "system" family. Using 32-bit IFF-style tags, such a call might be:
syscall('syst', 'boot', 0x20040000, NULL);
Because the boot ROM is currently always memory-mapped, we could fix it at address 0x100, so any machine-level program could cast that value to a function pointer and make syscalls.
Then, as part of the BIOS for various platforms, you'd implement syscall:
Agreed, we could also define inlines/macros to make the code more readable.
syscall('syst', 'boot', 0x20040000, NULL);
could become syscall_syst_boot(0x20040000);
Once we have the i/o for the bootloader defined in this manner we can take a look at defining some platform i/o for micropython. Stuff like rgb would be platform specific but we can define a very basic interface that exposes n buttons, n leds and a set of n io pins. On fomu the buttons could be touch under the hood. We'd also want to look ahead to circuitpython and make sure we can define an optional platform i2c in some manner too.
Need to be able to parameterise the software to allow the same s/w binary to run on different platforms.
An incomplete list would be
Some/all of this could come from a litex platform capabilities mechanism.
The text was updated successfully, but these errors were encountered: