組長:B10415053 陳柏宏
github: https://github.com/NEIL555/xv6-public

ps即為印出現在process的狀態

使用foo新增process

foo三次後ps,若executine time都一樣,預設是給最後來的process先做

使用chex來改變process的execution time

最後判定出execution time最短的process就會先running

新增功能:
foo:新增process
cps:印出process的運作狀況
chex:更改process的execution time
判斷排程的方法:
修改scheduler(in proc.c)
在proc.c中新增cps和change execution time的功能


在alloproc(in proc.c)預設execution time=2

新增foo.c

新增chex(in proc.c)

在sysproc.c中新增對應的system call function

在syscall.h中定義system call

在defs.h中新增system call

在user.h中定義function

在usys.S中定義system call調用的function

在syscall.c中定義system call


在proc.c中修改scheduler function

在makefile中新增指令

在這次的作業中,花了不少時間去查詢如何實作、trace xv6的程式碼,而開始實作後,原來不怎麼起眼的功能都需要牽涉到如此多的定義,因此在實作中需要非常謹慎。
第一次實作xv6光是了解各個file的定義和function的功能就花了非常多時間了,不過我相信萬事起頭難,搞懂之後想實作新的功能會更加得心應手,甚至更有興趣。