Get sycalls working in usermode (And all interrupts)

This commit is contained in:
pjht 2019-02-11 13:43:40 -06:00
parent b3e086e452
commit d54a55aad0
2 changed files with 21 additions and 21 deletions

View File

@ -8,7 +8,7 @@ void set_idt_gate(int n,uint32_t handler) {
idt[n].low_offset=low_16(handler); idt[n].low_offset=low_16(handler);
idt[n].sel=KERNEL_CS; idt[n].sel=KERNEL_CS;
idt[n].always0=0; idt[n].always0=0;
idt[n].flags=0x8E; idt[n].flags=0xEE;
idt[n].high_offset=high_16(handler); idt[n].high_offset=high_16(handler);
} }

View File

@ -27,26 +27,26 @@ void kmain(multiboot_info_t* header) {
} }
vga_init(info); vga_init(info);
vga_write_string("Hello\n"); vga_write_string("Hello\n");
// asm volatile(" \ asm volatile(" \
// cli; \ cli; \
// mov $0x23, %ax; \ mov $0x23, %ax; \
// mov %ax, %ds; \ mov %ax, %ds; \
// mov %ax, %es; \ mov %ax, %es; \
// mov %ax, %fs; \ mov %ax, %fs; \
// mov %ax, %gs; \ mov %ax, %gs; \
// \ \
// mov %esp, %eax; \ mov %esp, %eax; \
// pushl $0x23; \ pushl $0x23; \
// pushl %eax; \ pushl %eax; \
// pushf; \ pushf; \
// pop %eax; \ pop %eax; \
// or $0x200,%eax; \ or $0x200,%eax; \
// push %eax; \ push %eax; \
// pushl $0x1B; \ pushl $0x1B; \
// push $1f; \ push $1f; \
// iret; \ iret; \
// 1: \ 1: \
// "); ");
vga_write_string("UMODE!\n"); vga_write_string("UMODE!\n");
port_byte_out(0xe9,'U'); port_byte_out(0xe9,'U');
port_byte_out(0xe9,'M'); port_byte_out(0xe9,'M');