annotate cos/kernel/asmcode.asm @ 14:a58904747019

Added asm interrupt handler things, not yet working
author windel
date Mon, 14 Nov 2011 22:45:55 +0100
parents
children f3e3e0e9c4bc
rev   line source
14
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
1 ; The default interrupt handlers.
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
2 ; from 20 - 31 are reserved vectors.
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
3 ; below are the custom ones!
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
4
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
5 section .text
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
6 align 4
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
7
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
8 ; Port helpers:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
9 global outb
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
10 outb:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
11 mov eax, [esp + 8]
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
12 mov edx, [esp + 4]
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
13 out dx, al
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
14 ret
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
15
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
16 global inb
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
17 inb:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
18 xor eax, eax
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
19 mov edx, [esp + 4]
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
20 in al, dx
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
21 ret
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
22
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
23 ; Helper functions:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
24 global enableinterrupts
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
25 enableinterrupts:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
26 sti
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
27 ret
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
28
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
29 global halt
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
30 halt:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
31 cli
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
32 hlt
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
33
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
34 global loadIDT
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
35 loadIDT:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
36 ret
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
37
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
38 ; Define macro with two arguments:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
39 %macro INTX 2
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
40 global %1
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
41 %1:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
42 ; Do some saving:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
43 extern %2
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
44 call %2
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
45 ; Do restoration
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
46 iret
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
47
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
48 %endmacro
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
49
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
50 ; Exception handlers:
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
51 INTX INTDEF, INTDEF_handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
52 INTX INT0, INT0handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
53 INTX INT1, INT1handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
54 INTX INT2, INT2handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
55 INTX INT3, INT3handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
56 INTX INT4, INT4handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
57 INTX INT5, INT5handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
58 INTX INT6, INT6handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
59 INTX INT7, INT7handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
60 INTX INT8, INT8handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
61 INTX INT9, INT9handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
62 INTX INT10, INT10handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
63 INTX INT11, INT11handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
64 INTX INT12, INT12handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
65 INTX INT13, INT13handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
66 INTX INT14, INT14handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
67 INTX INT15, INT15handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
68 INTX INT16, INT16handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
69 INTX INT17, INT17handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
70 INTX INT18, INT18handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
71 INTX INT19, INT19handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
72
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
73 INTX INT32, INT32handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
74 INTX INT33, INT33handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
75 INTX INT34, INT34handler
a58904747019 Added asm interrupt handler things, not yet working
windel
parents:
diff changeset
76