GB2399919A - Using a remote procedure call to assign memory to a task - Google Patents
Using a remote procedure call to assign memory to a task Download PDFInfo
- Publication number
- GB2399919A GB2399919A GB0414301A GB0414301A GB2399919A GB 2399919 A GB2399919 A GB 2399919A GB 0414301 A GB0414301 A GB 0414301A GB 0414301 A GB0414301 A GB 0414301A GB 2399919 A GB2399919 A GB 2399919A
- Authority
- GB
- United Kingdom
- Prior art keywords
- task
- strand
- cell
- target
- source
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
Methods for allocating memory for a task in a computer-implemented system and for performing a remote procedure call from a source task in a source cell to a target task in a target cell. An input message indicating a portion of memory space associated with a source task is sent from the source task to a target task. The portion of the memory space is inaccessible to the source task during the execution of the target task. In response to receiving the input message from the source task, the target task is executed. Upon completing execution of the target task, the portion of the memory space is released and is accessible to the source task.
Description
SEPARATIOtl KERNEL
BACKGROUND OF THE INVENTION
1. Technical Field
The present invention relates generally to using the separation principle to design a kernel of an operating system, and more particularly, the present invention relates to a kernel that applies the separation principle to memory allocation. remote procedure call and exception handling mechanisms.
2. Discussion Separation is an extremely important property in the construction and analysis of secure systems. If two logical entities A and B (for example, two pieces of software) are separate, then separation means that there is no way for A to influence the operation of B. and vice versa. If the operation of A is important to the security of a system, the separation of A and B means that the operation of B can be ignored when evaluating how A supports the security of the system. If A and B are not separate, so that B could influence the operation of A, then both A and 3 must be considered in evaluating how A supports the security of the system. The necessity of evaluating A and B increases the difficulty and cost of the security evaluation and usually yields a lower assurance of security. Thus lack of separation yields the combination of higher cost and lower assurance.
Complete separation (no influence between A and B) yields a conceptually clean system. Incomplete separation can still be very good if there are a small (e.g. One, two. or three) number of known influence paths between A ar,d B. and these paths have low bandwidth anchor are difficult to use. Incomplete separation is unacceptable in a high assurance system when it results from the inherent complexity of the system, and the resulting inability to analyze the possible influences between A and B. Therefore, it is desirable to construct a high assurance system applying strong separation principles.
Separation is a principal that has been investigated for the construction of secure systems for some time. The idea behind separation can be described with the assistance of FIG. 1. A system is sometimes implemented as a set of separate physical devices with the devices interconnected by physical wires. In FIG. 1 if it is important to the security of the system that box' does not directly intercommunicate with box-. then one need only look at the arrangement of the physical boxes and i wires to determine the truth of this property.
- It is often the case that the same system will be implemented in one physical box, but with logical entities (e.g. software processes) performing the same functions as the physical boxes of FIG. 1. This new implementation may result from increasing miniaturization of components, or the increasing memory and processing to power available within on processor platform. This new implementation of the same system is depicted in FIG. 2. The tasks are performing the same functions and are interconnected in the same way as the boxes of FIG. 1. If it was important before that box does not directly intercommunicate with boxy,, then it is still important that task, does not directly intercommunicate with tasks. Analyzing the system of FIG. 2 may not be as easy as it was in FIG. 1. The reason for the increasing difficulty of analysis is shown in FIG. 3.
The problem is that all of the tasks communicate with the operating system, thus the operating system becomes a means whereby information can be transmitted between tasks, and tasks can influence each other even when not permitted by the communication policy of the operating system. FIG. 3 shows task., influencing task, by means of operating system mechanisms. A standard example of this is memory allocation. If all of the tasks allocate memory from a shared pool of resources, then tasks could allocate all of the memory. When task' runs and attempts to allocate memory, it will receive a failing return from the operating system. This failing return could encode a "1" transmitted from tasks to task,. If tasks then releases some memory, when task' runs, it will try to allocate some memory again, this time receiving a successful return from the operating system.
This successful/failure return from the operating system was never intended to be used as a communication channel, nevertheless a good hacker can make use of it in this Rev. In other words, the problem is that the other software (e.g.. other tasks and the operating system) can now influence the operation of the task under analysis. and thus the task under analysis cannot be analyzed in isolation.
Therefore. it is desirable to provide a high-grade separation between processing elements in a system. This high-grade separation permits the system designer to establish high assurance secure systems by allowing each processing element to be analysed in isolation. To achieve highgrade separation, the present invention applies the separation principle to the design a kernel of an operating system. More specifically, the kernel incorporates memory allocation, remote procedure call and exception handling mechanisms in such a way that supports the separation concept.
Summary of the Invention
According to the invention, a method is provided for performing a remote procedure call from a source task residing in a source cell to a target task residing in a target cell. The source task has a memory space accessible during execution of the source task. The method comprises the steps of: sending an input message from the source task to the target task, where the input message is a portion of the memory space associated with the source task and the portion of the memory space is inaccessible to the source task during the execution of the target task; in response to receiving the input message from the source task, initiating execution of the target task in the target cell; providing access to the portion of the memory space during execution of the target task; and upon completing execution of the target task, releasing the portion of the memory space, such that the portion of the memory space is accessible to the source task and providing a return message from the target task to the source task.
Preferably the method further comprises a step of prohibiting the target strand from sending a second input message, where the second input message corresponds to the portion of the memory space received from the source task.
According to a second aspect of the invention, apparatus is provided for performing a remote procedure call from a source task residing in a source cell to a target task residing in a target cell, the source task having a memory space accessible during execution of the source task, the apparatus comprising: means for sending an input message from the source task to the target task, where the input message is a portion of the memory space associated with the source task and the portion of the memory space is inaccessible to the source task during the execution of the target task; means for initiating execution of the target task in the target cell in response to receiving the input message from the source task; means for providing access to the portion of the memory space during execution of the target task; and means for releasing the portion of the memory space upon completing execution of the target task, such that the portion of the memory space is accessible to the source task, and providing a return message from the target task to the source task. s
Brief Description of the Drawings
The present invention will hereinafter be described in conjunction with the appended drawing figure(s), wherein like numerals denote like elements, and: FIG. 1 is a diagram depicting a box and wire model for a typical system architecture; FIG. 2 is a diagram depicting a task model that may reside on a physical device in a typical system architecture; FIG. 3 is a diagram depicting the task model that is supported by an operating system in a typical multi-tasking architecture; FIG. 4 is a diagram illustrating the different types of memory segments supported by the framework of the present invention; FIG. 5 is a diagram illustrating the cell abstraction concept of the present invention; FIG. 6 is a diagram illustrating the interaction between cells in accordance with the present invention; FIG. 7 is a diagram depicting a single cell and two cell operations in accordance with the separation principle of the present invention; FIG. 8 is a diagram depicting a multiple cell abstraction system; FlGs. 9 to 11 illustrate the fundamental relationships and equations that define the separation specification of the present invention; FlGs. 12 and 13 illustrate the first and second separation axioms, respectively, in accordance with the separation specification of the present invention; FIG. 14 depicts a separation kernel that supports a high degree of separation between processing elements in a computer-implemented system in accordance with the present invention; i FlGs. 15-17 illustrate various operations of a strand in a cell in accordance with the present invention, FIG. 18 illustrates a method for allocating memory in accordance with the present invention; and FIG. 19 illustrates a method for performing remote procedure calls in accordance with the present invention.
Detailed Descrintion of the Preferred Embodiments The present invention generally relates to designing a kernel of an operating system in accordance with the separation principle. A framework for designing the separation kernel is set forth below. It is to be understood that this framework. the subsequent description of the separation principle and its application to the design of the kernel are merely exemplary and are intended to provide an understanding of the nature and character of the invention as it is c'airned.
in accordance with the present invention, the principle abstraction for the framework is the cell. A cell is defined as a domain of execution and a collection of strands, where each strand is a stream of programmable machine instructions executable by the kernel of the operating system. For purposes of the following description, a domain of execution is also referred to as the context of the cell and a strand is also referred to as a task.
The context of a cell is comprised of one or more memory segments. Each segment is a range of physical memory addresses, which are defined by a starting address and a length. The framework of the present invention supports different types of memory segments as shown in FIG. 4.
Permanent segments are allocated to a cell and therefore are accessible to any of the strands associated with the cell. Permanent segments may be used for storing datai code (i.e., a strand's machine instructions) or memory mapped hardware interfaces. Permanent segments cannot be sent in messages, belt are retained Linen the currently executing strand of the cell suspends.
In contrast. a transient segment is accessible to the strand. which is running in the cell. and to the cell. In other words, each strand has predefined memory requirements for its transient segments. When the strand is launched, the transient segments are allocated for the strand. Thus. the transient segments are accessible to the strand. As will be more fully explained below. the framework supports different types of transient segments. such as an input message segment. a scratch segment. an assigned segment, and a register segment.
An overview of the framework, including the cell abstraction concept and its interrelationships, are further discussed in relation to FIG. 5. Each cell can execute only one strand at a time. Strands 22 is currently running in CellA 20. It is processing an input message 24, which is made up of one or more transient segments. Strands 22 may use one or more scratch segments 26 to process the input message 24. A scratch segment is a temporary memory space of sufficient size to be used by the strand when processing the input message. Strands may also access an assigned segment 28. An assigned segment is a specified transient segment used to gain access to available resources, such as device registers.
Lastly, Strands may access one or more permanent segments. For instance, the encapsulated data segment 30 contains static data used by the strand.
Cells 32 is currently not executing a strand. However, it may begin execution of a strand some time after it is granted access to an input message received from Strands 22 of CellA 20. In FIG. 5, Strands 34 is shown being launched in Cells When a strand in the cell is launched, the cell receives access to the message segment(s) that make up the input message. Again, the strand may require scratch segments to process the input message. In addition, an interrupt strand may be run immediately upon receipt of an interrupt. Thus. the execution of a strand may be interleaved with the execution of interrupt strands.
A cell interfaces to its external world (e.s., to other cells or the underlying hardware) only through the substrate. For purposes of this discussion, the substrate is defined as the operating system, the device drivers, and the underlying hardware of the system. Exemplary cell interfaces are illustrated in FIG. 6. First, the kernel of the operating system launches Strands 22 of CellA 20. At this time, the strand is given access by the kernel to its input message segment(s) and scratch segment(s). Next, Strands 29 uses a Send interface 36 to send some of its 33 transient segments to Strands 34 of Cells 32. As a result, CellA loses access to the segments transmitted by the strand.
After further execution of the strand. Strands of CellA addresses an exception condition through the use of a Throw interface 38. The interface terminates execution of the strand and initiates execution of a Handler function. When execution of Strands of CellA terminates, the kernel removes access to all of the transient segments remaining in CellA. If Strands of CellA had not terminated via the exception condition, it would have reached the end of its strand. In this case. the erminateStranU interface 39 terminates the execution of the strand and removes access to any transient segments still accessible to the cell. One skilled in the art will readily recognize that the separation kernel of the present invention will be designed and implemented within the above-described framework, Data structures that define and describe the strands and cells in the above-described framework are further discussed in the Appendix.
An introduction to the separation principle is provided in relation to FlGs. , 11. FiG. 7 shows a cell 40 and two of its operations, Fiberlnit 42 and FiberNext Ad.
Again, the cell represents an execution domain. Moreover, the cells are the components of the system to be separated.
In FIG. 8, several cells have been combined into a system 50 that is referred to as the Multiple Cell Abstraction, where each individual cell is referred to as a Single Cell Abstraction (SCA). Each cell has its own Fiberlnit and FiberNext operations, whereas the system as a whole has an Init 52 and Next 54 operation.
Since the cells serve as the Fibers of the system, the names for the cell level operations are Fiberlnit and FiberNext. The names Init and Next are reserved for the system level operations.
There are several choices for defining the relationship between these cell operations. For instance, the Next operation (advancing the system state) could correspond to a FiberNext operation (advancing a ceil state) on every cell at once, thereby implying multiprocessing of the cells. On the other hand, the Next operation could correspond to a FiberNext operation on only one cell or on some subset of the cells. There are similar design choices for the Init and Fiberlnit operations. The separation specification of the present invention defines the Next operation to advance a cell state only one cell at a time and the Init operation to initialize the cell state of all the cells at once. Therefore, the system state advances one ceil at a time. but the initialization of the system is not complete until all of the cells are ready,' to run.
FIG. 9 depicts this design choice for the separation specification of the present invention. In this Figure, the NextB operation 62 is being performed on the system, where the Nexta operation is the Next operation performed on Cells. The state of the system before the Nlext operation is shown as MCA State' 64. MCA State o4 includes Cells:n state SCAA. 60, Cells in state SCABS 68 and Cellc in stat SCA-, /0. The state Of the Astern after the Next operation is shown as MCA State2 /2. where CellA is in state SCAA2 74, Cells is in state SCAB: /6 and Cellc is in state SCAc2 78. The Nexta operation at the system level corresponds to selecting a cell and advancing the state of that one cell. :;
FIG. 9 further illustrates that performing NextB on MCA, achieves the same result as taking Fibera 80 of MCA. to yield SCAB, 82, and then performing FiberNext 84 on SCAB,. In this case. Cells is selected by the FiberB operation. Performing the FiberNext operation upon Cells advances the state of CellB. In equation form, this is Fiber9(Next3(m)) = FiberNext(FiberB(m)) FIG. 10 is a commuting diagram, which is a diagrammatic form of the above equation. The internal cells of MCA have been hidden from the external world and can be observed only through the Fiber operation. This equation can be further shortened to: FiberB NextB = FiberNext Fibers In this short form, the variable m has been dropped. In addition, the equation is between two functions. rather than the value of the functions at an arbitrary input.
The symbol denotes function composition.
The final form of this relationship is shown in FIG. 11. In this figure, the functions NextB and Fibers have been uncurried into Next and Fiber. This means that the function Texts is related to Next by the equation Next(m) = Next(m, E3) for Cells. In general, NextX is related to Next by the equation NextX(m) = Next(m. x) for any cell X. Since NextB was changed to Next, and Fibers was changed to Fiber, the CelilD parameter is no longer contained in the subscript of the operator, so this must be made explicit in the domain of the Next and Fiber functions. This is why MCA is combined with CelilC in the product MCA X CeillD. The equations corresponding to FIG. 11 are given as follows: Fiber(Nex'\m, c)) = FiterNext<Fiber(m c)) Fiber Next= FiberNext Fiber in simple terms, what these fundamental equations are saying is that when the system state is advanced by one step, the change in the system state corresponds to a change in the state of one of its ceils. as identified by the F!cer function. If you look at the system state before advancing it one step and again an. advancing it one step, then there will be a unique cell c, which accounts for this ac.ance in the state of the system. This cell c accounts for the advance in the state o,- :- sys-rn by advar,c ng its own single cell state by one step.
The operators Init and Next are specified to be the constructors of the MCA.
This means that all possible MCA states are the result of system initialization and - - the advancement of the system state one step at a time by the Next operation. This specifies that the system cannot land in any "unspecified, , states that might not satisfy the security constraints of the system. There is a similar constraint upon the SCA that states that any SCA must be the result of a Fiber operation on an MCA.
Since the MCA is constrained to be in valid states, as constructed by Init and Next, this constrains the SCAs to be in valid states resulting from taking a Fiber of a valid MCA.
I n sum. the system under consideration is the Multiple Cell Abstraction (MCA). The elements of the system to be separated are the ceils as represented by the Single Cell Abstraction (SCA). The relationship between the system and its cells is given in several forms by the above- described fundamental equations.
These fundamental equations in turn serve as the basis for the separation
specification of the present invention.
The separation specification is further defined by two separation axioms.
FIG. 12 depicts a First Separation Axiom, which sets forth the communication policy between cells. Since the communication policy references the concept of a cell, it is logical that the statement of the communication policy should reference the definitions of the Next and Fiber functions. Indeed, one of the purpose for separating the system into cells is to restrict communication within the system.
Accordingly. FIG. 12 describes an equation stating that cell SCAx can influence cell SCAy only if cell SCAx is permitted to communicate with cell SCAy by the communication policy enforced by the kernel. The communication policy is alternatively recited by the following equations: o0 Communicattons(x, y)-Fibery(McA) = Fibery(Nextx(MCA)j Fibery(MCA) Fibery(Nextx(McA)) Communicates(x,y) In this case, the second equation (i. e., the contrapositive form of the first equation) states that if the fiber of cell y changes as the result of advancing the state of cell x it must be the case the x is permitted to communicate with y. In its positive form, the equation states that if cell x cannot communicate with cell y. then whenever the stats of cell x is advanced. there is no change in the state of y. A particular consequence of this communication policy is that ceil x can send messages to y only if cell x has permission to communicate with y.
- The Second Separation Axiom is depicted in FiG. 13. It should be noted that his diagram is not a commuting diagram. This diagram depicts the following equations: SCA x = Fiberx(MCA, j SCA2 x = Fiberx(McA2) SCA' = Fibery(MCA, ) SCA2 = Fibery(Mt:A2) SCA', x = Fiberx(MCA', ) SCA'2 x = Fiberx(MCA'2) SCA, ,, = Fibery(MCA', ) SCA 2 y = Fibery(MCA 2) (Fiberx(MCA7) = Fiberx(MCA2)) [((Fibery(MCA') = Fibery(MCA2)) =(Fibery(Next(MCA)) = Fibery(NextlMCA2)))) ] 1 Fibery(Next(MCA,)) Fibery(Next(MCA2)) (Fiberx(MCA,) (Fiberx(McA2)) v (Fibery(MCA') Fibery(MCA2)) In accordance with these equations. if an action by cell x (e.g., advancing the state of the SCA for cell x) is going to change the state of cell y. then the change in the state of y depends only on the states of x and y. Without this axiom, an unknown ceil could affect the state of y. For instance, if x changes y, it could do so by copying everything from a third cell z into the SCA of y. The purpose of this axiom is to prevent ''undesirable" connections between ceils such -as z and y.
Accordingly, the first equation states that if x has the same fiber in two different system states MCA, and MCA2, and y has the same fiber in MCA' and MCA2, then y has the same fiber after advancing the state x in both MCA' and MCA2. The contrapositive form of this equation (i.e., the second equation) may be more revealing. It says that if advancing x causes a ctange in the state of y, then the change must have resulted from either a change in the state of x or a change in the state of y.
To implement a separation kernel, the designer must choose features that support the intended applications and implement those features in a way that conforms;o the aove-described separation property. In accordance with the À 13 present invention, a computer-implemented system 90 that supports a high degree of separation between processing elements is shown in FIG. 14. The computer- implemented system 90 comprises a plurality of cells 92, where each cell includes a domain of execution 94 and at least one processing element 96. A kernel 38 facilitates execution of the processing elements and administers the communication between the processing elements in accordance with a separation specification 99.
The separation specification 99 governs communication between the processing elements, such that one processing element can influence the operation of another processing element only as set forth by the separation specification.
A preferred implementation of the kernel and its separation specification has selected several features that are required by the applications of the kernel and can be made to fit the separation principle. First, memory allocation is a selected feature because the intended applications are required to process many kinds of data which often require added memory resources to efficiently process the data.
Since the applications require time-shared access to hardware resources, the hardware resources are allocated as memory mapped segments to the cells in a way that preserves the separation property. Second, remote procedure call procedure is a selected feature because many intended applications require a communications mechanism beyond a simple sendmessage. The remote procedure call is a communication mechanism in which information is provided to a server, the server processes the information and returns a result, and the processing continues in the same context that existed before the service was invoked. Third, exception handling is a selected feature because the intended applications are required to be robust with respect to exceptions. Since exceptions 2o can be handled locally with assurance that the direct cause of the exception is local exception handling is also improved by the separation principle. Each of these selected features (i.e., memory allocation, remote procedure calls and exception handling) is further described below.
A memory allocation mechanism in the separation kernel of the present invention is understood in relation to the operation of a strand as shown in Fly. 1.
At strand launch time, a strand is allocated the memory it requires according to its predefined memory requirements. The strand memory requirements are constant for that strand, in that they are the same each time the strand is launched. The strand receives hvo kinds of transient segments upon strand launch: message segments and non-message segments. Message segments are segments. which have been sent by some other strand to the strand being launched. It is the existence of this message that causes the strand launch. Non-message segments are Lne other transient segments. which are described by the predefined memory requirements for the strand.
- As the strand executes, it undergoes interactions with the kernel. If the strand elects to send some of its transient segments as part of an input message to another strand, then access to the transient segments is lost at this point. Thus, the strand can lose access to transient segments as it executes but it cannot gain access to any more transient segments as it executes.
In order to achieve separation within the kernel, the allocation of transient segments for a strand obeys the following properties: (1) before strand launch, the strand has access only to the permanent segments of the cell; (2) transient memory requirements for a strand are a function of the strand, and thus are known at compile time, (3) the kernel does not launch the strand until there is sufficient memory to satisfy all of the memory requirements for the strand; (4) transient segments that are non-message segments are initialized before allocation; (5) as the strand executes, it can lose memory segments (e.g., by sending a message).
but it cannot allocate any more segments; and (6) strand termination causes all transient segments to be released by the kernel. From these properties, it may be concluded that after strand termination, the strand has access only to the permanent segments of the cell and each time a strand runs, the amount of memory available is the same, as specified by the predefined memory requirements for the strand. FIG. 18 illustrates a method for allocating memory by a separation kernel in accordance with the above-described principles.
As a result, a strand sees exactly the same amount of allocated memory each time it runs. Thus, there is no covert channel stemming from the amount of allocated memory. This eliminates the typical memory allocation covert channel that results from the ability of one process to cause resource exhaustion.
Hcever, there may be still one covert channel if the memory addresses Ofthe allocated transient segments are visible to the strand as it executes. In this case, it may be possible to manipulate the addresses of the available memory segments to communicate information to a strand to be launched. This channel can be eliminated if the underlying hardware supports address translation. In this case the strand would see the allocated segments at the same logical address each time it runs. Thus. the strand would have the same amount of allocated transient memos, at the same address. every time it runs.
Referring to FIG. 16, the separation kernel of the present invention also implements a remote procedure call mechanism. During the execution of the strand. the Strands may makes a remote procedure call 92 to Strand; in the target - ., cell (i.e., Cells). As part of the remote procedure call, some of the transient segments of the source strand are sent to the target strand. At this point, these transmitted segments become inaccessible to the source strand and accessible to the target strand. These transmitted segments constitute the parameters of the remote procedure call.
When the target strand is launched, the target strand only gets access to the input transient segments and the permanent segments of the target cell. Since there are no additional memory segments to allocate, it can be concluded that there 1o are sufficient resources to execute the remote procedure call. In other words, the remote procedure call cannot fail on account of insufficient resources. The kernel is designed to ensure that internal kernel resources will be sufficient to process the remote procedure calls! so that no resource exhaustion covert channel is provided by the kernel itself. Therefore, it is not possible for the remote procedure call to fail on account of insufficient resources within the kernel.
In FIG. 16, the target strand terminates using the normal strand termination mechanism. The target strand returns a value 94 to the calling strand. in addition.
the transmitted segments are made inaccessible to the target strand and made once again made accessible to the source strand. This means that before and after 2- the remote procedure calls the same set of segments are accessible to the source strand. If the target strand is terminated for any other reason, the remote procedure call mechanism causes a return to the source strand, and thus guarantees a return from the remote procedure call.
During its execution, the target strand is prohibited from sending the oC transmitted segments as part of a send message. Thus, the segments remain available to be returned to the source strand. Furthermore, the target strand can make a remote procedure call of its own. To do so, the target strand retransmits one or more of the transmitted segments to another target strand. When this additional remote procedure call is completed, the re-transmitted segments are returned to the target strand.
it should also be noted that the remote procedure call mechanism does not allow recursive calls, i.e. calls tO strands in a cell that is already part of the remote procedure call stack. In addition, the remote procedure call mechanism also does not permit a call to a cell that already has an executing strand, thereby preserving - the property that only one strand of a cell can run at any one time. This is an important property to prevent re-entrant code. Re-entrant code can cause various runtime errors. FIG. 19 illustrates a method for performing remote procedure calls in accordance with the above-described principles.
Lastly, the separation kernel of the present invention implements an exception handling mechanism. During the execution of a strand, the strand may generate an exception. As will be apparent to one skilled in the art, the exception may be caused by a variety of conditions. including a divide by zero or an invalid address condition 1 o (i.e., an address that is not within one of the segments accessible to the strand). The strand can raise an exception intentionally by calling the Throw() interface as shown in FIG. 17.
The kernel in turn processes the Throw() interface by transferring control to the exception handler of the cell. The kernel also passes the cause of the exception in a register to the exception handler. The exception handler runs in the same context as the strand that incurred the exception. Therefore. the exception handler has access to the same permanent and transient segments as the strand that incurred the exception.
The exception handler has the option of attempting to resume processing of the strand that incurred the exception or terminating the execution of the strand. In FIG. 17, it is assumed that the exception handler resumes processing of the strand that incurred the exception. Thus, the strand completes execution and then terminates.
Each strand has a maximum exception count. When the strand incurs a number of exceptions equal to the maximum exception count. the strand is terminated by the kernel. Thus, there is no way to get stuck in a loop of exceptior,s.
which in turn causes, more exceptions. On the contrary, the strand will be terminated when the maximum exception count is reached.
As a result of the above-described exception handling mechanisms exc ptions are confined to the cell that contains the strand that incurred the exception. Accordingly, the exception handling mechanism enhances the separation property by providing exception handling that is separate between cells.
The foregoing discloses and describes merely exemplary embodiments of the present invention. One skilled in the art will readily recognize from such discussion. and from accompanying drawings and claims, that various changes.
modifications, and variations can be nnade therein without departing from the spirit and scope of the present invention.
APPENDIX
The asta structures that define and describe the strands and cells in the previously described framework are central to the cell abstraction concept. the separation specification. and the implementation of a separation kernel. Therefore.
these data structures are defined to permit a better understanding of how the - separation kernel may be implemented in accordance with the present invention.
CELL DESCRIPTIONS
10All of the information in the cell descriptor is static information about the cell.
There are four items in the cell descriptor: PermanentSegmentList: The segments that are permanently allocated to the cell. All the strands of the cell get access to these segments when they run. These segments would typically contain the 15code and ceil state information for the application represented by the cell. Permanent segments can be restricted to a single cell or can be shared between more than one cell. The permanent segment list described the access mode to the segment (some combination or read, write, and execute) desired by the cell.
À Handler: The address of the exception handler for the cell.
À SendMap: The set of cells to which this cell can send messages.
This regulates the operation of the kernel Send() and Wait() interfaces.
À ShareMap: The set of cells with which this cell can share permanent 2: segments.
CEt L STATE
-
The eel| state is dynamic information about the cell. It is maintained zs - map from CelllD to CellState. where CellState is one of Idle, Running. or Waitinc.
This mapping is called the CellStateMap.
STRAND DESCRIPTOR
All of the information in the strand descriptor is static information about th- strand. There are seven items in the strand descriptor: 5. CelilD: The identifier of the cell that contains the strand. This can be - used to look up the cell descriptor of the cell containing the strand.
ProcessorMode: Either foreground or background. If the mode is foreground. the cell is run with interrupts enabled. If the mode is backgrc; -d. the cell is run with interrupts disabled. A background cell can be Used to implement a device driver strand, which requir s access to hardware resources without fear of interrupt from the hardware.
EntryPoint: The address of the StrandEntryPoint function.
StackPointer: Where to begin the stack when the StrandEntryPoint is run. The stack pointer must point at an address within a permanent segment of the cell of the strand, or to an assigned segment required by the strand in the SDAssignedSesmentList. The kernel table builder. not the kernel itself, enforces this restriction.
Priority: The priority of the strand.
À ScratchSizeMap: The scratch memory requirements of the strand.
There are four sizes of scratch segments: Tiny, Small, Medium and Large. The scratch size map defines how many of each of these scratch segments sizes are required by the strand.
À SDAssignedSegmentList: The assigned segments required by the strand. Assigned segments are used to share scarce resources between strands.
The strand descriptors are kept in the StrandDescriptorTable. which is a total mapping from StrandlD to StrandDescriptor.
INITIAL STRAND
There is a configuration parameter called InitialStrand used by the kernel.
This is static strand information. When the kernel has completed initialization. it launches the strand indicated by the InitialStrand configuration parameter.
RSOIJRCE AVAILABILITY FOR A STRAND
A concept that comes up repeatedly in the description of the kernel is resource availability. so it is discussed separately here to aid understanding of me
description of the kernel.
- Execution of a strand may require allocation of resources. The resources that may be allocated are scratch and assigned segments. Resource availability for a strand means: There are enough available scratch segments of the sizes specified in the Scratch5izeMap of the StrandDescriptor.
The assigned segments required by the strand are all avaiiabte. This can mean one of the following: - The assigned segments are completely free.
- The assigned segments are part of the message to launch the 1 5 strand.
- The assigned segments have been kept by the strand on the prior execution of the strand.
RUNNABILITY OF A STRAND
A related concept to resource availability for a strand is the runnability of a strand. A strand is runnable when: The resources required by the strand are available.
The strand is not marked blocked.
STRAND STARTUP
-
When a strand begins, it has several standard arguments, which are passed to it by the kernel. The parameters are passed utilizing the registers/stack. The strand must have sufficient stack space for the stacked parameters along with ant space necessary for local data. The variables that are initialized with their values and available for a strand to use when it starts are as follows: À SourceStrandlD is the ID of the strand. which sent the message.
À Command is a 32-bit message from the sending cell.
ScratchSegmentList is a structure consisting of the number of scratch segments along with each segment's address and size.
Message is a structure consisting of the number of message segments along with each segment's address and size.
5. Depth represents the level of nested Remote Procedure Calls (RPCj that this strand is being started within. A length of zero means that the strand is being started by a Message_Send call. A length which is greater than zero, represents the number of nested RPCs.
EXCEPTION HANDLING.
Exception processing allows a strand to transfer control to the exception handler specified in the cell descriptor for the cell. This feature is similar to a jump and should be used to handle cases where abnormal conditions arise.
The exception code is the only parameter passed to the exception handler by the currently running strand. The exception code should contain the error code that resulted in the exception. Preferably, the system reserves the first 32 exception codes (0 ->31) for current and future growth. Each cell is free to use the other exception codes as needed.
Claims (4)
1. A method for performing a remote procedure call from a source task residing in a source cell to a target task residing in a target cell, the source task having a memory space accessible during execution of the source task, comprising the steps of: sending an input message from the source task to the target task, where the input message is a portion of the memory space associated with the source task and the portion of the memory space is inaccessible to the source task during the execution of the target task; in response to receiving the input message from the source task, initiating execution of the target task in the target cell; providing access to the portion of the memory space during execution of the target task; and upon completing execution of the target task, releasing the portion of the memory space, such that the portion of the memory space is accessible to the source task, and providing a return message from the target task to the source task.
2. The method of claim 4 further comprising the step of prohibiting the target strand from sending a second input message, where the second input message corresponds to the portion of the memory space received from the source task.
3. Apparatus for performing a remote procedure call from a source task residing in a source cell to a target task residing in a target cell, the source task having a memory space accessible during execution of the source task, the apparatus comprising: means for sending an input message from the source task to the target task, where the input message is a portion of the memory space associated with the source task and the portion of the memory space is inaccessible to the source task during the execution of the target task; means for initiating execution of the target task in the target cell in response to receiving the input message from the source task; means for providing access to the portion of the memory space during execution of the target task; and means for releasing the portion of the memory space upon completing execution of the target task, such that the portion of the memory space is accessible to the source task, and for providing a return message from the target task to the source task.
4. The apparatus of claim 3, further comprising means for prohibiting the target strand from sending a second input message, where the second input message corresponds to the portion of the memory space received from the source task.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US09/443,597 US6772416B1 (en) | 1999-11-19 | 1999-11-19 | Separation kernel with memory allocation, remote procedure call and exception handling mechanisms |
| GB0211783A GB2372358B (en) | 1999-11-19 | 2000-10-31 | Separation kernel |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| GB0414301D0 GB0414301D0 (en) | 2004-07-28 |
| GB2399919A true GB2399919A (en) | 2004-09-29 |
| GB2399919B GB2399919B (en) | 2004-11-10 |
Family
ID=32031874
Family Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| GB0414301A Expired - Fee Related GB2399919B (en) | 1999-11-19 | 2000-10-31 | Separation kernel |
| GB0401341A Expired - Fee Related GB2394336B (en) | 1999-11-19 | 2000-10-31 | Method of allocating memory |
Family Applications After (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| GB0401341A Expired - Fee Related GB2394336B (en) | 1999-11-19 | 2000-10-31 | Method of allocating memory |
Country Status (1)
| Country | Link |
|---|---|
| GB (2) | GB2399919B (en) |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7522168B2 (en) | 2005-09-27 | 2009-04-21 | Sony Computer Entertainment Inc. | Cell processor task and data management |
| US8037474B2 (en) * | 2005-09-27 | 2011-10-11 | Sony Computer Entertainment Inc. | Task manager with stored task definition having pointer to a memory address containing required code data related to the task for execution |
| US8141076B2 (en) | 2005-09-27 | 2012-03-20 | Sony Computer Entertainment Inc. | Cell processor methods and apparatus |
| US7734827B2 (en) | 2005-09-27 | 2010-06-08 | Sony Computer Entertainment, Inc. | Operation of cell processors |
| US7975269B2 (en) | 2005-09-27 | 2011-07-05 | Sony Computer Entertainment Inc. | Parallel processor methods and apparatus |
| US8316220B2 (en) | 2005-09-27 | 2012-11-20 | Sony Computer Entertainment Inc. | Operating processors over a network |
| US7506123B1 (en) | 2005-09-27 | 2009-03-17 | Sony Computer Entertainment Inc. | Method and system for performing memory copy function on a cell processor |
| US8595747B2 (en) | 2005-12-29 | 2013-11-26 | Sony Computer Entertainment Inc. | Efficient task scheduling by assigning fixed registers to scheduler |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5574912A (en) * | 1990-05-04 | 1996-11-12 | Digital Equipment Corporation | Lattice scheduler method for reducing the impact of covert-channel countermeasures |
-
2000
- 2000-10-31 GB GB0414301A patent/GB2399919B/en not_active Expired - Fee Related
- 2000-10-31 GB GB0401341A patent/GB2394336B/en not_active Expired - Fee Related
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5574912A (en) * | 1990-05-04 | 1996-11-12 | Digital Equipment Corporation | Lattice scheduler method for reducing the impact of covert-channel countermeasures |
Also Published As
| Publication number | Publication date |
|---|---|
| GB2394336B (en) | 2004-09-08 |
| GB2394336A (en) | 2004-04-21 |
| GB2399919B (en) | 2004-11-10 |
| GB0414301D0 (en) | 2004-07-28 |
| GB0401341D0 (en) | 2004-02-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20100192159A1 (en) | Separation kernel with memory allocation, remote procedure call and exception handling mechanisms | |
| Clarke et al. | An efficient component model for the construction of adaptive middleware | |
| KR100688397B1 (en) | Techniques to allow access beyond the context barrier of small footprint devices using entry point objects | |
| KR100687668B1 (en) | Technology to allow access across the context barrier of small footprint devices using global data structures | |
| US20040049609A1 (en) | Mechanism for integrating programmable devices into software based frameworks for distributed computing | |
| EP1434121B1 (en) | Techniques for implementing security on a small footprint device using a context barrier | |
| EP1151378B1 (en) | Techniques for permitting access across a context barrier in a small footprint device using shared object interfaces | |
| US6922835B1 (en) | Techniques for permitting access across a context barrier on a small footprint device using run time environment privileges | |
| US20100186024A1 (en) | System and Method of Invoking Multiple Remote Operations | |
| US9176713B2 (en) | Method, apparatus and program storage device that provides a user mode device interface | |
| GB2399919A (en) | Using a remote procedure call to assign memory to a task | |
| US7571231B2 (en) | Method and protocol for mediating communication between software applications | |
| AU2004202666B2 (en) | A method of allocating memory and performing a remote procedure call | |
| Krishna et al. | Optimizing the ORB core to enhance Real-time CORBA predictability and performance | |
| Benson et al. | A portable run-time system for the SR concurrent programming language | |
| Carre et al. | A semi formal model of Java Card 2.1 in UML | |
| Jung et al. | Structured platform for multiple virtual machines |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PCNP | Patent ceased through non-payment of renewal fee |
Effective date: 20181031 |