hatfield-c / xv6-project2

The second project for the xv6 operating system. Must replace the Round Robin scheduler with a lottery scheduler.
1 stars 0 forks source link

[LOT-6] A Process Statistics System Call Will Be Available In User Space #6

Closed hatfield-c closed 6 years ago

hatfield-c commented 6 years ago

We need to develop a system call that will gather use statistics regarding all processes currently running. This system call will receive a custom struct as an argument, and this struct will be populated by the kernel, where it can then be accessed from user space. The system call has the prototype: int getpinfo(struct pstat *)

And the custom structure will have the definition of:

#ifndef _PSTAT_H_
#define _PSTAT_H_
#include "param.h"
struct pstat {
    int inuse[NPROC]; // whether this slot of the process table is in use (1 or 0)
    int tickets[NPROC]; // the number of tickets this process has
    int pid[NPROC]; // the PID of each process
    int ticks[NPROC]; // the number of ticks each process has accumulated
};
#endif // _PSTAT_H_

As part of the professors requirement, we must mimic how this pointer is security checked when it is given, like other system calls. The routine should return 0 if successful, or -1 otherwise.

hatfield-c commented 6 years ago

This issue is now ready for QA.

hatfield-c commented 6 years ago

This issue has passed QA, and will now be merged with master.

hatfield-c commented 6 years ago

This issue is now complete, and will be closed.