Commit 515d0d6d by malcolm

Fixed GCC flags and added ASM calls

parent 21be04fc
Showing with 6 additions and 5 deletions
......@@ -3,13 +3,13 @@
typedef struct{
uint16_t limit;
uint32_t base;
}gdtr;
}__attribute__((packed)) gdtr;
static gdt_desc _gdt [MAX_GDT_DESC];
static gdtr _gdtr;
static void gdt_install () {
//TODO: VOODOO MAGIC
asm volatile("lgdt [%0]": : "p"(&_gdtr));
}
void gdt_set_desc(uint32_t i, uint64_t base, uint64_t limit, uint8_t access, uint8_t gran)
......
......@@ -24,7 +24,7 @@ typedef struct{
uint8_t flags;
uint8_t gran;
uint8_t high_base;
} gdt_desc;
} __attribute__((packed)) gdt_desc;
extern void gdt_set_desc(uint32_t i, uint64_t base, uint64_t limit, uint8_t access, uint8_t gran);
extern gdt_desc* gdt_get_desc(int i);
......
......@@ -3,13 +3,14 @@
typedef struct{
uint16_t limit;
uint32_t base;
} idtr;
} __attribute__((packed)) idtr;
static idt_desc _idt [MAX_IDT_INT];
static idtr _idtr;
static void idt_install () {
//TODO: VOODOO MAGIC
asm volatile ("lidt [%0]": : "p"(&_idtr));
}
static void default_handler () {
//DEBUG OUTPUT MAYBE?
......
......@@ -20,7 +20,7 @@ typedef struct {
uint8_t reserved;
uint8_t flags;
uint16_t high_base;
} idt_desc;
} __attibute__((packed)) idt_desc;
extern idt_desc* get_ir (uint32_t i);
extern int install_ir (uint32_t i, uint16_t flags, uint16_t code_sel, IRQ_HANDLER);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment