Newer
Older
honey-os / src / kernel / interrupts / interruptDescriptors.asm
  1. section .sharedFunctions
  2.  
  3. extern onInterrupt
  4. extern temporaryESP
  5. extern handleSyscallEnd
  6. extern onException
  7.  
  8. global interruptStack
  9. interruptStack: resb 1024
  10.  
  11. interruptReturn:
  12. pop eax
  13. pop ebx
  14. pop ecx
  15. pop edx
  16. ret
  17.  
  18. exceptionAbort:
  19. mov ebx, [esp+24]
  20. cmp ecx, 0x500000
  21. je $
  22. mov ecx, 0x500000
  23. mov cr3, ecx
  24. push ebp
  25. call onException
  26. mov eax, [temporaryESP]
  27. mov esp, eax
  28. pop ebp
  29. ret
  30.  
  31. handleInterrupt:
  32. .saveRegisters:
  33. push eax
  34. push ebx
  35. push ecx
  36. push edx
  37. mov ecx, cr3
  38. push ecx
  39. .checkException:
  40. mov eax, [esp+20]
  41. cmp eax, 31
  42. jng exceptionAbort
  43. .goToKernelPages:
  44. mov eax, 0x500000
  45. mov cr3, eax
  46. call onInterrupt
  47. pop eax
  48. mov cr3, eax
  49. pop edx
  50. pop ecx
  51. pop ebx
  52. pop eax
  53. add esp, 8
  54. iretd
  55.  
  56. %macro interruptHandler 1
  57. ALIGN 4
  58. global idtHandler%1
  59. idtHandler%1:
  60. push 0
  61. push %1
  62. jmp handleInterrupt
  63. %endmacro
  64.  
  65. %macro interruptHandlerError 1
  66. align 4
  67. global idtHandler%1
  68. idtHandler%1:
  69. push %1
  70. jmp handleInterrupt
  71. %endmacro
  72.  
  73. interruptHandler 0
  74. interruptHandler 1
  75. interruptHandler 2
  76. interruptHandler 3
  77. interruptHandler 4
  78. interruptHandler 5
  79. interruptHandler 6
  80. interruptHandler 7
  81. interruptHandlerError 8
  82. interruptHandler 9
  83. interruptHandlerError 10
  84. interruptHandlerError 11
  85. interruptHandlerError 12
  86. interruptHandlerError 13
  87. interruptHandlerError 14
  88. interruptHandler 15
  89. interruptHandler 16
  90. interruptHandlerError 17
  91. interruptHandler 18
  92. interruptHandler 19
  93. interruptHandler 20
  94. interruptHandler 21
  95. interruptHandler 22
  96. interruptHandler 23
  97. interruptHandler 24
  98. interruptHandler 25
  99. interruptHandler 26
  100. interruptHandler 27
  101. interruptHandler 28
  102. interruptHandler 29
  103. interruptHandlerError 30
  104. interruptHandler 31
  105. interruptHandler 32
  106. interruptHandler 33
  107. interruptHandler 34
  108. interruptHandler 35
  109. interruptHandler 36
  110. interruptHandler 37
  111. interruptHandler 38
  112. interruptHandler 39
  113. interruptHandler 40
  114. interruptHandler 41
  115. interruptHandler 42
  116. interruptHandler 43
  117. interruptHandler 44
  118. interruptHandler 45
  119. interruptHandler 46
  120. interruptHandler 47
  121. interruptHandler 48
  122. interruptHandler 49
  123. interruptHandler 50
  124. interruptHandler 51
  125. interruptHandler 52
  126. interruptHandler 53
  127. interruptHandler 54
  128. interruptHandler 55
  129. interruptHandler 56
  130. interruptHandler 57
  131. interruptHandler 58
  132. interruptHandler 59
  133. interruptHandler 60
  134. interruptHandler 61
  135. interruptHandler 62
  136. interruptHandler 63
  137. interruptHandler 64
  138. interruptHandler 65
  139. interruptHandler 66
  140. interruptHandler 67
  141. interruptHandler 68
  142. interruptHandler 69
  143. interruptHandler 70
  144. interruptHandler 71
  145. interruptHandler 72
  146. interruptHandler 73
  147. interruptHandler 74
  148. interruptHandler 75
  149. interruptHandler 76
  150. interruptHandler 77
  151. interruptHandler 78
  152. interruptHandler 79
  153. interruptHandler 80
  154. interruptHandler 81
  155. interruptHandler 82
  156. interruptHandler 83
  157. interruptHandler 84
  158. interruptHandler 85
  159. interruptHandler 86
  160. interruptHandler 87
  161. interruptHandler 88
  162. interruptHandler 89
  163. interruptHandler 90
  164. interruptHandler 91
  165. interruptHandler 92
  166. interruptHandler 93
  167. interruptHandler 94
  168. interruptHandler 95
  169. interruptHandler 96
  170. interruptHandler 97
  171. interruptHandler 98
  172. interruptHandler 99
  173. interruptHandler 100
  174. interruptHandler 101
  175. interruptHandler 102
  176. interruptHandler 103
  177. interruptHandler 104
  178. interruptHandler 105
  179. interruptHandler 106
  180. interruptHandler 107
  181. interruptHandler 108
  182. interruptHandler 109
  183. interruptHandler 110
  184. interruptHandler 111
  185. interruptHandler 112
  186. interruptHandler 113
  187. interruptHandler 114
  188. interruptHandler 115
  189. interruptHandler 116
  190. interruptHandler 117
  191. interruptHandler 118
  192. interruptHandler 119
  193. interruptHandler 120
  194. interruptHandler 121
  195. interruptHandler 122
  196. interruptHandler 123
  197. interruptHandler 124
  198. interruptHandler 125
  199. interruptHandler 126
  200. interruptHandler 127
  201. interruptHandler 128
  202. interruptHandler 129
  203. interruptHandler 130
  204. interruptHandler 131
  205. interruptHandler 132
  206. interruptHandler 133
  207. interruptHandler 134
  208. interruptHandler 135
  209. interruptHandler 136
  210. interruptHandler 137
  211. interruptHandler 138
  212. interruptHandler 139
  213. interruptHandler 140
  214. interruptHandler 141
  215. interruptHandler 142
  216. interruptHandler 143
  217. interruptHandler 144
  218. interruptHandler 145
  219. interruptHandler 146
  220. interruptHandler 147
  221. interruptHandler 148
  222. interruptHandler 149
  223. interruptHandler 150
  224. interruptHandler 151
  225. interruptHandler 152
  226. interruptHandler 153
  227. interruptHandler 154
  228. interruptHandler 155
  229. interruptHandler 156
  230. interruptHandler 157
  231. interruptHandler 158
  232. interruptHandler 159
  233. interruptHandler 160
  234. interruptHandler 161
  235. interruptHandler 162
  236. interruptHandler 163
  237. interruptHandler 164
  238. interruptHandler 165
  239. interruptHandler 166
  240. interruptHandler 167
  241. interruptHandler 168
  242. interruptHandler 169
  243. interruptHandler 170
  244. interruptHandler 171
  245. interruptHandler 172
  246. interruptHandler 173
  247. interruptHandler 174
  248. interruptHandler 175
  249. interruptHandler 176
  250. interruptHandler 177
  251. interruptHandler 178
  252. interruptHandler 179
  253. interruptHandler 180
  254. interruptHandler 181
  255. interruptHandler 182
  256. interruptHandler 183
  257. interruptHandler 184
  258. interruptHandler 185
  259. interruptHandler 186
  260. interruptHandler 187
  261. interruptHandler 188
  262. interruptHandler 189
  263. interruptHandler 190
  264. interruptHandler 191
  265. interruptHandler 192
  266. interruptHandler 193
  267. interruptHandler 194
  268. interruptHandler 195
  269. interruptHandler 196
  270. interruptHandler 197
  271. interruptHandler 198
  272. interruptHandler 199
  273. interruptHandler 200
  274. interruptHandler 201
  275. interruptHandler 202
  276. interruptHandler 203
  277. interruptHandler 204
  278. interruptHandler 205
  279. interruptHandler 206
  280. interruptHandler 207
  281. interruptHandler 208
  282. interruptHandler 209
  283. interruptHandler 210
  284. interruptHandler 211
  285. interruptHandler 212
  286. interruptHandler 213
  287. interruptHandler 214
  288. interruptHandler 215
  289. interruptHandler 216
  290. interruptHandler 217
  291. interruptHandler 218
  292. interruptHandler 219
  293. interruptHandler 220
  294. interruptHandler 221
  295. interruptHandler 222
  296. interruptHandler 223
  297. interruptHandler 224
  298. interruptHandler 225
  299. interruptHandler 226
  300. interruptHandler 227
  301. interruptHandler 228
  302. interruptHandler 229
  303. interruptHandler 230
  304. interruptHandler 231
  305. interruptHandler 232
  306. interruptHandler 233
  307. interruptHandler 234
  308. interruptHandler 235
  309. interruptHandler 236
  310. interruptHandler 237
  311. interruptHandler 238
  312. interruptHandler 239
  313. interruptHandler 240
  314. interruptHandler 241
  315. interruptHandler 242
  316. interruptHandler 243
  317. interruptHandler 244
  318. interruptHandler 245
  319. interruptHandler 246
  320. interruptHandler 247
  321. interruptHandler 248
  322. interruptHandler 249
  323. interruptHandler 250
  324. interruptHandler 251
  325. interruptHandler 252
  326. interruptHandler 253
  327. interruptHandler 254
  328. interruptHandler 255