Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. # The OS/K Team licenses this file to you under the MIT license.
  2. # See the LICENSE file in the project root for more information.
  3.  
  4. CPU device function slots:
  5.  
  6. slot ax0 ax1 ax2 thr name desc
  7. 0-15 - - - - (reserved) (reserved)
  8. 16 - - - - getmaxidx rax = maximal index for a register frame
  9. 17 - - - - getrfusage rax = number of register frames active
  10. 18 - - - - getcuridx rax = index of the current register frame
  11. 19 - - - - leastavail rax = least index among inactive frames, -1 if none
  12. 20 i - - - isactive rax = is register frame #ax0 active?
  13. 21 i - - y activate activates register frame #ax0 (filling it with 0's)
  14. 22 i - - y deactivate deactivates register frame #ax0 (losing all its contents!)
  15. 23 i i - y copyframe copy contents of frame #ax1 into (active) frame #ax0
  16. 24 i i - y moveframe move frame #ax1 to (inactive) frame index #ax0
  17. 25 i - - - switchrf switch to register frame #ax0
  18. 26-31 - - - - (reserved) (reserved)
  19. 32 i - - - loadargs load registers ax0-ax7 from frame #ax0
  20. 33 i r - - loadreg rax = register #ax1 from frame #ax0
  21. 34-47 - - - - (reserved) (reserved)
  22. 48 i r i y storereg store ax2 into register #ax1 from frame #ax0
  23. 49-63 - - - - (reserved) (reserved)
  24. 64 i i - y idtadd mark E/I #ax0 as handled by register frame #ax1
  25. 65 i - - y idtdel mark E/I #ax0 as unhandled
  26. 66 i - - - idtquery rax = E/I #ax0 has handler? rdx = index of handling frame
  27. 67 i - - - idtdone signals that handler for E/I #ax0 is done handling
  28. 68+ - - - - (reserved) (reserved)
  29.  
  30. Arguments:
  31. i immediate
  32. r register index (0=inv, 1=rip, etc...)
  33.  
  34. Terminology:
  35. interrupt: asynchronous transfer of control to another RFRAME due to some device
  36. exception: general term for synchronous transfer of control to another RFRAME
  37. fault: hardware exception (slots 1-255)
  38. trap: software exception (slots 256-511)
  39.  
  40. IDT slots:
  41. 0 a handler at this slot will receive all exceptions
  42. 1-255 hardware exceptions (see vm/except.h), OVERRIDES slot 0
  43. 256-511 software exceptions (TRAP instruction), OVERRIDES slot 0
  44.  
  45. 512 a handler at this slot will receive all maskable hardware interrupts
  46. 513-767 maskable hardware interrupts (see ...), OVERRIDES slot 512
  47.  
  48. 768 a handler in this slot will receive all non-maskable hardware interrupts
  49. 769-1023 non-maskable hardware interrupts (see ...), OVERRIDES slot 768
  50.  
  51. A handler for some E/I must use the 'idtdone' iocall to show that it is done dealing with
  52. a certain E/I. If that same E/I happens again before that, the following happens:
  53. - if this E/I is a fault (hardware exception), but not #DBF, then a #DBF exception is thrown
  54. - if this E/I is #DBF (double fault), the system crashes ("triple fault")
  55. - if this E/I is a hardware interrupt, it is queued (*** XXX ***)
  56.  
  57. Clearing the interrupt flag prevents (and queues) maskable hardware interrupts
  58.  
  59. Note: RFRAME #0 *cannot* handle interrupts, as a value of 0 in an IDT slot
  60. indicates than there are no handler for the corresponding exception/interrupt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement