Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1022 Bytes

README.md

File metadata and controls

25 lines (15 loc) · 1022 Bytes

A Kernel Seedling

A kernel module that returns the number of processes in using /proc/count.
Developed for CS 111, Operating System Principles with Paul Eggert.

Building

In the lab0 directory, type make.
The resulting proc_count.ko file is the kernel module.

Running

To run the module, type sudo insmod proc_count.ko.
Now, if we run lsmod | grep proc_count we can see the module is running.
To list the number of processes, type cat /proc/count. This should write an integer of how many processes there are followed by a newline.

Cleaning Up

To remove the module, type sudo rmmod proc_count.

Testing

Tested on kernel verison 5.14.8

Testing scripts: the included test_lab0.py script was used to ensure the module could correctly build and to ensure it exhibited the correct behavior. In addition, the number of active proccesses were counted and compared to the returned integer. The number of active programs were close enough to be accurate.e