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
scheduler/scheduling?
Re:scheduler/scheduling?
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.