So my Zig PinePhone OS is ready for some Apps
After my recent refactoring, I now have quite a nice client API. So I can easily build and include some simple Apps with the OS.
But if I want to distribute bigger Apps separately, I’m a bit lost. I’m new to OS/systems programming, so looking for some guidance please. e.g. my OS is loaded, and user selects a binary to load from the SD card.
My first idea is to build my OS with a know address range of API function pointers that a 2nd binary can lookup? Maybe the first bunch of 32bits numbers in the OS binary are a fixed address set of API function pointers, that somehow get updated each time I build my OS. Looks like @intFromPtr on some fn pointers is the way to go there?
A loaded binary/App can then lookup these address/fn pointer u32 from that table, and goto that address.
Am I on the right track with my thinking? How do my Apps have a nice API to work with, that doesnt have implementation until loaded by my OS? Do I just have some kinda dummy API stubs that do goto? I thought @call might be it, but that seems to require compile time known symbols? So maybe some assembly is the way to goto? ![]()