Should this be happening, or am I doing something stupid that I didn't realize?
common IRQ handler:
Code: Select all
irq_common:
pusha
push ds
push es
push fs
push gs
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
cld
push esp
call irq_intHandler
add esp, 4
pop gs
pop fs
pop es
pop ds
popa
add esp, 8
iret
}
Code: Select all
void switchTask(regs_t *r){
if(processList == NULL) return;
if(processList->size <= 1) return;
memcpy(&(currentProcess->task->state), r, sizeof(regs_t));
switchTask_nextproc:
nextProcess = nextProcess->next;
if(nextProcess == NULL){
nextProcess = processList->tail;
}
currentProcess = nextProcess->data;
if(currentProcess->sleepCounter > 0){
goto switchTask_nextproc;
}
memcpy(r, &(currentProcess->task->state), sizeof(regs_t));
pg_switchDir(currentProcess->task->dir);
tss_setStack(r->esp);
}