Reference no: EM132251642
Lab - Design and implement versions of send() and receive() that record up to K messages per process.
As we discussed before, the low level messaging system in xinu has two important functions send and receive. One main issue with the low level messaging in xinu is there is only one message and if another message is sent to a process, this message will be ignored.
In this lab, you are required to change the original send and receive functions to allow sending and receiving up to K messages.
Help instructions (You do not have to follow the following instructions).
1. Edit the original send and receive functions or create new send and receive functions and call them sendk and receivek.
2. In your main function, you can call the new send and receive functions or you can create new shell commands to be able to call the new send and receive functions from the shell as you did in the midterm exam.
3. To show that your new xinu messaging system can now accept up to K messages. Assume K in your program as 5. Then, send 10 messages. So, if your system is working, you should fill a buffer of the first five messages and then show an error for the other five messages.
4. To receive the five messages sent before, you can get them from the buffer in FIFO or in LIFO. Your call!
5. prhasmsg flag should be updated to handle more situations (not only true and false) since a process can have more than one message i.e. up to k messages.
You need to update or improve the low level messaging system to allow it to receive and send K messages where, K can be any number.
The steps on how to do this program are given in the word file. You do not necessarily have to follow the same steps. You can modify the send.c and receive.c files or make your own sen.k and receive.k files
The most important thing to modify is process has a message flag (prhasmsg flag). It should not be true/ false but it should be a buffer.
Example: If k=5 then after flag has 5 messages it should give an error
Note: All the programming needs to be done in XINU
Attachment:- lab.rar