hello guys,
i'm required to modify the process scheduling part of the freebsd kernel as part of our homework.
the homework needs us add a new variable to the process data structure, and the priority of the process will be having something to do with the variable.
to adjust the variable while the process is running, we also required to write a system call to modify the variable on the fly.
the problem is how to get the process data structure via the pid in the syscall routine?
i'm not familiar with bsd nor linux. i noticed that there is a function called find_task_by_pid that can do this, but i did find identical under freebsd.
my second question is, to finish this homework, we need to modify the runq_choose function defined under the kern_switch.c
problem is, according to the homework requirement, we want only the "real time" and "time sharing" processes to use the new scheduling strategy. but how can i know the type of the running queue in that function? i've noticed a variable called pri, is that a hint of the type of the running queue?
thank you.
i'm required to modify the process scheduling part of the freebsd kernel as part of our homework.
the homework needs us add a new variable to the process data structure, and the priority of the process will be having something to do with the variable.
to adjust the variable while the process is running, we also required to write a system call to modify the variable on the fly.
the problem is how to get the process data structure via the pid in the syscall routine?
i'm not familiar with bsd nor linux. i noticed that there is a function called find_task_by_pid that can do this, but i did find identical under freebsd.
my second question is, to finish this homework, we need to modify the runq_choose function defined under the kern_switch.c
problem is, according to the homework requirement, we want only the "real time" and "time sharing" processes to use the new scheduling strategy. but how can i know the type of the running queue in that function? i've noticed a variable called pri, is that a hint of the type of the running queue?
thank you.