
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An operating systems programming assignment for ecs 150 students during the fall quarter 2008. The assignment involves adding two custom system calls, get2pid and getchpid, to the minix kernel. Students are required to write a program to demonstrate the functionality of these system calls and validate the results using existing system calls. Hints and extra credit opportunities are provided.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

ECS 150, Operating Systems Fall Quarter 2008
Due Date: November 12, 2008 Points: 100
int get2pid(pid t *mypid, pid t *parentpid)
This system call returns the PID of the current process in the variable at the address contained in mypid, and the PID of the current process’ parent in the variable at the address contained in parentpid. If either argument is the NULL pointer, nothing for that particular variable is returned. The system call returns 0 if both pointers are valid for the calling program or NULL ; otherwise it returns −1. Be sure to check that the addresses lie within user space for the calling process! Write a program to demonstrate your call works. Validate the results using getpid and getppid. Hint: To add the system call into the kernel, see how getpid and getppid work.
int getchpid(int n, pid t childpid[])
This system call returns the PIDs of up to n children of the current process in the array childpid and returns the number of PIDs entered into the array. If either n is non-positive or childpid is NULL , the system call simply returns the number of child processes of the current process. If childpid points to an address outside the process’ user address space, or an error of any kind occurs, the system call returns −1. Write a program to demonstrate your call works.
Version of November 10, 2008 at 10:14pm Page 1 of 1