Your answers should be submitted as a plain text file hw02.txt, a postscript file hw02.ps, or a PDF file hw02.pdf.
Process | Burst Time |
P1 | 10 |
P2 | 1 |
P3 | 2 |
P4 | 1 |
P5 | 5 |
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, and all at time 0. (2 points)
Note: there is also a recent FreeBSD implementaion of fair-share scheduling. See this web page for more information.
The FreeBSD kernel source code is found under the /sys subdirectory on the systems in the lab. Since it's always nice to see how things are done in a real system, I'd like you to check out several key files.
Traditionally, process state ("process control block") in Unix has been divided between two data structures: the proc structure and the user structure.
The proc structure is located in /sys/sys/proc.h. The main definition is struct proc. You will notice several familiar (and even more unfamiliar) fields in this structure. Find several fields related to CPU scheduling. Do the same for the user structure in /sys/sys/user.h. Where are the actual CPU registers stored? Check out /sys/i386/include/pcb.h to see what registers are saved on the Intel 386 architecture.
Another thing to notice are a few global variables. The global variable curproc always points to the proc structure for the currently executing process.
Other related global variables:
CPU scheduling-related code can be found in the following files:
4.3/4.4BSD uses a multilevel feedback queue scheduling algorithm:
There is nothing to turn in for this part, but look over the code.