Do T&W Chapter 2, Exercise 45. See Shortest Process Next section on pp. 106-107 for some hints. Implementation of scheduling in MINIX is discussed on pages 182-185 of T&W.