Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An Introduction to Drawbridge(ja)

An Introduction to Drawbridge(ja)

Yuma Kurogome

June 06, 2015
Tweet

More Decks by Yuma Kurogome

Other Decks in Programming

Transcript

  1. 7 1967 1969 1975 1987 1978 1991 1995 MTS MINIX

    L4 Exokernel Unics UNIXv6 BSD Linux
  2. 2013 • OSv, Mirage OS, Rump Kernels, ClickOS • USENIX

    ATC’14 OSv 16 + OS – …… https://www.linux.com/images/stories/41373/unikernel-illustration.png
  3. Memory Management Primitives • DkVirtualMemoryAlloc • DkVirtualMemoryFree • DkVirtualMemoryProtect Thread

    Primitives • DkThreadCreate • DkThreadDelayExecution • DkThreadYieldExecution • DkThreadExit • DkThreadGetParameter • DkThreadRaiseException • DkNotificationEventCreate • DkSynchronizationEventCreate • DkSemaphoreCreate • DkSemaphoreRelease • DkSemaphorePeek • DkEventSet • DkEventClear • DkEventPeek • DkObjectsWaitAny • DkAbortEventRegister Child Process Primitives • DkProcessCreate • DkProcessGetExitCode • DkProcessExit 24 I/O Stream Primitives • DkStreamOpen • DkStreamRead • DkStreamWrite • DkStreamMap • DkStreamMapPeBinary • DkStreamUnmap • DkStreamSetLength • DkStreamFlush • DkStreamDelete • DkStreamGetEvent • DkStreamRename • DkStreamEnumerateChildren • DkStreamAttributesQuery • DkStreamAttributesQueryByHandle Other Primitives • DkSystemTimeQuery • DkRandomBitsRead • DkInstructionCacheFlush • DkObjectReference • DkObjectClose • DkInputEventRead • DkFrameBufferExport • DkFrameBufferNotifyUpdate • DkDebugStringPrint Upcalls • LibOsInitialize • LibOsThreadStart • LibOsExceptionDispatch Files/Storage • file: Console Redirection • null: • stderr: • stdin: • stdout: Named Pipes • pipe.client: • pipe.server: TCP/IP Stack • dns: • tcp.client: • tcp.server: • tcp: HTTP.SYS • http.application: • http.server:
  4. Drawbridge • Hyper-V • At the time of writing, Microsoft

    has no plans to productize any of the concepts prototyped in Drawbridge. 25
  5. OS • Drawbridge Mirage OS OSv OS Linux CoreOS 26

    1982 2000 2005 2008 2011 2013 OSv Mirage OS FreeBSD jail Solaris Zone Cgroups Namespace LXC 2014 Docker chroot 1995 Exokernel Drawbridge CoreOS
  6. picoprocess • Windows 8.1 • Windows 10 Build 10074 •

    PspPicoRegistrationDisabled 35 _ETHREAD+0x770 PicoContext : Ptr64 Void _EPROCESS+0x6a8 PicoContext : Ptr64 Void _EPROCESS + 0x6f0 PicoContext: Ptr64 Void _ETHREAD + 0x788 PicoContext : Ptr64 Void
  7. picoprocess C:¥Program Files (x86)¥Windows Kits¥10¥Include¥10.0.10075.0¥um¥minwin¥ntosp.h 36 typedef struct _PS_PICO_THREAD_ATTRIBUTES {

    HANDLE Process; ULONG_PTR UserStack; ULONG_PTR StartRoutine; ULONG_PTR StartParameter1; ULONG_PTR StartParameter2; … ULONG UserFsBase; ULONG UserGsBase; … USHORT UserFsSeg; USHORT UserGsSeg; ULONG_PTR Eax; … PVOID Context; } PS_PICO_THREAD_ATTRIBUTES, *PPS_PICO_THREAD_ATTRIBUTES; • • FS/GS KPCR
  8. picoprocess C:¥Program Files (x86)¥Windows Kits¥10¥Include¥10.0.10075.0¥um¥minwin¥ntosp.h 37 #if (NTDDI_VERSION >= NTDDI_THRESHOLD)

    _IRQL_requires_max_(PASSIVE_LEVEL) NTKERNELAPI NTSTATUS PsRegisterPicoProvider ( _In_ PPS_PICO_PROVIDER_ROUTINES ProviderRoutines, _Out_ PPS_PICO_ROUTINES PicoRoutines ); #endif typedef struct _PS_PICO_PROVIDER_ROUTINES { PPS_PICO_PROVIDER_SYSTEM_CALL_DISPATCH DispatchSystemCall; PPS_PICO_PROVIDER_THREAD_EXIT ExitThread; PPS_PICO_PROVIDER_PROCESS_EXIT ExitProcess; PPS_PICO_PROVIDER_DISPATCH_EXCEPTION DispatchException; } PS_PICO_PROVIDER_ROUTINES, *PPS_PICO_PROVIDER_ROUTINES; picoprocess
  9. picoprocess C:¥Program Files (x86)¥Windows Kits¥10¥Include¥10.0.10075.0¥um¥minwin¥ntosp.h 38 typedef struct _PS_PICO_ROUTINES {

    PPS_PICO_CREATE_PROCESS CreateProcess; PPS_PICO_CREATE_THREAD CreateThread; PPS_PICO_GET_PROCESS_CONTEXT GetProcessContext; PPS_PICO_GET_THREAD_CONTEXT GetThreadContext; PPS_GET_CONTEXT_THREAD_INTERNAL GetContextThreadInternal; PPS_SET_CONTEXT_THREAD_INTERNAL SetContextThreadInternal; PPS_TERMINATE_THREAD TerminateThread; PPS_RESUME_THREAD ResumeThread; PPS_PICO_SET_THREAD_DESCRIPTOR_BASE SetThreadDescriptorBase; PPS_SUSPEND_THREAD SuspendThread; } PS_PICO_ROUTINES, *PPS_PICO_ROUTINES;
  10. picoprocess C:¥Program Files (x86)¥Windows Kits¥10¥Include¥10.0.10075.0¥um¥minwin¥ntosp.h 39 typedef NTSTATUS PS_PICO_CREATE_PROCESS (

    _In_ PPS_PICO_PROCESS_ATTRIBUTES ProcessAttributes, _Outptr_ PHANDLE ProcessHandle ); typedef PS_PICO_CREATE_PROCESS *PPS_PICO_CREATE_PROCESS; typedef VOID PS_PICO_PROVIDER_SYSTEM_CALL_DISPATCH ( _In_ PPS_PICO_SYSTEM_CALL_INFORMATION SystemCall ); typedef PS_PICO_PROVIDER_SYSTEM_CALL_DISPATCH *PPS_PICO_PROVIDER_SYSTEM_CALL_DISPATCH;
  11. Server Silo Functions C:¥Program Files (x86)¥Windows Kits¥10¥Include¥10.0.10075.0¥um¥minwin¥ntosp.h 41 typedef struct

    _CONTAINER_ID_INFO { GUID ContainerId; ULONG Flags; } CONTAINER_ID_INFO, *PCONTAINER_ID_INFO; typedef enum _CONTAINER_TYPE { ContainerTypeCpu, ContainerTypeDiskIo, ContainerTypeNetIo, // ContainerTypeWorkingSet, ContainerTypeHeap, ContainerTypeImmediate, ContainerTypeMaximumList } CONTAINER_TYPE, *PCONTAINER_TYPE;
  12. Server Silo Functions C:¥Program Files (x86)¥Windows Kits¥10¥Include¥10.0.10075.0¥um¥minwin¥ntosp.h 42 #if (NTDDI_VERSION

    >= NTDDI_WIN10) _IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI NTSTATUS PsGetEffectiveContainerId( _In_ CONTAINER_TYPE ContainerType, _In_ PETHREAD Thread, _Out_ PCONTAINER_ID_INFO ContainerIdInfo ); #endif
  13. Silo? Windows 10 picoprocess, Silo 44 1982 2000 2005 2008

    2011 2013 OSv Mirage OS FreeBSD jail Solaris Zone Cgroups Namespace LXC 2014 Docker chroot 1995 Exokernel Drawbridge CoreOS picoprocess LibOS ?
  14. Windows Docker Drawbridge • Azure Madhan Ramakrishnan Regarding Drawbridge, as

    you pointed out it is an internal research project that we have been innovating on, and that has helped us gain valuable experience with containers. Much of what we announced today was born from the experience that we had with Drawbridge and we are excited to bring container technologies to Windows Server and the Docker ecosystem along with Linux. We think the combination of our own hypervisor for container virtualization and Docker containers for creating a unified deployment and management experience is a compelling scenario for our customers. 45 https://news.ycombinator.com/item?id=8461111
  15. • D. R. Engler, M. F. Kaashoek and J. O'Toole,

    Jr., "Exokernel: An Operating System Architecture for Application-Level Resource Management," SOSP’95 Proceedings of the 15th ACM symposium on Operating systems principles, pp. 251- 266, 1995. • Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt and Andrew Warfield, "Xen and the Art of Virtualization," SOSP’03 Proceedings of the 19th ACM symposium on Operating systems principles, pp. 164-177, 2003. • Donald E. Porter, Silas Boyd-Wickizer, Jon Howell, Reuben Olinsky and Galen C. Hunt, "Rethinking the Library OS from the Top Down," ASPLOS’11 Proceedings of the 16th international conference on Architectural support for programming languages and operating systems, pp. 291-304, 2011. • Anil Madhavapeddy, Richard Mortier, Charalampos Rotsos, David Scott, Balraj Singh, Thomas Gazagnaire, Steven Smith, Steven Hand and Jon Crowcroft, "Unikernels: Library Operating Systems for the Cloud," ASPLOS’13 Proceedings of the 18th international conference on Architectural support for programming languages and operating systems, pp. 461-472, 2013. 46
  16. • Andrew Baumann, Dongyoon Lee, Pedro Fonseca, Lisa Glendenning, Jacob

    R. Lorch, Barry Bond, Reuben Olinsky and Galen C. Hunt, "Composing OS Extensions Safely and Efficiently with Bascule," EuroSys’13 Proceedings of the 8th ACM European Conference on Computer Systems, pp. 239-252, 2013. • Andrew Baumann, Marcus Peinado and Galen Hunt, "Shielding Applications from an Untrusted Cloud with Haven," OSDI’14 Proceedings of the 11th USENIX conference on Operating Systems Design and Implementation, pp. 267-283, 2014. • Avi Kivity, Dor Laor, Glauber Costa, Pekka Enberg, Nadav Har'El, Don Marti and Vlad Zolotarov, "OSv: Optimizing the Operating System for Virtual Machines," USENIX ATC’14 Proceedings of the 2014 USENIX conference on USENIX Annual Technical Conference, pp. 61-72, 2014. • Jacob R. Lorch, Andrew Baumann, Lisa Glendenning, Dutch Meyer and Andrew Warfield, "Tardigrade: Leveraging Lightweight Virtual Machines to Easily and Efficiently Construct Fault-Tolerant Services," NSDI’15 Proceedings of the 12th USENIX Symposium on Networked Systems Design and Implementation, pp. 574- 588, 2015. 47