forked from uditvyas/xv6-MLFQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4801cb
commit 3940a2b
Showing
8 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -718,3 +718,9 @@ int cps() | |
release(&ptable.lock); | ||
return 22; | ||
} | ||
|
||
int getpinfo(struct pstat* pstat) | ||
{ | ||
; | ||
return 23; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
#include "proc.h" | ||
#include "param.h" | ||
|
||
|
||
struct pstat{ | ||
int inuse[NPROC]; // whether this slot of the process table is in use (1 or 0) | ||
int pid[NPROC]; // PID of each process | ||
int priority[NPROC]; // current priority level of each process (0-3) | ||
enum procstate state[NPROC]; // current state (e.g., SLEEPING or RUNNABLE) of each process | ||
int ticks[NPROC][4]; // number of ticks each process has accumulated at each of 4 priorities | ||
}; | ||
|
||
typedef struct pstat pstat; | ||
// extern struct pstat pstat_var; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ | |
#define SYS_mkdir 20 | ||
#define SYS_close 21 | ||
#define SYS_cps 22 | ||
#define SYS_getpinfo 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ SYSCALL(sbrk) | |
SYSCALL(sleep) | ||
SYSCALL(uptime) | ||
SYSCALL(cps) | ||
SYSCALL(getpinfo) |