DunstFabric
All connected Dunstwolke devices will form a common fabric which allows IPC calls between different applications, even if those run on different devices.
Each device runs a central fabric daemon that will perform discovery of known devices and will do all dispatching of system calls. The fabric daemon is also able to spawn applications.
Applications are written in Wasm or in a native language. Wasm applications can be transferred seamlessly between devices, while native applications are tied to the host machine.
Application Design
Applications have a entry point that will set up the application, but in contrast to other operating systems, the entry point will return to the OS. Now when events happen, the applications will be called with a set of events that lead to the wakeup of the application. The purpose of the entry point is only initialization and request of events.
Syscall Design
The following sections describe the rough ideas of a system call design for the Dunstwolke Fabric.
Fabric Management
listKnownDevices() []Devicelists all devices in the current fabriclistAvailableDevices() []Devicelists all devices that are available at the momentremoveDevice(Device) voidremoves a device from the fabricaddDevice() Devicepairs a new device to the fabric
Process Management
listProcesses() []{ Pid, Device }lists all running processeslistProcesses(Device) []Pidlists all running processes for a devicegetProcessStats(Pid) ?struct { … }returns the statistics for a process if anykill(Pid) voidkills a given processspawn(File, []String) Pidspawns a new process with the given args and filemoveProcess(Pid, Device) voidmoves a process to a new device
IPC
The IPC of the fabric will work from applications to other applications targeting a certain subsystem identified by a Guid.
createIpcService(Guid, display_name) ServiceHandlewill make this application provide a new IPC subsystemdestroyIpcService(ServiceHandle) voidwill shut down a previously established IPC subsystemgetIpcMessage(ServiceHandle, blocking, *Pid, *[]u8) boolwill receive a IPC messagesendIpcMessage(Guid, ?Pid, []u8)will send a message to the serviceGuidwith an optional target application
TODO: How to manage IPC responses? A non-Service might want to have answer to things
Network
Network system calls operate on the ip address of the fabric. Each fabric will have a one or more outbound ip address which are routed via a single device. An application creating the socket for an ip does not have to run on the same device that has this ip.
createUdpSock(ip, port) UdpSocketHandlecreates a new udp socket bound to the given portcloseUdpSock(UdpSocketHandle) voiddestroys a previously created socketsendTo(UdpSocketHandle, ip, port, []u8) usizesends data to a udp addressreceiveFrom(UdpSocketHandle, *ip, *port, *[]u8) usizereads data from the udp portgetSocketName(UdpSocketHandle, *ip, *port) void