Page 1 of 1

scheduler/scheduling?

Posted: Fri Apr 11, 2003 9:53 pm
by gtsphere
I have a question, when you implement a scheduler, Round Robin for example. I'm guessing its coded inside of the kernel, but how do you actually make it take the process and schedule it, etc etc? I wrote a demostration of it, but we randomly generated the processes, how do you truly make it run, while allowing user chosen programs to be ran? I dunno if i said that clearly, but i can clarify if needed. Thanks!
-GT

Re:scheduler/scheduling?

Posted: Sat Apr 12, 2003 2:16 am
by Whatever5k
Call the scheduler every n clock ticks. Scheduler decides which process to pick and gives this process the CPU. This is done either by software task-switching or TSS. With software switching, you create a stack for the process, push everything on it that's important for the CPU to know (cs, ds, eip, eflags & co.) and you do an IRET. When using TSS, you just jump to the appropriate TSS selector.