towards capabilities in helenos towards capabilities in
play

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


  1. 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

  2. HelenOS in a nutshell HelenOS in a nutshell ● Portable microkernel-based multiserver OS ● Designed and implemented from scratch ● Not a clone of any existing OS / API ● Virtually no third-party code ● Fine-grained userspace components BRUSSELS 3 FEBRUARY - 4 F 2 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  3. Since last FOSDEM... Since last FOSDEM... ● HelenOS 0.7.0 (April) ● HelenOS 0.7.1 (November) ● HelenOS Camp 2017 ● Fork us on GitHub! ● CZ.NIC feeds one HelenOS developer BRUSSELS 3 FEBRUARY - 4 F 3 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  4. Coming soon Coming soon ● C++14 support ● USB 3.0 support BRUSSELS 3 FEBRUARY - 4 F 4 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  5. Google Summer of Code Google Summer of Code ● Microkernel devroom ● Organizations Announced on February 12 ● Student Application Period starts on March 12 ● http://gsoc.microkernel.info/ BRUSSELS 3 FEBRUARY - 4 F 5 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  6. Terminology Terminology Capability: Task-local name for a reference to a kernel object; userspace uses integer handles to refer to capabilities Kernel objects: Reference-counted wrappers for a select group of objects allocated in and by the kernel that can be made accessible to userspace in a controlled way via capability handles BRUSSELS 3 FEBRUARY - 4 F 6 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  7. Motivation Motivation ● Fix broken mechanisms ● Reduce number of mechanisms ● Fix broken interfaces ● Get rid of global names ● Modernize the system BRUSSELS 3 FEBRUARY - 4 F 7 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  8. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? BRUSSELS 3 FEBRUARY - 4 F 8 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  9. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? Kernel Kernel VFS VFS Parent Child Parent Child BRUSSELS 3 FEBRUARY - 4 F 9 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  10. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? Kernel Kernel 4. EVENT_TASK_STATE_CHANGE VFS VFS 6. VFS_WAIT_IN_HANDLE 7. EOK 5. 3. EOK Parent Child 2. IPC_M_STATE_CHANGE_AUTHORIZE Parent Child 8. EOK BRUSSELS 3 FEBRUARY - 4 F 1. LOADER_SET_FILES 10 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  11. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? IPC_M_CHANGE_AUTHORIZE – Two clients of a server can negotiate a change of their state kept in the server – All VFS files map to single kernel object – Actively involves the server + kernel notification BRUSSELS 3 FEBRUARY - 4 F 11 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  12. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? BRUSSELS 3 FEBRUARY - 4 F 12 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  13. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? Kernel Kernel VFS Parent Child VFS Parent Child BRUSSELS 3 FEBRUARY - 4 F 13 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  14. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? Kernel Kernel 1. IPC_M_CONNECT_TO_ME(port = 6) VFS Parent Child VFS Parent Child BRUSSELS 3 FEBRUARY - 4 F 2. EOK 14 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  15. Example: passing files Example: passing files ● How to pass an open file which exists in the VFS server from the parent task to the child? IPC_M_CONNECT_(TO_ME/ME_TO) – Mechanism to create (callback) IPC connections – Does not currently accept a port number – VFS not involved – One kernel object per one VFS file BRUSSELS 3 FEBRUARY - 4 F 15 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  16. Example: IRQ handlers Example: IRQ handlers ● Device drivers can register an IRQ handler. How to identify the handler so that it can be unregistered? BRUSSELS 3 FEBRUARY - 4 F 16 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  17. Example: IRQ handlers Example: IRQ handlers ● Device drivers can register an IRQ handler. How to identify the handler so that it can be unregistered? Before HelenOS 0.7.1 g_devno = SYS_DEVICE_ASSIGN_DEVNO() SYS_IPC_IRQ_SUBSCRIBE(irq, g_devno, …) SYS_IPC_IRQ_UNSUBSCRIBE(irq, g_devno) BRUSSELS 3 FEBRUARY - 4 F 17 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  18. Example: IRQ handlers Example: IRQ handlers ● Device drivers can register an IRQ handler. How to identify the handler so that it can be unregistered? Before HelenOS 0.7.1 g_devno = SYS_DEVICE_ASSIGN_DEVNO() SYS_IPC_IRQ_SUBSCRIBE(irq, g_devno, …) SYS_IPC_IRQ_UNSUBSCRIBE(irq, g_devno) – A microkernel should not assign devno’s – No enforcement to use the devno for registration – Everyone can unregister any IRQ handler BRUSSELS 3 FEBRUARY - 4 F 18 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  19. Example: IRQ handlers Example: IRQ handlers ● Device drivers can register an IRQ handler. How to identify the handler so that it can be unregistered? BRUSSELS 3 FEBRUARY - 4 F 19 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  20. Example: IRQ handlers Example: IRQ handlers ● Device drivers can register an IRQ handler. How to identify the handler so that it can be unregistered? Since HelenOS 0.7.1 handle = SYS_IPC_IRQ_SUBSCRIBE(irq, …) SYS_IPC_IRQ_UNSUBSCRIBE(handle) – Capability handles are task-local – Need to posses the capability in order to unregister BRUSSELS 3 FEBRUARY - 4 F 20 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  21. Elephant in the room Elephant in the room ● Capabilities are great ● How to introduce them to HelenOS? BRUSSELS 3 FEBRUARY - 4 F 21 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  22. Elephant in the room Elephant in the room ● Capabilities are great ● How to introduce them to HelenOS? ● We don’t have to (start from scratch) ● HelenOS already has them (in a limited way) BRUSSELS 3 FEBRUARY - 4 F 22 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

  23. Basic HelenOS RPC Basic HelenOS RPC Phones Phones ipc_call_async_fast(2, method, arg1, arg2, arg3, ...) Answerbox Answerbox Answerbox Answerbox ipc_wait_for_call_timeout ipc_wait_for_call_timeout Task Task Task Task BRUSSELS 3 FEBRUARY - 4 F ipc_answer_fast(callid, retval, arg1, arg2, arg3, arg4) 23 Jakub Jermář , FOSDEM 2018, February 3 rd Towards capabilities in HelenOS 8000+ hackers 600+ lectures lightning talks devrooms beer

Recommend


More recommend