File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 66[GLOBAL vectors_start]
77[EXTERN interrupt_gate]
88
9- [SECTION .reserved_0 .idt]
9+ [SECTION .data .idt]
1010; Interrupt descriptor table with 256 entries
1111; TODO: use a interrupt stack instead of the current stack.
1212idt:
1313; reserve space for 256x idt entries (16 bytes each)
1414resb 16 * 256
1515
16- [SECTION .data32 ]
16+ [SECTION .data.idt_descr ]
1717idt_descr:
1818 dw 256 * 8 - 1 ; 256 entries
1919 dq idt
@@ -22,13 +22,14 @@ idt_descr:
2222; bytes. DO NOT modify the wrapper, instead change the wrapper_body if needed.
2323; if the vector has to be modified into more than 16 bytes,
2424; arch::x86_64:: interrupt::_idt_init() must be modified accordingly
25- [SECTION .data32 .vectors]
25+ [SECTION .text .vectors]
2626%macro vector 1
2727align 16
2828vector_% 1 :
2929 push rbp
3030 mov rbp , rsp
3131 push rax
32+ push rbx
3233 mov al , % 1
3334 jmp vector_body
3435%endmacro
@@ -60,7 +61,9 @@ vector_body:
6061 and rax , 0xff
6162 ; call the interrupt handling code with interrupt number as parameter
6263 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
6467
6568 ; restore volatile registers
6669 pop r11
@@ -73,6 +76,7 @@ vector_body:
7376 pop rcx
7477
7578 ; ... also those from the vector wrapper
79+ pop rbx
7680 pop rax
7781 pop rbp
7882
You can’t perform that action at this time.
0 commit comments