Changes between Version 1 and Version 2 of Ticket #11


Ignore:
Timestamp:
Feb 15, 2010, 11:18:58 AM (15 years ago)
Author:
Nicolas Pouillon
Comment:

Main handling

  • exception:
  • syscall:
    • if from_user_mode:
      • cleanup user-accessible registers
      • push user_mode [1]
    • push cpu_mode ; switch to kernel mode [2]
    • push registers
    • [handle exception]
    • pop registers
    • pop cpu_mode [3]
    • if was from_user_mode:
      • pop user_mode [4]
    • back to code

[1] change la pile user en pile kernel, save l'état du proc [2] change le mode du proc en kernel, IRQ masqués [3] repasse le proc en mode exception [4] repasse le proc en mode user + gestion d'exceptions

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11 – Description

    v1 v2  
    1414
    1515
    16 We could handle all this a portable and easy way if we had an exception/syscall/whatever-handling thread. On exception/syscall, we can switch to this thread, passing arguments and state through cpu-local variables. This could make thread switching easy.
     16We could handle all this a portable and easy way if we switched back to kernel mode (not exception or user). On exception/syscall, we can switch to other kernel-mode threads.
     17
     18
     19Optional exception:
    1720
    1821This does not concern IRQs, which must be as-quick as possible. But as we sometimes have to switch threads on IRQ, we should add a mecanism allowing the IRQ handler to request a system service ASAP. Then directly in the asm IRQ handling code, we can detect this service request, and make the IRQ handler jump to the syscall code rather than returning to the user code.