File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 6
6
[GLOBAL vectors_start]
7
7
[EXTERN interrupt_gate]
8
8
9
- [SECTION .reserved_0 .idt]
9
+ [SECTION .data .idt]
10
10
; Interrupt descriptor table with 256 entries
11
11
; TODO: use a interrupt stack instead of the current stack.
12
12
idt:
13
13
; reserve space for 256x idt entries (16 bytes each)
14
14
resb 16 * 256
15
15
16
- [SECTION .data32 ]
16
+ [SECTION .data.idt_descr ]
17
17
idt_descr:
18
18
dw 256 * 8 - 1 ; 256 entries
19
19
dq idt
@@ -22,13 +22,14 @@ idt_descr:
22
22
; bytes. DO NOT modify the wrapper, instead change the wrapper_body if needed.
23
23
; if the vector has to be modified into more than 16 bytes,
24
24
; arch::x86_64:: interrupt::_idt_init() must be modified accordingly
25
- [SECTION .data32 .vectors]
25
+ [SECTION .text .vectors]
26
26
%macro vector 1
27
27
align 16
28
28
vector_% 1 :
29
29
push rbp
30
30
mov rbp , rsp
31
31
push rax
32
+ push rbx
32
33
mov al , % 1
33
34
jmp vector_body
34
35
%endmacro
@@ -60,7 +61,9 @@ vector_body:
60
61
and rax , 0xff
61
62
; call the interrupt handling code with interrupt number as parameter
62
63
mov rdi , rax
63
- call interrupt_gate
64
+ mov rbx , interrupt_gate
65
+ ; TODO fix the long jump. I don't want to waste another register
66
+ call rbx
64
67
65
68
; restore volatile registers
66
69
pop r11
@@ -73,6 +76,7 @@ vector_body:
73
76
pop rcx
74
77
75
78
; ... also those from the vector wrapper
79
+ pop rbx
76
80
pop rax
77
81
pop rbp
78
82
You can’t perform that action at this time.
0 commit comments