…… Sequence SENDER Rights held by the sender task are to the local port. Receive rights are held by local network server. The sender network server looks up for an entry in a table of network ports for which it has receive rights. This yields a network port and a network address. The message is sent with the network port attached to it. RECEIVER Extracts the network port looks up for an entry in a tale of network ports for which it has receive rights. This yields a local mach port and send rights. The message is delivered to the appropriate port
Responces Port here: the destination holds receive rights Port dead: the port is destroyed Port not here, transferred: receive rights were transferred to a specific address. Port not here, unknown: there is no record of the network port No response: the destination computer is dead
ISSUES At some point the sender might run out of forwarding addresses. Then the sender resorts to broadcasting. Design issues – How to manage the forwarding addresses and how to recover from a crash of a computer holding forwarding addresses. Migration Transparency – Synchronize message transfer. The network server holds delivery of all messages at the original computer until all queued messages have been transferred to the destination computer.
Protocols and Drivers Transport Protocol Uses only TCP/IP TCP/IP tuned to achieve robustness User-Level Network Drivers Network Servers have heir own drivers Speed up network and achieve flexibility
MEMORY MANAGEMENT Use of Address Space Memory Sharing Virtual Memory Techniques Supports External Pagers(memory managers) also Virtual memory to be shared and reside in different computers.
Address Space Structure Collection of contiguous group of pages named by their addresses called regions. Mach system calls refer to addresses. Regions can be created in 4 ways Explicitly allocated by a call vm_allocate … filled by zeros Association with a memory object vm_map Inherited from a blue print vm_inherit Allocated automatically by message passing
Memory Management Calls vm_allocate: Allocates memory region. vm_deallocate: De-allocates previously allocated regions. vm_read and vm_write: read or write contents in a region vm_protect: Protects a region (read/write) vm_copy: Copy regions vm_map and vm_inherit
Memory Sharing Memory Inheritance A region that is inherited from a blueprint task contains the same address range and its memory Shared: backed by the same memory Copied : backed by memory that is a copy of the blueprint ’ s memory at the time child region was created. Mach uses copy on write for inheritance and also message passing.
Evaluation of copy-on-write Assists in passing message data between tasks and network servers. Cannot be used to facilitate transmission across a network(as computers do not share physical memory) It is efficient as long as sufficient data are involved(as advantage of physical copying has to outweigh the cost of page table manipulations)
Copy-on-write overheads Region sizeSimple copyCreate regionAmount of data copied (on writing) 0 kilobytes (0 pages) 8 kilobytes (1 page) 256 kilobytes (32 pages) 8 kilobytes 1.41.572.74.82 256 kilobytes44.81.812.95.1266.4 _ Note: all times are in milliseconds.
Copy-on-Write Overheads Overhead when Copy-on-Write is used 2.12 millisecond for one page write of 8 Kilobytes 66.4 millisecond for 32 page write of 256 kilobytes Overhead when In-Line is used 2.8 millisecond for one page write of 8 Kilobytes 89.6 millisecond for 32 page write of 256 Kilobytes
External Pagers Mach Dose not support files or any other abstraction of external storage directly. These resources are implemented using External Pagers. Instead of accessing stored data using explicit read and write operations, Mach access corresponding virtual memory locations directly (mapped access). Advantage – Uniformity
External pager Task’s address space External pager Memory cache objects Kernel Network Port Messages Kernel Region
Components of Message passing Protocol EventSenderMessage vm_mapcalled by task K -> EP EP -> K memory_object_init memory_object_set_attributes,or memory_object_data_error Taskpage-faults when no data frame exists EP -> K memory_object_data_request memory_object_data_provided,or memory_object_data_unavailable Kernel writes modified page to persistent store memory_object_data_write External pager directs kernelto write page/set access permissions EP -> K memory_object_lock_request memory_object_lock_completed Task page-faultswhen insufficient page accessEP -> K memory_object_data_unlock memory_object_lock_request Memory object no longer mappedmemory_object_terminate Externalpager withdraws memory object EP -> K memory_object_destroy memory_object_terminate K -> EP
Roles of External Pager To store data that have been purged by a kernel from its cache of pages To supply page data as required by a kernel To impose consistency Constraints.
Conclusion Mach is a innovative design and remains important. Mach Kernel runs on both multiprocessor and uniprocessor Designed to allow DS to evolve while maintaining UNIX compatibility Recent Mach 3.0 Microkernel is the basis for Linux Operating system. Simpler memory management and Simpler inter- process communication.
Mach remains as an invaluable reference for developments in Kernel Architecture. THANKYOU Have a great evening!!!!