Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Written C 1 User Arrays 1 Assignment Implement Simulation Interaction User Programs Os Exe Q35616486

(Has to be written in C–, only 1 User and NOARRAYS)

1.- In this assignment you will implement a simulation of theinteraction of user programs with the OS to execute an I/Ooperation.

User programs: User programs will communicate with DOIO (OS) torequest an I/O operation. (this will simulate a system call) Userprograms will give to DOIO two parameters: User id and an address(addr is a random number in the range 1 and 20.) (addr is aninteger that represents a track number in the hard drive). Userprograms will pass the parameters to DOIO through two buffers ofsize one each (bufid and bufaddr). Once the parameters are storedin the buffers, user programs executes a P(request served)operation to wait for the completion of the I/O operation. Therewill be only one user running and it will execute 5 I/Ooperations.

DOIO: DOIO will collect an id and address(addr) from bufid andbufaddr to assemble the IORB. DOIO will store the IORB (id andaddr) into two buffers that represent the IORQ (iorqid andiorqaddr).

Device driver: Device driver will collect an IORB (pair id andaddr) from iorqid and iorqaddr and then initiates the physical I/Ooperation on the hard drive and wait for the I/O operation to becompleted: P(operation complete). The device driver initiate thephysical I/O operation by storing addr into a buffer of length one.The buffer name is “pio” (physical I/O). When the I/O operationcompletes a signal is received, the driver will identify the userthat issued the I/O request using the id, and will signal thesemaphore “request served” associated to the user.

Disk: The disk process simulates the access to a track in thehard drive. The Disk process gets the addr from pio and stores itin a variable called “seek” and iterates in a dummy loop from 1 to“seek”. Once out of the loop, disk will execute a V on thesemaphore “operation complete” a) Define all semaphores that youneed according to the number of buffers used. The user will make 5system calls to initiate I/O operations DOIO will create 5 IORBProject Direction You will write a C– program based on the BACIinterpreter that you used in programming project 1. Test yoursolution You must run and test your solution and comment on theresults emitted.

Project Submission What to submit? Submit the source code(.cmfile) and the output file showing the results:

Example for the print out of results is:

User 1 executes system call SIO or DOIO

DOIO assembles IORB and inserts it in IORQ

Driver initiates I/O operation for user 1

Disk Completes I/O operation (disk does not know what processinitiated the I/O operation)

Driver signal user 1 (operation complete)

User 1 executes system call SIO or DOIO

DOIO assembles IORB and inserts it in IORQ

And so on…

*Quick reminder again. This has to bewritten in C–, only 1 User and NO ARRAYS

Leave a Reply

Your email address will not be published. Required fields are marked *