Functions for reading/writing some special registers

This commit is contained in:
2018-02-13 12:47:50 +01:00
parent 96d2ebd977
commit c1c3842ace
5 changed files with 37 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
#include "interrupts.c"
uintptr_t isr_table[] ={};
void load_idt(struct idtr *_)
void load_idt(void *_)
{
(void)_;
}

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

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