I am developing an embedded application on an ARM platform. I want to use ArchLinux as the underlying operating system and then create my own GUI. I want the application to be extendable (have apps if you wish).
I want to be able to run these 3rd party apps in a sandbox to limit security issues. I want the developers to have as much freedom as possible without giving access to potentially dangerous features. I also need to be able to overlay toolbars over the apps when swipes happen from the sides (Think Android when you're in a full screen app but if you swipe from the side, you can still pull up the Android notification bar and the Android navigation buttons).
The way I see things currently, I would have my application running and when it loads it would look in a directory to see all the installed 'apps'. The apps would each have their own folder. Then when a user runs an app, I would:
fork -> change root directory to app directory -> set app user id to a user with low privileges -> exec app -> pipe graphic output back to main app.
When I say pipe graphic output back, I mean literally stream like a video through a pipe.
Then I can use ptrace to trace what the applications are doing and take control back if the children application crashes or exit or anything of the sort. This method also allows me to overlay my things when necessary.
My main concern right now is performance if the app has to pipe its graphic output to the main program.
Is this a viable solution or is this naive? The other option I'm seeing is to actually create a graphic API with XML files a la Android and then the rendering would happen from within the main application. The main application would load XML layout files from the apps directory and render the contents itself. This would be much more time consuming mind you and would restrain the developers a bit more.
Any input is appreciated, especially if you have experience with modular applications.