×

Reentrant protected mode kernel using virtual 8086 mode interrupt service routines

  • US 5,303,378 A
  • Filed: 05/21/1991
  • Issued: 04/12/1994
  • Est. Priority Date: 05/21/1991
  • Status: Expired due to Term
First Claim
Patent Images

1. A method for servicing exceptional conditions in a computer system utilizing a microprocessor having data registers, a first privilege level and a second privilege level, each privilege level having an associated stack, the microprocessor executing tasks operating at each privilege level having respective task state information, the computer system having a secondary stack and a pointer which points to the top of the second privilege level stack, the method comprising:

  • (a) transitioning from the first privilege level to the second privilege level to execute the second privilege level task;

    (b) retrieving the second privilege level stack top pointer after transitioning from the first privilege level to the second privilege level;

    (c) placing the first privilege level task state information on top of the second privilege level stack after retrieving the second privilege level stack top pointer;

    (d) placing a pointer to the first privilege level task state information on the secondary stack after placing the first privilege level task state information on the second privilege level stack;

    (e) enabling interrupts and executing the second privilege level task after placing said first privilege level task state information pointer on the secondary stack;

    (f) placing the second privilege level task state information on the second privilege level stack after an occurrence of an exceptional condition after enabling interrupts and beginning execution of the second privilege level task;

    (g) executing an exception handler after placing said second privilege level task state information if said exceptional condition is an exception and returning to execution of said second privilege level task in step (e) after completion of said exception handler;

    (h) saving certain data register values on the second privilege level stack after placing said second privilege level task state information if said exceptional condition is a hardware interrupt;

    (i) retrieving the most recent first privilege level task state information pointer from the secondary stack after saving said certain data register values;

    (j) copying the first privilege level task state information indicated by said most recent first privilege level task state information pointer to the top of the second privilege level stack after retrieving said most recent first privilege level task state information pointer;

    (k) determining the entry address of an interrupt service routine required to handle said hardware interrupt after saving said certain data register values;

    (l) modifying said copied first privilege level task state information to indicate execution at said entry address of said interrupt service routine after determining said entry address and copying said first privilege level task state information;

    (m) modifying the second privilege level stack top pointer to point to said copied and modified first privilege level task state information after modifying said copied first privilege level task state information;

    (n) beginning execution of said interrupt service routine at the first privilege level and removing said copied and modified first privilege level task state information from the second privilege level stack after modifying the second privilege level stack top pointer;

    (o) executing said first privilege level interrupt service routine after beginning execution, during which execution interrupts may be enabled, whereupon an exceptional condition occurring requesting a second privilege level task causes steps (a) through (e) to be repeated;

    (p) returning to the second privilege level after said interrupt service routine completes;

    (q) modifying the second privilege level stack top pointer to the pointer value most recently placed on the secondary stack after returning to the second privilege level;

    (r) retrieving the second privilege level task state information from the second privilege level stack after returning to the second privilege level;

    (s) returning execution to the second privilege level task after retrieving the second privilege level task state information, whereupon an exceptional condition occurring causes steps (f) through (o) to be repeated;

    (t) retrieving the most recent pointer from the top of the secondary stack upon completion of the second privilege level task; and

    (u) returning to the first privilege level task or interrupt service routine using the first privilege level task state information on the second privilege level stack pointed to by said pointer retrieved from the secondary stack in step (t) upon completion of the second privilege level task.

View all claims
  • 3 Assignments
Timeline View
Assignment View
    ×
    ×