Student: Alen Stojanov
Mentor: David van Moolenbroek
SVN branch name: src.20090525.r4372.astojanov
The goal of this project is to add /dev and /proc file systems to MINIX3.
getsysinfo(2)
for retrieval of system information by userland utilities like ps(1)
and top(1)
, and to provide a more consistent and extensible way of exposing system information in general.TBD
TBD
Familiarizing with the anticipated project work. Analysis and discussion with the mentor on the project design. Setting up the programming environment and the MINIX3 virtual box. Used programming enivronment – Eclipse with Remote System Explorer plug-in. The plug-in provides remote access to the MINIX3 file system, as well as remote compiling.
Graduation 2009 at Jacobs University. No implementation provided, The time spent during this week will be compensated with work during the weekends.
Use of the SMDB algorithm for creating the hash tables for (parent,name)→inode lookup. The method provides excellent distribution of the inodes in the hash-table.
ToDo
The most important part of the procfs is the /proc/[pid]/psinfo entry. All the informations concerning one process are presented in this file, and the data is very easy to be parsed. The current format of the psinfo has the following form (C programming language):
If the process is a kernel task:
"%d %d %d %s %d %c %d %ld %ld %d %ld %ld %ld %ld %ld %ld %ld %ld %ld"
Otherwise (a normal process):
"%d %d %d %s %d %c %d %ld %ld %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %d %d %d %d %d %d %d %d"
.
There is no difference between the two entries, except that a normal process has an extra data of 8 entries. The data represented by those entries is the following (given by the same order as in the control string):
%d (p_pid) - pid number %d (p_nr) - kernel slot number %d (p_endpoint) - kernel endpoint number %s (p_name) - process name %d (p_rts_flags) - process flags set by kernel %c (state) - state of the process %d (p_priority) - process priority %ld (p_user_time) - process user time %ld (p_sys_time) - process system time %d (p_getfrom_e) - the endpoint of the p_getfrom_e - "recv" field %ld (t_mem_len) - length of T process segment %ld (d_mem_len) - length of D process segment %ld (s_mem_len) - length of S process segment %ld (t_mem_vir) - virtual address of segment T %ld (d_mem_vir) - virtual address of segment D %ld (s_mem_vir) - virtual address of segment S %ld (t_mem_phys) - physical address of segment T %ld (d_mem_phys) - physical address of segment D %ld (s_mem_phys) - physical address of segment S %d (mp_nice) - the process nice value %d (mp_flags) - process PM flags %d (mp_ppid) - PPID (parent PID) %d (mp_procgrp) - PID of the process group %d (mp_realuid) - REALUID %d (mp_effuid) - EFFUID %d (fp_tty) - the process tty %d (fp_task) - print which task is proc suspended on
Having the entries above, partial implementation of top and ps is provided. Missing implementation of the methods to show the process arguments.
I had some difficulties understanding the process frame of the individual processes. After couple of days of code analysis, I manged to get back on track.
Reading week. The design document of David C. van Moolenbroek required knowledge of the other OS modules, including the RS and DS. No implementation provided this week.
I lost couple of days of coding, since I was moving to Swtizerland.