Many parts of Twili have been moved to separate directories.
twib: PC-side bridge client
twili: Main twili sysmodule
twili/bridge: Bridge code
twili/bridge/interfaces: Twib endpoints
twili/bridge/tcp: TCPBridge implementation
twili/bridge/usb: USBBridge implementation
twili/ipcbind: Renamed from service, contains IPC client code for various services
twili/msgpack11: msgpack11 submodule
twili/process: Process management code. Most of this stuff is new.
twili/process/fs: Virtual filesystem code
twili/service: IPC service code
twili_applet_shim: Applet code
twili_common: Code common between two or more of twili, twili_applet_shim, or twili_launcher.
twili_launcher: Deprecated twili launcher applet.
Process management has been greatly reorganized.
Process: Base class. Exposes GetPid, AddNotes, and Terminate.
MonitoredProcess: Process started by Twili.
ManagedProcess: This is what used to be MonitoredProcess. These are the processes that hide from pm and are managed by Twili.
AppletProcess: Library applet managed by am/pm.
UnmonitoredProcess: Shim for quick operations on arbitrary processes.
Applet Summary
twili_applet_shim overrides the album applet. When it is launched, it connects to Twili and opens an IAppletShim. Twili checks against the AppletTracker to see if it already has a "control applet". If it does not, the twili_applet_shim becomes a control applet, which waits for messages from Twili. When an AppletProcess is Launch()ed, it is added to a queue in AppletTracker and a message is sent to the control applet to spawn another instance of twili_applet_shim through am's ILibraryAppletCreator interface, and to use a new loader extension to request that the loader add enough extra memory to fit the target process image in. When this instance of twili_applet_shim opens its IAppletShim, since Twili already has a control applet, it will then check if there are any AppletProcesses queued. If there are, the new twili_applet_shim becomes a "host" applet. The target process image is loaded into the host applet and it jumps to the entrypoint.
Todo
[x] Get the Atmosphere extension merged.
[x] Add a command line option to twib to specify whether to launch as an AppletProcess or a ManagedProcess.
[x] Have the control applet inform Twili of errors when launching applets.
[x] Have the control applet inform Twili when a host applet exits.
[x] Defer the ITwibDeviceInterface::Run response until after the host applet attaches and we know the PID.
Closes #5. Finally. :eyes:
Summary
Many parts of Twili have been moved to separate directories.
twili
sysmoduleservice
, contains IPC client code for various servicesProcess management has been greatly reorganized.
GetPid
,AddNotes
, andTerminate
.pm
and are managed by Twili.Applet Summary
twili_applet_shim overrides the album applet. When it is launched, it connects to Twili and opens an
IAppletShim
. Twili checks against theAppletTracker
to see if it already has a "control applet". If it does not, the twili_applet_shim becomes a control applet, which waits for messages from Twili. When anAppletProcess
isLaunch()
ed, it is added to a queue inAppletTracker
and a message is sent to the control applet to spawn another instance of twili_applet_shim through am's ILibraryAppletCreator interface, and to use a new loader extension to request that the loader add enough extra memory to fit the target process image in. When this instance of twili_applet_shim opens itsIAppletShim
, since Twili already has a control applet, it will then check if there are anyAppletProcess
es queued. If there are, the new twili_applet_shim becomes a "host" applet. The target process image is loaded into the host applet and it jumps to the entrypoint.Todo
twib
to specify whether to launch as anAppletProcess
or aManagedProcess
.ITwibDeviceInterface::Run
response until after the host applet attaches and we know the PID.