Scheduler(Multitasking) design
Posted: Tue Nov 11, 2003 1:36 pm
There was that idea in my head and I don?t know if I should use it in my OS. I want to hear your opinions on that!
This scheduler will be called when an irq 0 appears. This would look like this:
The scheduler will now search for a new thread ready to run. So far normal 
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!
The problem which I see is that the reprogram of the pit could be slow?!
So now say what you are thinking about my idea!
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!