Table of Contents

Proc/Dev File Systems

Student: Alen Stojanov
Mentor: David van Moolenbroek
SVN branch name: src.20090525.r4372.astojanov

Abstract

The goal of this project is to add /dev and /proc file systems to MINIX3.

Design

Design document (under construction)

Test Plan and Evaluation

TBD

Schedule and Deliverables

TBD

Weekly Status

Week #1 [23.05.2009 - 29.05.2009] Getting Started

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.

Week #2 [30.05.2009 - 06.06.2009]

Graduation 2009 at Jacobs University. No implementation provided, The time spent during this week will be compensated with work during the weekends.

VTreeFS

Accomplished

Highlights

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

VTreeFS

Accomplished

VTreeFS

Accomplished

Week #6 [29.06.2009 - 05.07.2009] Initial /proc file system

Accomplished

Week #7 [06.07.2009 - 12.07.2009] Complete /proc/[pid] structure

Accomplished

Week #8 [13.07.2009 - 19.07.2009] Partial top and ps implementation

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.

Week #9 [20.07.2009 - 26.07.2009] Complete ps and top implementation

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.

Accomplished

Week #10 [27.07.2009 - 02.08.2009] Testing /proc, top and ps

Accomplished

Week #11 [03.08.2009 - 09.08.2009] Reading week

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.

Week #12 [10.08.2009 - 16.08.2009] Complete /proc/[pid] structure

Accomplished

DevFS

I lost couple of days of coding, since I was moving to Swtizerland.

Accomplished