Mercurial > lcfOS
annotate cos/kernel/asmcode.asm @ 21:66e9c332c845
Forgot crucial adjustment to idt pointer
author | windel |
---|---|
date | Tue, 29 Nov 2011 19:32:31 +0100 |
parents | 6129643f5c34 |
children | d3c4bf3720a3 |
rev | line source |
---|---|
14 | 1 ; The default interrupt handlers. |
2 ; from 20 - 31 are reserved vectors. | |
3 ; below are the custom ones! | |
4 | |
5 section .text | |
6 align 4 | |
7 | |
8 global halt | |
9 halt: | |
10 cli | |
11 hlt | |
12 | |
17 | 13 global magicBochsBreak |
14 magicBochsBreak: | |
21 | 15 xchg bx, bx |
17 | 16 ret |
17 | |
14 | 18 global loadIDT |
19 loadIDT: | |
17 | 20 extern idtP |
21 ; TODO: make this pointer thing more insightfull: | |
22 ;xchg bx, bx ; For debugging with bochs | |
23 lidt [idtP] | |
14 | 24 ret |
25 | |
17 | 26 %macro pushAll 0 |
27 push rax | |
28 push rcx | |
29 push rdx | |
30 push rbx | |
31 push rbp | |
32 push rsi | |
33 push rdi | |
34 %endmacro | |
35 | |
36 %macro popAll 0 | |
37 pop rdi | |
38 pop rsi | |
39 pop rbp | |
40 pop rbx | |
41 pop rdx | |
42 pop rcx | |
43 pop rax | |
44 %endmacro | |
45 | |
14 | 46 ; Define macro with two arguments: |
47 %macro INTX 2 | |
48 global %1 | |
49 %1: | |
50 ; Do some saving: | |
18
6129643f5c34
Fixed interrupt issue, ds, es, ss, fs and gs were not initialized to 0
windel
parents:
17
diff
changeset
|
51 cli |
17 | 52 pushAll |
18
6129643f5c34
Fixed interrupt issue, ds, es, ss, fs and gs were not initialized to 0
windel
parents:
17
diff
changeset
|
53 ;xchg bx,bx |
6129643f5c34
Fixed interrupt issue, ds, es, ss, fs and gs were not initialized to 0
windel
parents:
17
diff
changeset
|
54 |
17 | 55 extern %2 |
56 call %2 | |
14 | 57 ; Do restoration |
17 | 58 popAll |
18
6129643f5c34
Fixed interrupt issue, ds, es, ss, fs and gs were not initialized to 0
windel
parents:
17
diff
changeset
|
59 ;xchg bx, bx |
6129643f5c34
Fixed interrupt issue, ds, es, ss, fs and gs were not initialized to 0
windel
parents:
17
diff
changeset
|
60 sti |
17 | 61 iretq |
14 | 62 |
63 %endmacro | |
64 | |
65 ; Exception handlers: | |
66 INTX INTDEF, INTDEF_handler | |
67 INTX INT0, INT0handler | |
68 INTX INT1, INT1handler | |
69 INTX INT2, INT2handler | |
70 INTX INT3, INT3handler | |
71 INTX INT4, INT4handler | |
72 INTX INT5, INT5handler | |
73 INTX INT6, INT6handler | |
74 INTX INT7, INT7handler | |
75 INTX INT8, INT8handler | |
76 INTX INT9, INT9handler | |
77 INTX INT10, INT10handler | |
78 INTX INT11, INT11handler | |
79 INTX INT12, INT12handler | |
80 INTX INT13, INT13handler | |
81 INTX INT14, INT14handler | |
82 INTX INT15, INT15handler | |
83 INTX INT16, INT16handler | |
84 INTX INT17, INT17handler | |
85 INTX INT18, INT18handler | |
86 INTX INT19, INT19handler | |
87 | |
88 INTX INT32, INT32handler | |
89 INTX INT33, INT33handler | |
90 INTX INT34, INT34handler | |
91 |