Hi Brendan,
As it seems, your response is quite insightful, and if I ask some more questions, its because, I am a little slow, not that you left anything out in your explanation.
Brendan wrote:
The first part of designing anything is to figure out what the design should achieve. If the goals are "extremely easy to understand, for educational purposes" then you'll want a completely different design to "high performance".
I think its quite easy to have a design plan, where you want something for "educational purposes" and yet "high performance". For example, my OS is for "education purposes". I don't think I would be able to commercially make it successful, at this age.

Yet, I want to make a "high performance" scheduler, so that I could learn the most from it. Maybe this is a little confused design goal, but yet I myself am a confused guy...
Brendan wrote:
So, for the first step, here's a list of design goals (that may or may not apply to any OS other than mine):
I am great full, that you shared the list of design goals, and would like to comment on some of it.
Brendan wrote:
Scheduler should have several policies, where each policy also has task priorities, and each policy may have an entirely different algorithm to determine which task within the policy is the best task to run. For an example, it could have a "real time" policy for tasks that have strict requirements (that uses "earliest deadline first" scheduling), a "normal" policy for normal tasks (that uses a different type of scheduling) and a "background task" policy (that uses "highest priority task gets the CPU" scheduling).
If I get this right, this is more like, you have different scheduling algorithms, and each is used according to the task. So this means, you could have like one task which is scheduled differently, while the other is scheduled differently. So we would have to first decide which policy should be scheduled this time. So another algorithm for this. Wouldn't this become a little more confusing than the normal design?
Brendan wrote:
The scheduling policy and priority used by tasks should be explicit. This means tasks control their own policy and priority (up to some maximum for the task, which is set by whatever created the task); and the scheduler does not attempt to dynamically adjust task priorities using some stupid guesswork that is guaranteed to make the wrong decisions in certain cases (like the borked beyond belief Linux scheduler).
So wouldn't this mean, that a foolish programmer could just set its policy and priority to something very high so that it becomes highly responsive? Well, I doubt any foolish programmer would do the work to use my OS, but still....
Brendan wrote:
The OS should measure the performance of CPUs, and calculate important scheduling parameters (e.g. how long each task gets the CPU for) based on actual CPU performance. For an oversimplified example, assume one of the scheduling policies uses "round robin" - on a fast Nehalem giving each task 1 ms of CPU time might be a good idea (but that's far too fast for an old 80486); and on an old 80486 giving each task 100 ms of CPU time might be a good idea (but that's far too slow for a fast Nehalem).
Hmm, would this be like, calculate the CPU performance OR get the CPU model, and look it up in something like a performance table? Moreover, this would be like setting dynamic time for tasks, right?
Well thanks sir, for all the good points, and I have got some ideas noted down in my notebook.
Regards,
Shikhin