Type 'make qemu' to boot xv6 operating system.
To print out user input to console
To copy contents of one file to another
Adding the cps() or the current process state system call
This file creates processes that consume CPU time
- the function takes in two arguments, the number of children to be created and the increment value( default is 1)
- fork is used to create children. The parent will wait for the child to finish before it goes back to the loop and the child will print out the process id and do some computation. This will consume some computing time so the status of the processes can be seen.
- later the parent will go back and create another child; the child does not create any other children.
The processes are assigned with a priority value between 0 and 20, the smaller the value, the higher the priority.
- Added priority to a struct proc in proc.h. This data structure is the PCB that consists of all the information about a process.
- Modified proc.c.Modified cps() so that it prints out the priority of the process also.
- Modified allocproc,which is a system call, a function that allocates resources to a new process by scanning through the process table
- Created a system call chpr(int,int) which takes in two arguments – the process id and it’s new priority.
- It scans through the process table and changes the priority of that process.
Modified the schedular in proc.c