Functions for reading/writing some special registers

This commit is contained in:
thomas committed 2018-03-20 14:11:21 +01:00
1 parent 96d2ebd977
commit c1c3842ace
5 files changed
+37 -9

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
#include "interrupts.c"
uintptr_t isr_table[] ={};
void load_idt(struct idtr *_)
void load_idt(void *_)
{
(void)_;
}
-5
View File
@@ -1,10 +1,5 @@
.intel_syntax noprefix
.global load_idt
load_idt:
lidt [rdi]
ret
.extern int_handler
.global isr_common
.global isr_return
+23
View File
@@ -0,0 +1,23 @@
.intel_syntax noprefix
.global load_idt
load_idt:
lidt [rdi]
ret
.global read_cr0
read_cr0:
mov rax, cr0
ret
.global read_cr2
read_cr2:
mov rax, cr2
ret
.global read_cr3
read_cr3:
mov rax, cr3
ret
.global read_cr4
read_cr4:
mov rax, cr4
ret