Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.

Similar presentations


Presentation on theme: "CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer."— Presentation transcript:

1 CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer

2 CS533 - Concepts of Operating Systems 2 What is Mach?  First Generation micro-kernel  Builds operating system above minimal kernel  Kernel provides only fundamental services  These services basic but powerful enough to be used on wide range of architectures  Aids distributed computing and multiprocessing

3 CS533 - Concepts of Operating Systems 3 Design Principles: Based on BSD Unix  Advantages of BSD Unix o Simple programmer interface o Easy portability o Extensive library o Combine utilities via pipes  Disadvantages o Redundant features in kernel o Lack of support for multi-processing o Too many fundamental abstractions to choose from

4 CS533 - Concepts of Operating Systems 4 Mach Goals  Support diverse architectures o With varying degrees of shared memory  Function with varying intercomputer network speeds  Simplified kernel structure  Distributed operation  Integrated memory management and IPC  Heterogenous system support

5 CS533 - Concepts of Operating Systems 5 How Mach Works BSD Unix Another OS Windows Maybe another OS Database System MACH Tasks and Threads IPC Virtual Memory Scheduling Software Emulation Layer Microkernel

6 CS533 - Concepts of Operating Systems 6 Mach: Basic Abstractions Task: execution environment o virtual address space o protected access to system resources via ports o may contain one or more threads Thread: basic unit of execution o must run in context of a task Port: basic object reference mechanism o kernel-protected communication channel o protected by port rights Port Set: group of ports sharing common message queue Message: basic method of communication Memory Object: source of memory o May be managed by external memory manager

7 CS533 - Concepts of Operating Systems 7 Mach’s Basic Abstractions Message Port Text Region Port Set Secondary Storage Data Region Program counter Task

8 CS533 - Concepts of Operating Systems 8 Key Features of the Mach System  Blending of memory management and communication o Memory management based on use of memory objects Memory object represented by port IPC messages sent to request operations (pagein / pageout) Because IPC used, memory objects can live on remote systems Kernel caches contents of memory objects in local memory o Communication Message-based kernel so message handling must be efficient Uses virtual memory remapping (large messages) Message transfer modifies receiving task’s address space to include a copy of the message contents Copy on Write

9 CS533 - Concepts of Operating Systems 9 Advantages of Mach Approach  Increased flexibility in memory management to user programs  Greater generality  Improved performance over Unix message passing  Easier task migration o Since ports are location independent, a task and all its ports can be moved from one machine to the other o All tasks previously communictated with the moved task can continue to do so because they reference a task by only its ports and communicate via messages

10 CS533 - Concepts of Operating Systems 10 Process Management  Tasks main execution environment  Can contain no or many kernel-supported threads  Thread synchronization minimal but sufficient o Threads synchronized via IPC Messages used to queue requests for resources Thread receives message if resource available To return resource thread can send a message to the port Equivalent to send and receive o Suspend count kept for thread - multiple suspend calls on a thread but only when an equal number of resume calls made can it wake up  Cthreads

11 CS533 - Concepts of Operating Systems 11 CPU Scheduling  Only threads scheduled (not tasks)  Priority scheduling  Run-queues o 32 global run-queues, searched in priority order o Per-processor run-queues for threads bound to individual processor  No central dispatcher o When idle each processor consults run queues o Local run queue has absolute priority  No fixed-length quantum o Varies inversely with number of threads on system

12 CS533 - Concepts of Operating Systems 12 Interprocess Communication  Two components to Mach IPC o PORTS and MESSAGES  Objects addressed by communications ports o Allows location independence and security of communication  Security established by means of ‘rights’ o ‘Right’ = port name and capability (send / receive) on that port o Only one task with ‘receive’ rights o Many with ‘send’ rights

13 CS533 - Concepts of Operating Systems 13 Interprocess Communication  Ports o Protected, bounded queue within kernel  Port sets - a collection of ports. o Useful if one thread is to service requests on multiple ports  Messages o Fixed-length header (destination and reply port, msg length) o Variable number of typed data objects o Data (in-line data) sent in message or as pointer o Pointers allow transfer of task address space in one message o No copying if on same system! Copy-on-write.

14 CS533 - Concepts of Operating Systems 14 Interprocess Communication  Need way to extend IPC across multiple computers  NetMsgServer o Mach’s kernel IPC transfers message to NetMsgServer o NetMsgServer then uses network protocol to transfer o NetMsgServer on receiving computer uses that kernel’s IPC to send message to correct destination task. o Uses type info in message to transfer data to heterogenous machines in understandable way  Alternative in form of NORMA

15 CS533 - Concepts of Operating Systems 15 Memory Management  Memory Object principle abstraction o Used to manage secondary storage o Represent files, pipes and other data mapped into virtual memory o Instead of traditional approach where kernel provides management of secondary storage Mach treats it like all other objects

16 CS533 - Concepts of Operating Systems 16 Memory Management (cont’d.)  Mach virtual address space sparse  No regular page table o Less memory storage required o Simpler address-space maintenance  User-level memory managers can be used instead

17 CS533 - Concepts of Operating Systems 17 User-Level Memory Managers  Mach takes care of basics only o Acts as interface between hardware and user-level e.g. receives page faults from hardware Notifies relevant task (via port) of page fault o Implements pageout policy (FIFO) o Supplies default Memory Manager in some cases  User-Level Memory Managers o Handle majority of memory management - can page memory o System calls used to communicate with kernel for memory mapping / page-in / page-out / provide page-level locking o Responsible for consistency of the contents of a memory object mapped by tasks on different machines

18 CS533 - Concepts of Operating Systems 18 Shared Memory  Shared memory advantages o Provides fast IPC o Reduces file management overhead o Supports multiprocessing and database management  Mach supports lean version o Threads in a task share memory o Difficult for separate machines to share memory and maintain data consistency Consistent shared memory only supported when tasks share processor - in other cases parent can declare inherited memory to be readable-writable - coordinated through locks For external machines, Mach allows external memory managers

19 CS533 - Concepts of Operating Systems 19 Programmer Interface  System calls o Equivalent to Unix system call interface o How does it do this? o With emulation libraries Live in a read-only part of program’s address space OS calls are translated into subroutine calls o Have emulated MS-DOS and Macintosh OS’s o Lives in address space of program needing its functionality

20 CS533 - Concepts of Operating Systems 20 Summary  Unix can run on top of Mach in ‘User Space’  Uses lightweight processes  Supports multiprocessing and parrallel computing  Messages as communication method  Integration of messages with virtual memory  Integration of virtual memory with messages  Size of kernel reduced  Permits OS emulation at user-level


Download ppt "CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer."

Similar presentations


Ads by Google