This scheduler will be called when an irq 0 appears. This would look like this:
Code: Select all
pushad
push fs
push gs
push es
push ds
mov eax,10
mov ds,eax
mov [thread_esp],esp
mov esp,[scheduler_esp]
mov al,20h
out 20h,al
iret
But now it will take the time which the thread gets to run and would reprogram the pit to this time. So that the thread gets the whole time without that the pit will be firing at a given period!
Code: Select all
call search_new_thread_to_run
call reprogram_pit
mov esp,eax
mov cr3,ebx
pop ds
pop es
pop fs
pop gs
popad
ret ;maybe an iret??
So now say what you are thinking about my idea!