The virtual interrupt method of partition operating system
Technical field subregion
The present invention is a kind of virtual interrupt method for partition operating system.
Background is described
At present, different types of partition operating system handling interruption that hardware produces, it is abnormal when, all processing be all
What operating system kernel was carried out, it is impossible to handled accordingly on subregion, but the interruption that different subregions is produced to hardware
It is probably different with the various abnormal processing produced on subregion, therefore this is accomplished by providing a kind of for division operation system
The abnormal interruption of the subregion of system handles the virtual interrupt algorithm similar with the abnormal interruption processing of current operating system kernel.
The content of the invention
The present invention has comprising specific feature content:
Virtual interrupt is categorized as external interrupt, exception, tick interruptions, service request interrupt
Virtual interrupt is distributed
The delivery of virtual interrupt
Embodiment
1. virtual interrupt is categorized as external interrupt, exception, tick interruptions, service request interrupt
Virtual interrupt provides abnormal interruption isolation mech isolation test and inter-partition communication mechanism for subregion.
Virtual interrupt is categorized as external interrupt, exception, tick interruptions, four kinds of virtual interrupts of service request interrupt.
External interrupt is the interruption that hardware is produced, and system supports 32 external interrupts, with 32 signless integers position
One in the external interrupt that seal record occurs, each external interrupt 32 integers of correspondence.
The abnormal exception to be produced on application partition, the exception that anomalous sign record occurs.
Tick, which is interrupted, represents timer interruption, the fixed cycle operator for subregion.Adopted value mode records tick interrupting values, this
Sample can ensure the continuity of the tick times in subregion.One tick is a basic time unit of system operation, also
It is timeslice.
Service request interrupt is similar to traps, is mainly used in inter-partition communication.Service request interrupt type and 5 parameters
Record each service request interrupt produced.The service request interrupt of generation is managed by service request interrupt chained list.
Application partition optionally uses virtual interrupt function, if necessary to use virtual interrupt function, then application point
Area needs to enable virtual interrupt function and installs virtual interrupt processing entrance function and initialization of virtual interruption stack space.Virtually
Distributing and delivering for interrupting could only be carried out after subregion enables virtual interrupt function.
2. virtual interrupt is distributed
Distributing for virtual interrupt is that application partition records the process for being distributed to the subregion virtual interrupt.
External interrupt distributes subregion:When hardware interrupts are produced, the user in the interrupt handling routine of operating system kernel
Call external interrupt dispatch interface that the hardware interrupts of generation are distributed to the application partition specified.
Abnormal distributes subregion:When producing abnormal on application partition, i.e., when User space produces abnormal, operating system kernel
This exception is distributed to the application partition currently run.
What tick was interrupted distributes subregion:When a timeslice is often run in current operation application partition, tick interrupting values will
Increase by 1.User can set tick interrupting values to be delivered to the threshold value of subregion, once reaching threshold value, then produce tick and interrupt.
Service request interrupt distributes subregion:User calls service request interrupt dispatch interface to distribute service request interrupt
To the subregion specified.
3. virtual interrupt is delivered
Thrown when external interrupt/exception/system call interfaces processing of operating system kernel returns to application partition
Pass.
Virtual interrupt is detected before interruption, system are called, return to application partition extremely, delivered if necessary
Virtual interrupt, by original context, external interrupt bitmap, anomalous sign, tick interrupting values and from service request interrupt chain
Win a service request interrupt to be saved in the virtual interrupt stack of application partition, be delivered to application partition.Then application is removed
External interrupt bitmap, anomalous sign, the tick interrupting values recorded on subregion.Application partition registration is returned to by the way of interruption is exited
Installation virtual interrupt processing entrance function, the interrupt handling routine in subregion carries out related interrupt processing, in last void
Intend calling a system for being used for virtual interrupt return to call when interrupt handling routine is returned, carry out virtual interrupt exits place
Reason.
The processing of exiting of virtual interrupt is realized by system call mechanism, and virtual interrupt processing journey has been performed for application
Sequence is returned to using producing at interruption, provide mechanism at exception or system call interfaces.Operating system kernel is carrying out void
During plan interruption is exited, the delivery of multiple virtual interrupt can be carried out to current application, until the void of current application subregion
Untill plan interruption has been delivered.Finally, operating system kernel recover context and return to generation produce interruption at, exception or
Continued to run with system call interfaces.
Brief description of the drawings
In Figure of description:Fig. 1 is that virtual interrupt delivers handling process.