Skip to content

Commit b985a5b

Browse files
committed
idt: mm: move idt and vectors also to upper memory
1 parent 6df3fe6 commit b985a5b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/arch/x86_64/asm/vectors.s

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
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.
1212
idt:
1313
; reserve space for 256x idt entries (16 bytes each)
1414
resb 16 * 256
1515

16-
[SECTION .data32]
16+
[SECTION .data.idt_descr]
1717
idt_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
2727
align 16
2828
vector_%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

0 commit comments

Comments
 (0)