@173210 I wanna hear your plan of plugin support. That is .. a little outstanding.
0.No functions provided by Host. Plugin just gets the functions included, as how NTR plugin does. Then just get its entrypoint, allocate enough memory to load it.
1.Host program offers some common used functions, such as FATFS/FS, Crypto to Plugin. With SDK header, and the structure including those function pointers set, Plugin could get all offered functions. It is too simple, and sort of ugly. Once the offered functions increased, the structure would be affected.
2.Host offers functions, but Plugin must request them. When loading plugin, it checks the functions' string requested (such as "setaes", "f_mount"..) and prepare the pointer array. Once loaded, plugin gets those functions' addresses from the array/structure passed and uses them. You could even make libraries plugin that others depends on, just let it pass what it offers once loaded. Similar as above, still need a binary format, but no real structure would be totally affected.
3.If you prefer ELF format and are quite an expert on playing with it, you are free to go. I don't know the difficulty of loading/parsing an ELF (cause my poor experience). The methods listed above surely aren't so perfect, but you could use main in plugin (and get the code to be a plain binary).
Hope you could face fewer barriers on the way to it.
0.No functions provided by Host. Plugin just gets the functions included, as how NTR plugin does. Then just get its entrypoint, allocate enough memory to load it.
1.Host program offers some common used functions, such as FATFS/FS, Crypto to Plugin. With SDK header, and the structure including those function pointers set, Plugin could get all offered functions. It is too simple, and sort of ugly. Once the offered functions increased, the structure would be affected.
2.Host offers functions, but Plugin must request them. When loading plugin, it checks the functions' string requested (such as "setaes", "f_mount"..) and prepare the pointer array. Once loaded, plugin gets those functions' addresses from the array/structure passed and uses them. You could even make libraries plugin that others depends on, just let it pass what it offers once loaded. Similar as above, still need a binary format, but no real structure would be totally affected.
3.If you prefer ELF format and are quite an expert on playing with it, you are free to go. I don't know the difficulty of loading/parsing an ELF (cause my poor experience). The methods listed above surely aren't so perfect, but you could use main in plugin (and get the code to be a plain binary).
Hope you could face fewer barriers on the way to it.