Overview
How to install
cd /usr/src/tools
make install
- boot to the customized image, you will see
kernel ds … mipc init
- check mipc server is running:
pe -e | grep mipc
Source code folder
/usr/src/servers/mipc
function
PUBLIC int main(int argc, char *argv[]);
- the function will maintain an infinite while loop to handle all system calls.
- it will match which function is requested and pass the call to a manager.
PUBLIC int check(int uid, int group_id, int action);
- There is a configuration file to define the privelege of each group created by users. The structure of this file is like this:
+—–+—————-+
|user1|(user2 user3) |
|user2|(user1) |
|user3|(user1) |
+—–+—————-+
This means the group created by user1 is allowed to be subscribed or published by user1, user2 and user3. The group created by user2 or user3 is allowed both themselves and user1 to become the subscriber or publisher of this group.
The parameter uid is the user’s id.
group_id is the id of the group defined internally in the server.
action is the action needs to be checked: declare_subsciber or declare_publisher.
The return value could be 0 (false), 1 (true) and -1 (error).
library
- It should provide a header file by including which a user process should be allowed to use the system calls.