📄 duality.ps.ps
字号:
(around which secondary storage management is structured. It is the)SH( Mach memory object abstraction)1 W7200 62796 MT(that most sets it apart from Accent)106 W( and that gives Mach the ability to efficiently manage system services such as)105 W7200 64173 MT(network paging and filesystem support outside the kernel.)SHES%%Page: 3 4BS0 SI10 /Times-Roman AF30350 4286 MT(3)SH11 /Times-Bold AF7200 7937 MT(3.1. Execution Control Primitives)SH10 /Times-Roman AF8200 9314 MT(Program execution in Mach is controlled through the use)14 W( of tasks and threads. A)15 W/Times-Italic SF41079 XM(task)SH/Times-Roman SF42955 XM(is the basic unit of resource)15 W7200 10691 MT(allocation. It)264 W( includes a paged virtual address space and)7 W( protected access to system resources such as processors and)6 W7200 12068 MT(communication capabilities. The)160 W/Times-Italic SF21422 XM(thread)SH/Times-Roman SF24443 XM(is the basic unit of computation. It is a lightweight process operating)160 W7200 13445 MT(within a)129 W( task; its only physical attribute is its processing state \050)128 W/Times-Italic SF(e.g.)SH/Times-Roman SF(, program counter and registers\051. All threads)128 W7200 14822 MT(within a task share the address space and capabilities of that task.)SH11 /Times-Bold AF7200 18439 MT(3.2. Inter-Process Communication)SH10 /Times-Roman AF8200 19816 MT(Inter-process communication \050IPC\051 in)34 W( Mach is defined in terms of)35 W/Times-Italic SF35265 XM(ports)SH/Times-Roman SF37606 XM(and)SH/Times-Italic SF39335 XM(messages)SH/Times-Roman SF(. These)320 W( constructs provide)35 W7200 21193 MT(for location independence, security and data type tagging.)SH8200 23672 MT(A)SH/Times-Italic SF9322 XM(port)SH/Times-Roman SF11389 XM(is a)150 W( communication channel. Logically, a port is a finite length queue for messages protected by the)149 W7200 25049 MT(kernel. Access)450 W( to a port is granted by receiving a message containing a port capability)100 W( \050to either send or receive)101 W7200 26426 MT(messages\051. A)250 W( port may have any number of senders but only one receiver.)SH8200 28905 MT(A)SH/Times-Italic SF9238 XM(message)SH/Times-Roman SF12941 XM(consists of a fixed length header and a variable-size collection of typed data objects. Messages may)65 W7200 30282 MT(contain port capabilities or imbedded pointers as long as they are properly typed. A single message may transfer)22 W( up)23 W7200 31659 MT(to the entire address space of a task.)SH46800 50 7200 33236 UL9 /Times-Bold AF7200 35936 MT(msg_send\050message, option, timeout\051)SH/Times-Italic SF10800 36741 MT(Send a message to the destination specified in the message header.)SH/Times-Bold SF7200 37854 MT(msg_receive\050message, option, timeout\051)SH/Times-Italic SF10800 38659 MT(Receive a message from the port specified in the message header, or the default group of ports.)SH/Times-Bold SF7200 39772 MT(msg_rpc\050message, option, rcv_size, send_timeout, receive_timeout\051)SH/Times-Italic SF10800 40577 MT(Send a message, then receive a reply.)SH46800 50 7200 43256 UL10 /Times-Bold AF22114 45971 MT(Table 3-1:)SH/Times-Roman SF26975 XM(Primitive Message Operations)SH45800 50 8200 47548 UL8200 49827 MT(The fundamental primitive operations on ports are those to send and receive messages.)2 W( These)253 W( primitives are listed)1 W7200 51204 MT(Table 3-1.)60 W( Other)371 W( than these primitives and a few functions that return the identity of the calling task or thread,)61 W/Times-Bold SF52944 XM(all)SH/Times-Roman SF7200 52581 MT(Mach facilities are expressed in terms of remote procedure calls on ports.)SH8200 55060 MT(The Mach kernel can itself be considered a task with multiple threads of control.)31 W( The)311 W( kernel task acts as a server)30 W7200 56437 MT(which in turn implements tasks and threads. The act of creating)35 W( a task or thread returns send access rights to a port)36 W7200 57814 MT(that represents the new task or thread)60 W( and that can be used to manipulate it. Messages sent to such a port result in)59 W7200 59191 MT(operations being performed on the object it represents. Ports used in this way can)9 W( be thought of as though they were)10 W7200 60568 MT(capabilities to objects in an object-oriented system)148 W( [10].)SH( The act of sending a message \050and)148 W( perhaps receiving a)147 W7200 61945 MT(reply\051 corresponds to a cross-domain procedure call in a capability-based system such as Hydra [23] or StarOS [11].)SH8200 64424 MT(The indirection provided by message passing allows objects to be arbitrarily placed in the)19 W( network without regard)20 W7200 65801 MT(to programming details. For example, a thread can suspend another thread by sending a suspend message to the)6 W( port)5 W7200 67178 MT(representing that other thread)32 W( even if the request is initiated on another node in a network. It is thus possible to run)33 W7200 68555 MT(varying system configurations on different classes of machines while providing a consistent)288 W( interface to all)287 W7200 69932 MT(resources. The)250 W( actual system running on any particular machine is more a function of its servers than its kernel.)SHES%%Page: 4 5BS0 SI10 /Times-Roman AF30350 4286 MT(4)SH8200 7886 MT(Tasks allocate ports to represent their)58 W( own objects or to perform communication. A task may also deallocate its)59 W7200 9263 MT(rights to a port. When the receive rights to a port are destroyed,)32 W( that port is destroyed and tasks holding send rights)31 W7200 10640 MT(are notified. Table 3-2 summarizes the operations available to manage port rights and control message reception.)SH46800 50 7200 12217 UL9 /Times-Bold AF7200 14917 MT(port_allocate\050task, port\051)SH/Times-Italic SF10800 15722 MT(Allocate a new port.)SH/Times-Bold SF7200 16835 MT(port_deallocate\050task, port\051)SH/Times-Italic SF10800 17640 MT(Deallocate the task's rights to this port.)SH/Times-Bold SF7200 18753 MT(port_enable\050task, port\051)SH/Times-Italic SF10800 19558 MT(Add this port to the task's default group of ports for msg_receive.)SH/Times-Bold SF7200 20671 MT(port_disable\050task, port\051)SH/Times-Italic SF10800 21476 MT(Remove this port from the task's default group of ports for msg_receive.)SH/Times-Bold SF7200 22589 MT(port_messages\050task, ports, ports_count\051)SH/Times-Italic SF10800 23394 MT(Return an array of enabled ports on which messages are currently queued.)SH/Times-Bold SF7200 24507 MT(port_status\050task, port, unrestricted, num_msgs, backlog, receiver, owner\051)SH/Times-Italic SF10800 25312 MT(Return status information about this port.)SH/Times-Bold SF7200 26425 MT(port_set_backlog\050task, port, backlog\051)SH/Times-Italic SF10800 27230 MT(Limit the number of messages that can be waiting on this port.)SH46800 50 7200 29909 UL10 /Times-Bold AF25017 32624 MT(Table 3-2:)SH/Times-Roman SF29878 XM(Port Operations)SH45800 50 8200 34201 UL11 /Times-Bold AF7200 37618 MT(3.3. Virtual Memory Management)SH10 /Times-Roman AF8200 38995 MT(A task's address space consists)86 W( of an ordered collection of valid memory regions. Tasks may allocate memory)87 W8 SS 44082 40027 MT(2)SH10 SS 7200 40372 MT(regions anywhere within)219 W( the virtual address space defined by the underlying hardware)220 W44482 XM(. The)690 W( only restriction)220 W7200 41749 MT(imposed by Mach is that regions must be aligned on system page boundaries. The system page size)57 W( is a boot time)56 W7200 43126 MT(parameter and can be any multiple of the hardware page size.)SH8200 45605 MT(Mach supports read/write sharing of memory among tasks of)146 W( common ancestry through inheritance. When a)147 W7200 46982 MT(child task is created, its address space may share \050read/write\051 or copy)14 W( any region of its parent's address space. As in)13 W7200 48359 MT(Accent, copy-on-write sharing is used to efficiently perform virtual memory copying both)61 W( during task creation and)62 W7200 49736 MT(during message transfer.)SH8200 52215 MT(Table 3-3 summarizes the full set of virtual memory operations that can be performed on a task.)SH11 /Times-Bold AF7200 55832 MT(3.4. External Memory Management)SH10 /Times-Roman AF8200 57209 MT(An important part of the Mach strategy)96 W( was a reworking of the basic concept of secondary storage. Instead of)95 W7200 58586 MT(basing secondary storage around a kernel-supplied file system \050as)163 W( was done in Accent and Aegis\051, Mach treats)164 W7200 59963 MT(secondary storage objects in the same way as other server-provided resources accessible through)72 W( message passing.)71 W7200 61340 MT(This form of)112 W/Times-Italic SF12841 XM(external memory management)113 W/Times-Roman SF25538 XM(allows the advantages of a single level store to be made available to)113 W7200 62717 MT(ordinary user-state servers.)SH8200 65196 MT(The Mach external memory management interface is based on the)58 W( the Mach)57 W/Times-Italic SF39552 XM(memory object)57 W/Times-Roman SF(. Like)364 W( other abstract)57 W7200 66573 MT(objects in the Mach environment, a memory object is represented by a)7 W( port. Unlike other Mach objects, the memory)8 W10800 50 7200 69428 UL6 SS 8000 70767 MT(2)SH8 SS 8300 71076 MT(For example, an RT PC task can address)17 W( a full 4 gigabytes of memory under Mach while a VAX task is limited to at most 2 gigabytes of user)16 W7200 72000 MT(address space by the hardware.)SHES%%Page: 5 6BS0 SI10 /Times-Roman AF30350 4286 MT(5)SH46800 50 7200 7400 UL9 /Times-Bold AF7200 10100 MT(vm_allocate\050task, address, size, anywhere\051)SH/Times-Italic SF10800 10905 MT(Allocate new virtual memory at the specified address or anywhere space can be found \050filled-zero on demand\051.)SH/Times-Bold SF7200 12018 MT(vm_deallocate\050task, address, size\051)SH/Times-Italic SF10800 12823 MT(Deallocate a range of addresses, making them no longer valid.)SH/Times-Bold SF7200 13936 MT(vm_inherit\050task, address, size, inheritance\051)SH/Times-Italic SF10800 14741 MT(Specify how this range should be inherited in child tasks.)SH/Times-Bold SF7200 15854 MT(vm_protect\050task, address, size, set_max, protection\051)SH/Times-Italic SF10800 16659 MT(Set the protection attribute of this address range.)SH/Times-Bold SF7200 17772 MT(vm_read\050task, address, size, data, data_count\051)SH/Times-Italic SF10800 18577 MT(Read the contents of this task's address space.)SH/Times-Bold SF7200 19690 MT(vm_write\050task, address, count, data, data_count\051)SH/Times-Italic SF10800 20495 MT(Write the contents of this task's address space.)SH/Times-Bold SF7200 21608 MT(vm_copy\050task, src_addr, count, dst_addr\051)SH/Times-Italic SF10800 22413 MT(Copy a range of memory from one address to another.)SH/Times-Bold SF7200 23526 MT(vm_regions\050task, address, size, elements, elements_count\051)SH/Times-Italic SF10800 24331 MT(Return a description of this task's address space.)SH/Times-Bold SF7200 25444 MT(vm_statistics\050task, vm_stats\051)SH/Times-Italic SF10800 26249 MT(Return statistics about this task's use of virtual memory.)SH46800 50 7200 28928 UL10 /Times-Bold AF22587 31643 MT(Table 3-3:)SH/Times-Roman SF27448 XM(Virtual Memory Operations)SH45800 50 8200 33220 UL7200 34811 MT(object is not provided solely by the Mach kernel, but can be created and serviced by a user-level data manager task.)SH8200 37290 MT(A memory object is an abstract object representing a collection of data bytes on which)87 W( several operations \050)86 W/Times-Italic SF(e.g.)SH/Times-Roman SF(,)SH7200 38667 MT(read, write\051 are defined. The data manager is entirely responsible for the initial values of)231 W( this data and the)232 W7200 40044 MT(permanent storage of the data)180 W( if necessary. The Mach kernel makes no assumptions about the purpose of the)179 W7200 41421 MT(memory object.)SH8200 43900 MT(In order to make memory object data)14 W( available to tasks in the form of physical memory, the Mach kernel acts as a)15 W7200 45277 MT(cache manager for the contents of the memory object. When a page fault)134 W( occurs for which the kernel does not)133 W7200 46654 MT(currently have a valid cached resident page, a remote procedure call is made on the memory object requesting)62 W( that)63 W7200 48031 MT(data. When)346 W( the cache is full \050)48 W/Times-Italic SF(i.e.)SH/Times-Roman SF(, all physical)48 W( pages contain other valid data\051, the kernel must choose some cached)47 W7200 49408 MT(page to replace. If the data in that page was modified while it)59 W( was in physical memory, that data must be flushed;)60 W7200 50785 MT(again, a remote procedure call is made on the memory object. Similarly, when all references)31 W( to a memory object in)30 W7200 52162 MT(all task address maps are relinquished, the kernel releases the cached pages for)114 W( that object for use by other data,)115 W7200 53539 MT(cleaning them as necessary.)SH8200 56018 MT(For historical reasons, the external memory)38 W( management interface has been expressed in terms of kernel activity,)37 W7200 57395 MT(namely paging. As a result, the term)37 W/Times-Italic SF22494 XM(paging object)37 W/Times-Roman SF28290 XM(is often used)37 W( to refer to a memory object, and the term)38 W/Times-Italic SF50712 XM(pager)SH/Times-Roman SF53333 XM(is)SH7200 58772 MT(frequently used to describe the data manager task that implements a memory object.)SH/Times-Bold SF7200 61602 MT(3.4.1. Detailed Description)SH/Times-Roman SF8200 62979 MT(The interface between data manager tasks and the Mach kernel consists of three parts:)SH/Symbol SF8990 64432 MT(\267)SH/Times-Roman SF9700 XM(Calls made by an application program to cause a memory object to)87 W( be mapped into its address space.)86 W9700 65537 MT(Table 3-4 shows this extension to Table 3-3.)SH/Symbol SF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -