summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
Diffstat (limited to 'rt')
-rw-r--r--rt/+x86_64/realcall.S11
1 files changed, 7 insertions, 4 deletions
diff --git a/rt/+x86_64/realcall.S b/rt/+x86_64/realcall.S
index ffbc0a9..1c51f99 100644
--- a/rt/+x86_64/realcall.S
+++ b/rt/+x86_64/realcall.S
@@ -21,6 +21,8 @@ prev_idt:
.quad 0x0
prev_gdt:
.quad 0x0
+ .short 0x0
+ # :The 64 bits sidt stores on 8+2 bytes
# :real_call
# This function is intended to be called from long mode
@@ -55,7 +57,7 @@ bios.call:
cli
- sidt (prev_idt)
+ #sidt (prev_idt)
sgdt (prev_gdt)
lgdt (gdtr32)
@@ -122,6 +124,7 @@ real_call_int:
cli
+ xchg %bx, %bx
mov %es, (res)
mov %eax, (reax)
mov %ebx, (rebx)
@@ -155,14 +158,13 @@ real_call_to_pmode_up:
or $1 << 31, %eax
mov %eax, %cr0
- lgdt (prev_gdt)
-
# :At this point %ds is latest in stack
pop %ax
# :At this point %cs is latest in stack
# Do a long jump
push $real_call_to_longmode_up
+ lgdt (prev_gdt)
retf
.code64
real_call_to_longmode_up:
@@ -174,7 +176,7 @@ real_call_to_longmode_up:
# :Avoid doing this until the bootloader loads a 64 bits IDT
# XXX
- #idt (prev_idt)
+ # lidt (prev_idt)
real_call_end:
popf
@@ -183,4 +185,5 @@ real_call_end:
pop %r13
pop %r12
pop %rbx
+ cli
ret