TAYLOR COS 421 - Study References

Unformatted text preview:

1 PurposeThis is your first assignment that really doe s a “real” thing inside the kernelinstead of a quick exercise. This project will create an infrastructure that youwill use in the following assignment. You must create a data structure andcorresponding /proc files that represent the group of processes owned by eachuser ID. This data structure should be always kept up to date so that when the/proc files are queried for the information they contain, they can immediatereturn an answer instead of having to go through the list of all the processesand determine on the fly whether they are owned by the desired user ID.2 ExercisesThis assignment is broken down into two parts: creating the data structure andrelaying the information in the data structure via the /proc filesystem.2.1 Creating the data structureYou must create a data structure that keeps track of all the processes for eachuser ID. This data structure should be updated whenever a new process iscreated, an existing process is destroyed, or an existing process changes owners.2.2 Creating the /proc filesYou must create a directory in /proc that holds a set of files. One file should becreated for each user in the above data structure. The name of the file shouldbe the uid of that user. Each file should be readable, but not writeable since wewant to query the values in this data structure–not change them. When a file isread, it should rep ort the process IDs of each process owned by the appropriateuser. This report should separate the IDs by a single space.3 Helpful hintsUse your code from your previous assignments. They were specifically designedto help you know how to approach this assignment. They gave you the infor-mation to create the /proc files, create new source in the kernel, and use thefunctionality from a userspace program.Do as much development as you can in userspace since you have access to amuch more robust set of tools. It is also easier to re cover from an applicationcrashing than from the kernel crashing. When you think you’ve got thingsworking, then you can move on to putting the functionality in the kernel. Youwill probably have things working correctly and so you won’t have to deal withrandom crashes b ec ause of faulty code.Do incremental development within the kernel so that you don’t depend onthe whole thing working before you start testing. It is too difficult to determine1where problems exist in the kernel to do something like this. Instead, you shoulddo one thing and see if the kernel did that correctly. Then add something elseand test again. This will greatly increase you chances of success.4 ConstraintsThere are no new constraints from this assignment from the previous assign-ment. You must write this in C and have it work on my laptop, but you won’tbe doing anything kernel version specific so things should just


View Full Document

TAYLOR COS 421 - Study References

Download Study References
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study References and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study References 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?