>>5
Let me preface this with "we're not here to do your homework for you". Obviously, it's a lot of code and you'll probably end up adding only a couple lines. You don't need to read the code (and if you started reading it, you fucked up already). Just open it up in a browser and start Ctrl-F'ing.
The next suggestion is to listen to your professor. Back when I was in school, we had a couple similar assignments (except with the Windows Research Kernel). Each day the professor would drop a couple of hints; a week before the project was due he pretty much described the entire scheduling system in detail, pointing out the places which needed changes. I hope you were paying attention (if not, just bother them during their office hours).
Anyway,
enqueue_task is a good place to start, but isn't where you want to make modifications. The reason is because everyone and their mom is going to be calling this function, and the purpose of the function is to jut the task into the queue; nothing more.
If you Ctrl-F around the code, you should turn up
scheduler_tick and
schedule (which are nice big functions which make better starting points). IIRC, the former is called by a timer interrupt and is responsible for maintaining the time_slice state of the tasks, while the later is the main scheduler function.
Read through and make sure you understand what's generally going on in the main scheduler function, with special attention to lines 3011-3030. As a hint,
sched_find_first_bit returns the priority that's currently executing.
You should not make any changes to the main
schedule function, but if you understand those 20 lines of code (and understand how, exactly, Linux is assigning task priorities in the first place) you'll see and understand exactly where you should hook in to assign your own task priorities.