1 / 21

The Mach System

The Mach System. "Operating Systems Concepts, Sixth Edition" by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne Presented by Abdelhalim Ragab Portland State University CS533 Concepts of Operating Systems. Microkernel vs. Monolithic Systems.

halil
Télécharger la présentation

The Mach System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Mach System "Operating Systems Concepts, Sixth Edition" by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne Presented by Abdelhalim Ragab Portland State University CS533 Concepts of Operating Systems

  2. Microkernel vs. Monolithic Systems Source: http://en.wikipedia.org/wiki/File:OS-structure.svg

  3. Mach History • CMU Accent operating system • No ability to execute UNIX applications • Single Hardware architecture • BSD Unix system + Accent concepts • Mach OpenStep GNU Hurd XNU OSF/1 Mac OS X Darwin

  4. Maintain BSD Compatibility Simple programmer interface Easy portability Extensive library of utilities/applications Combine utilities via pipes PLUS Diverse architectures. Varying network speed Simple kernel Distributed operation Integrated memory management and IPC Heterogeneous systems Design Principles

  5. message text region port threads data region port set secondary storage memory object System Components • Task • Thread • Port • Port set • Message • Memory object task

  6. Memory Management and IPC • Memory Management using IPC: • Memory object represented by port(s) • IPC messages are sent to those ports to request operation on the object • Memory objects can be remote  kernel caches the contents • IPC using memory-management techniques: • Pass message by moving pointers to shared memory objects • Virtual-memory remapping to transfer large contents(virtual copy or copy-on-write)

  7. Process ManagementBasic Structure • Tasks/Threads • Synchronization primitives: • Mach IPC: • Processes exchanging messages at rendezvous points • Wait/signal associated with semaphores can be implemented using IPC • Thread-level synchronization using thread start/stop calls

  8. Process ManagementC Thread package • User-level thread library built on top of Mach primitives • Influenced POSIX P Threads standard • Thread-control: • Create/Destroy a thread • Wait for a specific thread to terminate then continue the calling thread • Yield • Mutual exclusion using spinlocks • Condition Variables (wait, signal)

  9. Process ManagementCPU Scheduler • Only threads are scheduled • Dynamic thread priority number (0 – 127) • based on the exponential average of its CPU usage. • 32 global run queues + per processor local queues (ex. driver thread) • No Central dispatcher • Processors consult run queues to select next thread • List of idle processors • Thread time quantum varies inversely with total number of threads, but constant over the entire system

  10. Process ManagementException Handling • Implemented via RPC messages • Exception handling granularities: • Per thread (for error handling) • Per task (for debuggers) • Emulate BSD style signals • Supports execution of BSD programs • Not suitable for multi-threaded environment

  11. Interprocess CommunicationPorts + messages • Allow location independence + communication security • Sender/Receiver must have rights (port name + send or receive capability) • Ports: • Protected bounded queue in the kernel • System Calls: • Allocate new port in task, give the task all access rights • Deallocate task’s access rights to a port • Get port status • Create backup port • Port sets

  12. Interprocess CommunicationPorts + messages • Messages: • Header + typed data objects • Header: destination port name, reply port name, message length • In-line data: simple types, port rights • Out-of-line data: pointers • Via virtual-memory management • Copy-on-write • Sparse virtual memory

  13. Interprocess CommunicationPorts + messages • NetMsgServer: • user-level capability-based networking daemon • used when receiver port is not on the kernel’s computer • Forward messages between hosts • Provides primitive network-wide name service • Mach 3.0 NORMA IPC • Syncronization using IPC: • Used in threads in the same task • Port used as synchronization variable • Receive message  wait • Send message  signal

  14. Memory Management • Memory Object • Used to manage secondary storage (files, pipes, …), or data mapped into virtual memory • Backed by user-level memory managers • Standard system calls for virtual memory functionality • User-level Memory Managers: • Memory can be paged by user-written memory managers • No assumption are made by Mach about memory objects contents • Kernel calls to support external memory manager • Mach default memory manager

  15. Memory ManagementShared memory • Shared memory provides reduced complexity and enhanced performance • Fast IPC • Reduced overhead in file management • Mach provides facilities to maintain memory consistency on different machines

  16. Programmer Interface • System-call level • Emulation libraries and servers • Upcalls made to libraries in task address space, or server • C Threads package • C language interface to Mach threads primitives • Not suitable for NORMA systems • Interface/Stub generator (MIG) for RPC calls

  17. Mach Microkernelsummary • Simple kernel abstractions • Focus on communication facilities • System Calls: • IPC • Task/Thread/Port • Virtual memory • Mach 3 NORMA IPC

  18. Mach Microkernelsummary • User level • servers • Memory Managers • NetMsgServer • NetMemServer • OS Servers/Emulation libraries • C Threads user-level thread management package

  19. Questions

  20. Reality • Microkernel vs. Monolithic Systems:Linus vs. Tanenbaum famous debate (1992):http://www.dina.kvl.dk/~abraham/Linus_vs_Tanenbaum.htmlhttp://oreilly.com/catalog/opensources/book/appa.htmlhttp://groups.google.com/group/comp.os.minix/browse_thread/thread/c25870d7a41696d2 • Again in 2006http://www.cs.vu.nl/~ast/reliable-os/http://en.wikipedia.org/wiki/Tanenbaum-Torvalds_debate • L3 Microkernel • L4 microkernel family (L4, L4Ka::Hazelnut, Fiasco, … ) • Mac OS X: Although Mac OS X must credit BSD for most of the underlying levels of the operating system, Mac OS X also owes a major debt toMach. The kernel is heavily influenced in its design philosophy by Carnegie Mellon's Mach project[17]. The kernel is not a pure micro-kernel implementation, since the address space is shared with the BSD portion of the kernel and the I/O Kit.http://developer.apple.com/technotes/tn2002/tn2071.html

  21. Reality(2)Are Microkernels for Real • QNX, Integrity, PikeOS, Symbian, L4Linux, Singularity, K42, Mac OS X, HURD, Coyotos • QNX is widely used in real commercial systems. Cisco's top-of-the-line router uses it, for example, and I can assure you, Cisco cares a **LOT** about performance. • One of the leading operating systems in the military and aerospace markets, where reliability is absolutely critical is Green Hills' Integrity, another microkernel. • PikeOS is another microkernel-based real-time system widely used in defense, aerospace, automotive, and industrial applications. • Symbian is yet another popular microkernel, primarily used in cell phones. It is not a pure microkernel, however, but something of a hybrid, with drivers in the kernel, but the file system, networking, and telephony in user space. • L4Linux runs all of Linux in user space on top of the L4 microkernel with a performance loss of only a couple of percent.  • IBM K42 • HURD • Microsoft Singularity • Mac OSX and Darwin on L4 • Source: http://www.cs.vu.nl/~ast/reliable-os/

More Related