Question: Purpose: To increase your knowledge of systems programming through the following activity: Adding to MINIX a form of sharing among user processes. Requirements: In UNIX

Purpose: To increase your knowledge of systems programming through the following activity: Adding to MINIX a form of sharing among user processes.

Requirements: In UNIX shared memory may be made available through the shmxxx set of requests [1]. On the other hand in a distributed environment, object sharing may be used [2]. The idea of object sharing provides a convenient method to introduce sharing within MINIX.

For this assignment, you will use the DataStore server(DS) by providing access to some of its capabilities to user processes via new system calls to be supported in PM.

1. This assignment is a group assignment. You are expected to work with your group in doing this project.

2. Read about the DataStore server: http://wiki.minix3.org/doku.php?id=developersguide:datastore;also, examine DS code as needed.

3. Create a design for this project: After studying the other requirements and the Program Interface, create a design for this project. Concentrate on describing the changes necessary to support the data structures and algorithms you will use to maintain the shared objects.

4. Implement new MINIX system call(s): Implement one or more new MINIX system call(s) to support the library functions described in the Program Interface section; these calls must be implemented within PM and PM must utilize DS to store the values.

5. Implement the library functions: Implement the library functions described in the Program Interface section. These functions must use your new system call(s) (see preceding item).

6. Basic Testing: perform basic testing of system call return values, and errno values. This must include showing that the setsmval function can set values that will be returned by the getsmval function.Also, test tslsmval.

7. Solve the Dining Philosophers Problem: Implement a solution to the Dining Philosophers problem using the new system calls from this project. Each Philosopher must be represented by a separate process, and the new system calls must be used. Solutions must allow for multiple philosophers to dine at the same time.

8. Test the Dining Philosophers Solution: Provide evidence of adequate testing of your solution running under MINIX. Output is expected to demonstrate how many philosophers can dine at one time.

Program Interface:

NAME

getsmval, setsmval, tslsmval

-shared memory operations.

SYNOPSIS

#include

int getsmval (int id, unsigned int *value)

int setsmval (int id, unsigned int value)

int tslsmval (int id)

DESCRIPTION

These functions provide a limited means to share the values of integer objects among processes. Each integer object is assigned an id (a value between 0 and 15) that uniquely identifies it; initially, the values of all objects are zero.

The getsmval request is used to retrieve the value of the specified object.

The setsmval request is used to set the value of the specified object.

The tslsmval request is used to simulate a TSL instruction. This operation is performed on the specified object. Note that this instruction must be used with an object whose values are confined to 0 and 1.

RETURN VALUES

If the operation is successful, these functions return 0. tslsmval returns 1 if the lock was not obtained. If an error occurs, these functions return -1 and errno is set to a non-zero value to specify the error.

ERRORS

[EINVAL] There is an error in the parameter to the function: the id parameter value is not between 0 and 15.

[EPERM] The tslsmval request found a value other than 0 or 1 associated with the given id.

Other: Other errors as returned by DS functions may be possible.

Hints: Consider using the ds_publish_u32 and ds_retrieve_u32 functions.When implementing the tslsmval system call, you should not need additional data structures beyond the integer objects.

What is needed in the end: (everything is to be worked on in MINIX 3.1.8r_)

1. Descriptions of the design for the MINIX enhancements.

2. MINIX OS code: Listing of all source files modified or created.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!