scheduler/scheduling?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gtsphere

scheduler/scheduling?

Post 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
Whatever5k

Re:scheduler/scheduling?

Post 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.
Post Reply