資源簡介
一個比較詳細的進程管理系統,包含多種命令,例如 req, rel, show, init, del, cle, cre 等,模擬linux命令,具體實現方式在博客中有介紹(如果想過操作系統實驗,建議參考這個代碼)。
代碼片段和文件信息
#include?
#include?
#include?
/*
*?Processing?manager
*?Author?WUD?(Wangjunx)
*?Date?2018.11.01
*?Email:?wjx.wud@gmail.com
*?Contact:?Harbin?Institute?Of?Technology?At?Weihai?(Cyberpace?Security)
*?Ver?1.0
*/
using?namespace?std;
/*進程結構體??#Process#*/
typedef?struct?Process?{
????????char?Name;???????????//?進程名
????????int?PID;????????????????//?進程號
????????int?Memory;??????????????//?內存大小
????????char?State[9];???????//?狀態
????????int?PRI;????????????????//?優先級
????????char?*Others;????//?其他資源
????????int?link_ID;????????????//占用的內存ID號
};
/*資源結構體??#Resource#*/
typedef?struct?Resource{
????????int?RID;?????????????????//?資源標識符
????????char?State[5];????????//?資源狀態
????????char?Pname[2];?????????//?被資源占用導致等待的進程隊列
};
void?Proc
評論
共有 條評論