1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00

Add function "protected_initialize"

This commit is contained in:
Braiden Vasco 2017-11-02 16:36:28 +00:00
parent 1dbef1b866
commit 27ef31a4b0
3 changed files with 11 additions and 4 deletions

View file

@ -11,8 +11,7 @@ void main(struct KernelMQ_Multiboot_Info multiboot_info)
logger_info("Kernel initialization started."); logger_info("Kernel initialization started.");
gdt_initialize(); protected_initialize();
idt_initialize();
asm volatile ("int $0x3"); asm volatile ("int $0x3");
asm volatile ("int $0x4"); asm volatile ("int $0x4");

View file

@ -40,6 +40,9 @@ static struct IdtPointer idt_pointer;
static struct GdtEntry gdt_entries[GDT_SIZE]; static struct GdtEntry gdt_entries[GDT_SIZE];
static struct IdtEntry idt_entries[IDT_SIZE]; static struct IdtEntry idt_entries[IDT_SIZE];
static void gdt_initialize();
static void idt_initialize();
static void gdt_set_gate(int num, unsigned int base, unsigned int limit, unsigned char access, unsigned char gran); static void gdt_set_gate(int num, unsigned int base, unsigned int limit, unsigned char access, unsigned char gran);
static void idt_set_gate(unsigned char num, unsigned int base, unsigned short sel, unsigned char flags); static void idt_set_gate(unsigned char num, unsigned int base, unsigned short sel, unsigned char flags);
@ -80,6 +83,12 @@ void isr29();
void isr30(); void isr30();
void isr31(); void isr31();
void protected_initialize()
{
gdt_initialize();
idt_initialize();
}
void gdt_initialize() void gdt_initialize()
{ {
logger_info("Setup GDT."); logger_info("Setup GDT.");

View file

@ -1,7 +1,6 @@
#ifndef KERNELMQ_INCLUDED_PROTECTED #ifndef KERNELMQ_INCLUDED_PROTECTED
#define KERNELMQ_INCLUDED_PROTECTED 1 #define KERNELMQ_INCLUDED_PROTECTED 1
void gdt_initialize(); void protected_initialize();
void idt_initialize();
#endif #endif