Reads data from the kernel and prints it in an informative format.
- Run
make
- Execute
./proc_parse [read_rate] [print_rate]
read_rate
specifies how frequently (in seconds) that data is read from the kernel and averagedprint_rate
specifies how frequently (in seconds) that the averages are printed tostdout
-
In this part, you are asked to write a program to report the behavior of the Linux kernel. Your program should run in two different versions
-
Version One:
- Prints to
stdout
- Processor type
- Parsed from
/proc/cpuinfo
- Parsed from
- Kernel version
- Parsed from
/proc/version
- Parsed from
- Amount of configured memory
- Parsed from
/proc/meminfo
- Parsed from
- Uptime
- Parsed from
/proc/uptime
- Parsed from
- Processor type
- Prints to
-
Version Two:
- Prints continuously based on print_rate
- The percentage of time the processor(s) spend in user mode, system mode, and the percentage of time the processor(s) are idle
- Parsed from
/proc/stat
- Parsed from
- The amount and percentage of available (or free) memory
- Parsed from
/proc/meminfo
- Parsed from
- The rate (number of sectors per second) of disk read/write in the system
- Parsed from
/proc/diskstats/
- Parsed from
- The rate (number per second) of context switches in the kernel
- Parsed from
/proc/stat
- Parsed from
- The rate (number per second) of process creations in the system
- Parsed from
/proc/loadavg
- Parsed from
- The percentage of time the processor(s) spend in user mode, system mode, and the percentage of time the processor(s) are idle
- Prints continuously based on print_rate
Implements a very primitive shell that knows how to launch new programs in the foreground and the background as well as recognizes several internal commands
- Run
make
./shell
to launch shell
- Recognizes the following internal commands
-
exit
- Uses system call exit()
-
jobs
- Custom naive job database
-
cd
- Uses system call chdir()
-
fg*
-
bg*
* Not yet implemented
-
- Run programs
./program [arg1][arg2]...[argN]
supported