Goals: Understand how the scheduler works. Understand how to implement a scheduling policy and characterize its impact on performance. Understand priority inversion and a possible solution for it.

System Call

setpriority() system call을 추가하기 위해서,

  • proc.csetpriority(int pid, int val)를 implement한다.
  • defs.h에 setpriority의 정의를 추가한다.
  • sysproc.c에 handler function sys_setpriority()를 추가한다. 이때, argint()를 사용해 argument들을 가져와 setpriority()를 실행한다.
  • syscall.h에 새로운 system call number(SYS_setpriority)를 정의한다.
  • syscall.c에 handler function을 정의하고, syscall table에 해당 function을 추가한다.
  • usys.SSYSCALL(setpriority)를 추가한다.
  • user program이 해당 system call을 사용할 수 있도록 user.h에 setpriority의 정의를 추가한다.