~swisschili/bluejay

ee6d10de2d32711525dc37090f6b617a8526ad3a — swissChili 11 months ago aed6ff3 tasking-refactor
Finish refactor, add 0x80 and 0x81 to IDT
M src/kernel/descriptor_tables.c => src/kernel/descriptor_tables.c +3 -0
@@ 89,6 89,9 @@ void init_idt()
		idt_set_gate(i, (uint)isrs[i], 0x08, 0x8e);
	}

	idt_set_gate(0x80, (uint)isr128, 0x08, 0x8e);
	idt_set_gate(0x81, (uint)isr129, 0x08, 0x8e);

	idt_flush((uint)&idt_pointer);

	vga_write("IDT Initialized!\n");

M src/kernel/descriptor_tables.h => src/kernel/descriptor_tables.h +5 -0
@@ 104,6 104,11 @@ extern void isr29();
extern void isr30();
extern void isr31();

// Syscall
extern void isr128();
// Tasking setup
extern void isr129();

extern void irq0();
extern void irq1();
extern void irq2();

M src/kernel/idt.s => src/kernel/idt.s +2 -0
@@ 56,6 56,8 @@ ISRNOERR 29
ISRNOERR 30
ISRNOERR 31

ISRNOERR 128
ISRNOERR 129

	[extern isr_handler]
isr_common:

M src/kernel/main.c => src/kernel/main.c +2 -2
@@ 80,11 80,11 @@ int kmain(struct multiboot_info *mboot)
	init_tasks();
	kprintf("\ndone initializing tasks\n");

#ifdef TEST_THREADS
//#ifdef TEST_THREADS
	spawn_thread(other_thread, NULL);

	greet();
#endif
//#endif

#ifdef TEST_ATA_PIO
	test_ata_pio();

M src/kernel/task.c => src/kernel/task.c +2 -2
@@ 17,7 17,7 @@ void init_tasks()
{
	add_interrupt_handler(INIT_TASKS_INTERRUPT, _sys_init_tasks_h);

	asm("int $0x80");
	asm("int $0x81");
}

void _sys_init_tasks_h(struct registers *regs)


@@ 27,7 27,7 @@ void _sys_init_tasks_h(struct registers *regs)

void _init_tasks(uint kernel_esp, uint kernel_ebp, uint kernel_eip)
{
	kpanic("_init_tasks\n");
	kprintf("_init_tasks\n");

	processes[0] = (struct process){
		.exists = true,