kernel32.asm:[BITS 32]
global start
extern _main
jmp start
global _idt_load
extern _idtp
_idt_load:
lidt [_idtp]
ret
start:
;hlt
call _main
Stop:
jmp Stop
kernel.c:#include <video.h>
#include <system.h>
int main()
{
//ClearScreen(0x00);
//printf(" Installing IDT...\n",15);
//halt();
idt_install();
//printf(" Successfully installed IDT!\n",15);
//isrs_install();
//printf("Welcome to Protected Mode\n", 15);
//printf("This is the Test for the \\n-Case", 15);
//int i;
//i=10/0;
//printc(i,7);
while(1)
asm volatile ("nop");
return(0);
}
idt.c:#include <idt.h>
#include <isr.h>
struct idt_entry idt[256];
struct idt_ptr idtp;
extern void idt_load();
void idt_set_gate(int num, unsigned short base, unsigned short sel, unsigned char flags)
{
idt[num].base_low = (base & 0xFFFF);
idt[num].base_high = (base >> 16) & 0xFFFF;
idt[num].sel = sel;
idt[num].always0 = 0;
idt[num].flags = flags;
};
void idt_install()
{
idtp.limit = (sizeof(struct idt_entry) * 256) -1;
idtp.base = &idt;
memset(&idt, 0, sizeof(struct idt_entry) * 256);
idt_set_gate(0, (unsigned)isr0, 0x08, 0x0E);
idt_set_gate(1, (unsigned)isr1, 0x08, 0x0E);
idt_set_gate(2, (unsigned)isr2, 0x08, 0x0E);
idt_set_gate(3, (unsigned)isr3, 0x08, 0x0E);
idt_set_gate(4, (unsigned)isr4, 0x08, 0x0E);
idt_set_gate(5, (unsigned)isr5, 0x08, 0x0E);
idt_set_gate(6, (unsigned)isr6, 0x08, 0x0E);
idt_set_gate(7, (unsigned)isr7, 0x08, 0x0E);
idt_set_gate(8, (unsigned)isr8, 0x08, 0x0E);
idt_set_gate(9, (unsigned)isr9, 0x08, 0x0E);
idt_set_gate(10, (unsigned)isr10, 0x08, 0x0E);
idt_set_gate(11, (unsigned)isr11, 0x08, 0x0E);
idt_set_gate(12, (unsigned)isr12, 0x08, 0x0E);
idt_set_gate(13, (unsigned)isr13, 0x08, 0x0E);
idt_set_gate(14, (unsigned)isr14, 0x08, 0x0E);
idt_set_gate(15, (unsigned)isr15, 0x08, 0x0E);
idt_set_gate(16, (unsigned)isr16, 0x08, 0x0E);
idt_set_gate(17, (unsigned)isr17, 0x08, 0x0E);
idt_set_gate(18, (unsigned)isr18, 0x08, 0x0E);
idt_set_gate(19, (unsigned)isr19, 0x08, 0x0E);
idt_set_gate(20, (unsigned)isr20, 0x08, 0x0E);
idt_set_gate(21, (unsigned)isr21, 0x08, 0x0E);
idt_set_gate(22, (unsigned)isr22, 0x08, 0x0E);
idt_set_gate(23, (unsigned)isr23, 0x08, 0x0E);
idt_set_gate(24, (unsigned)isr24, 0x08, 0x0E);
idt_set_gate(25, (unsigned)isr25, 0x08, 0x0E);
idt_set_gate(26, (unsigned)isr26, 0x08, 0x0E);
idt_set_gate(27, (unsigned)isr27, 0x08, 0x0E);
idt_set_gate(28, (unsigned)isr28, 0x08, 0x0E);
idt_set_gate(29, (unsigned)isr29, 0x08, 0x0E);
idt_set_gate(30, (unsigned)isr30, 0x08, 0x0E);
idt_set_gate(31, (unsigned)isr31, 0x08, 0x0E);
idt_load();
};
void fault_handler(struct regs *r)
{
if(r->int_no < 32)
{
printf(exception_messages[r->int_no]);
printf(" Exception. System halted!\n");
for(;;);
}
};
idt.h:#ifndef IDT_H
#define IDT_H
struct idt_entry
{
unsigned short base_low;
unsigned short sel;
unsigned char always0;
unsigned char flags;
unsigned short base_high;
} __attribute__ ((packed));
struct idt_ptr
{
unsigned short limit;
unsigned int base;
} __attribute__ ((packed));
void idt_set_gate(int, unsigned short, unsigned short, unsigned char);
void idt_install();
#endif
so dass is der code, von dem ich vermute, dass er schuld is