Towards capabilities in HelenOS Towards capabilities in HelenOS
The elephant in the room The elephant in the room
Jakub Jermář
jakub@jermar.eu
http://www.helenos.org http://www.helenos.org
Towards capabilities in HelenOS Towards capabilities in HelenOS The - - PowerPoint PPT Presentation
Towards capabilities in HelenOS Towards capabilities in HelenOS The elephant in the room The elephant in the room http://www.helenos.org http://www.helenos.org Jakub Jerm jakub@jermar.eu HelenOS in a nutshell HelenOS in a nutshell
jakub@jermar.eu
http://www.helenos.org http://www.helenos.org
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 2
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 3
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 4
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 5
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 6
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 7
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 8
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 9
Parent Parent Child Child VFS VFS Kernel Kernel
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 10
Parent Parent Child Child VFS VFS Kernel Kernel
5.
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 11
– Two clients of a server can negotiate a change of
– All VFS files map to single kernel object – Actively involves the server + kernel notification
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 12
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 13
Parent Parent Child Child VFS VFS Kernel Kernel
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 14
Parent Parent Child Child VFS VFS Kernel Kernel
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 15
– Mechanism to create (callback) IPC connections – Does not currently accept a port number – VFS not involved – One kernel object per one VFS file
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 16
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 17
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 18
– A microkernel should not assign devno’s – No enforcement to use the devno for registration – Everyone can unregister any IRQ handler
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 19
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 20
– Capability handles are task-local – Need to posses the capability in order to unregister
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 21
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 22
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 23
Task Task Task Task
Answerbox Answerbox Phones Answerbox Answerbox Phones ipc_call_async_fast(2, method, arg1, arg2, arg3, ...) ipc_wait_for_call_timeout ipc_wait_for_call_timeout ipc_answer_fast(callid, retval, arg1, arg2, arg3, arg4)
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 24
Task Task Task Task Task Task
Answerbox Answerbox Answerbox Answerbox Phones Answerbox Answerbox Phones Phones ipc_call_async_fast(2, method, arg1, arg2, arg3, ...) ipc_wait_for_call_timeout ipc_wait_for_call_timeout ipc_answer_fast(callid, retval, arg1, arg2, arg3, arg4) ipc_forward_fast(callid, 5, method, arg1, arg2, ...) ipc_wait_for_call_timeout
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 25
Task Task Task Task Task Task
Answerbox Answerbox Answerbox Answerbox Phones Answerbox Answerbox Phones Phones ipc_call_async_fast(2, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, ...) ipc_wait_for_call_timeout ipc_wait_for_call_timeout ipc_answer_fast(callid, EOK, arg1, arg2, arg3, arg4) ipc_forward_fast(callid, 5, IPC_M_CONNECT_ME_TO, arg1, arg2, ...) ipc_wait_for_call_timeout
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 26
Task Task Task Task Task Task
Answerbox Answerbox Answerbox Answerbox Phones Answerbox Answerbox Phones Phones ipc_call_async_fast(2, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3, ...) ipc_wait_for_call_timeout ipc_wait_for_call_timeout ipc_answer_fast(callid, EOK, arg1, arg2, arg3, arg4) ipc_forward_fast(callid, 5, IPC_M_CONNECT_TO_ME, arg1, arg2, ...) ipc_wait_for_call_timeout
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 27
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 28
Mach HelenOS Unit of IPC communication Message Call IPC communication endpoint Port Answerbox IPC connection Send Right Phone Receive from IPC endpoint Receive Right ipc_wait_for_call_timeout() implicitly receives from task’s answerbox Right to answer Sender includes send-once right to a reply port Implicit via received call Give connection to third- party Reply with send right Forward IPC_M_CONNECT_ME_TO call
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 29
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 30
Answerbox Answerbox Phones 3 2 1 Async Ports
~ ~ ~ ~
Answerbox Answerbox Phones (4, 1) (4, 2) (7, 3)
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 31
kobject_t .type = KOBJECT_TYPE_CALL .refcnt = 3 kobject_t .type = KOBJECT_TYPE_CALL .refcnt = 3 call_t call_t cap_t .state = CAP_STATE_PUBLISHED .task = <task A> .handle = 5 cap_t .state = CAP_STATE_PUBLISHED .task = <task A> .handle = 5 cap_t .state = CAP_STATE_PUBLISHED .task = <task A> .handle = 13 cap_t .state = CAP_STATE_PUBLISHED .task = <task A> .handle = 13 Reference from code Answerbox Answerbox 3 2 1 Async Ports
~ ~ ~ ~
Answerbox Answerbox (4, 1) (4, 2) (7, 3) Capabilities 4 4 7 7 c c c c c c c Capabilities p p i IRQ
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 32
– Arbitrary number of answerboxes – Pair with user-level async ports – Where does the answer go to?
– Get rid of the remaining global IDs – Get rid of existence checks
3 2 1 Async Ports
~ ~ ~ ~
(4) (6) (7) Capabilities 4 4 7 7 6 6 c c c c c c c Capabilities p p i IRQ a a a p ~ t thread task
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 33
– We removed some arbitrary resource limits
– Per-task resource pools to compensate – Service-for-resource trading
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 34
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 35
Jakub Jermář, FOSDEM 2018, February 3rd Towards capabilities in HelenOS 36