SlideShare a Scribd company logo
In C programming please. CSCI 4534 Operating Systems Programming Assignment #2 Date Due:
Monday, Mar 13th, 2023 @ 11:59pm submitted to Blackboard This assignment is meant to: 1.
Introduce students to writing basic client/server programs in C using the UNIX/Linux platform 2.
Provide an opportunity to write code that will become the base for projects similar to that of a
simulated operating system component 3. Extend the server to be able to handle requests from
multiple clients simultaneously. Objective: Create programs that run independently and can
perform simple IPC using FIFOs/named pipes to pass information back and forth in a client/server
fashion. This assignment requires the analysis, implementation, testing and documentation of two
small programs written in C on the UHCL Linux server ruby or your own Linux box or virtual
machine. A server program and a client program that will be run concurrently. Server program:
There is no change in the functionality of the server program (as far as the convert&store) other
than: 1. Make the server keep a simulated processID counter initialized to 1, increment and return
the simulated processID value to each client that initiates a connection with the server. (Clients will
need to save their simulated PID to include with each simulated system call made and sent to the
server afterwards). 2. Save the file descriptors for the return fifo for each client in an array/list so
that when a request comes in from client X, a proper reply is sent to client X through its own return
fifo. The server program will provide a simple convert&store service to clients that connect with it
and send it requests. Server program will be an iterative server (can process ONLY one client at a
time) and it needs to do the following: Create a well-known receive FIFOs where it will read its
input/requests from the client and open it in READ mode (will block of course until a client opens
the same fifo in write mode). Then go into an infinite loop to read requests from the clients, each
request will be a simulated system call, each request/system call should include: 1. Process ID of
process sending/making the system call 2. System call number (integer or byte) 3. Number n of
parameters in the system call (integer or byte) 4. Size of the rest of the message that includes 5.
Actual value(s) for the n parameters indicated in 3 As described below: System Call 1 would be
the first request sent by a new client (connect system call) 1. Process ID 2. System Call Number =
1 3. Number n of parameters = 1 4. Size of 5 5. Actual value(s) for the 1 parameter = the name of
the clients specific FIFO which the server should use to reply to that client. Server should open
that client-specific FIFO in WRITE mode, save the file descriptor and the pid of the client for use
when replies need to be sent to that client. 6. No need to return anything. Increment the processID
counter and return the next available simulated ClientID/processID System Call 2 Number to text
1. Process ID 2. System Call Number = 2 3. Number n of parameters = 1 4. Size of parameter (4
bytes for integer) 5. Actual value(s) for the parameter 6. Return the number converted to text ( 0 ->
zero, 1 -> one, 2 -> two, 3 -> three, etc. assume number will be between 0 and 9) System Call 3
Text to number 1. Process ID 2. System Call Number = 3 3. Number n of parameters = 1 4. Size
of parameter 5. Actual value(s) for the 1 parameter (zero, one, two, three, etc.) 6. Return the
number (four -> 4, five -> 5, etc) System Call 4 Store 1. Process ID 2. System Call Number = 4 3.
Number n of parameters = 1 7. Size of parameter 4. Actual value(s) for the 1 parameter 5. Return
stored value System Call 5 Recall 6. Process ID 7. System Call Number = 5 8. Number n of
parameters = 0 9. Actual value(s) for the 1 parameter = N/A 10. Return stored/recalled value
System Call 0 Exit o Process ID o System Call Number = 0 o Number n of parameters = 0 o
Actual value(s) for the parameter = N/A o Return value N/A System Call -1 Terminate o Process
ID o System Call Number = -1 o Number n of parameters = 0 o Actual value(s) for the parameter =
N/A o Return value N/A Server must print to the screen a message indicating the system call
received, something like: Client pid: 1 System Call Requested: 3 with 2 parameters which are:
Param1=xxxx param2=YYYY result=XXXX Server must reply back to the client through the client
specific fifo with a reply message that should include a result as appropriate. If the request is the
system call 0 EXIT, the server program must close the client specific fifo and continue to receive
the next system call (ready for the next client to connect) When the last client terminates, i.e.
sends system call -1, the server should close the well known FIFO, delete it and terminate as well.
Client Program: The client program will connect to the server through the well-known FIFO and
send requests through it to the server, obtaining information from the user as to what system call
to make and the corresponding values for the parameter(s), more specifically, the client program
should: The server will now return the ClientID/processID upon successful connection. This ID will
need to be saved and included with all future system calls. Acquire from the user (through the
command line or reading from the keyboard) what the client number this instance of the program
will be (i.e., client 1, client 2, etc.) or use the actual processid if you prefer. Open the well-known
servers fifo in write mode to communicate with the server (which will unblock the server from its
fifo open call) Create the client-specific FIFO using an appropriate name (e.g., ./ClientNfifo, where
N is the client number and send the initial connect system call to the server including Client
number and name of the client-specific FIFO. Open the client-specific FIFO in READ mode to be
able to read replies from the server. (This will block the client until the server opens the client-
specific FIFO in write mode). After this, the client should go into a loop where the client will ask
the user what to do next? providing three choices: o 1 Send request to server, in this case it will
ask the user for data: What sytem call? How many parameters? (user enters 0, 1, 2, 3, etc.) For
each of the n parameters indicated above, Read a value Take all the information gathered,
appropriately format a system call request and send it to the server. Request should include:
Process ID System call number (integer or byte) Number n of parameters in the system call
(integer or byte) Size of the parameter(s) data Actual value(s) for the n parameter(s) indicated
above After sending the request to the server, read the reply from the server in the client-specific
FIFO and write it to the screen. o 2 EXIT - indicates THIS client does not want to issue more
requests to the server, it should send a EXIT system call to the server, close its client specific
FIFO, delete it and exit. o 3 TERMINATE - indicates THIS client does not want to issue more
requests to the server, and is flagging the server to also exit. it should send a TERMINATE system
call to the server, close its client specific FIFO, delete it and exit. The first step in writing a
client/server application is define the communications protocol between both applications. In other
words, how are you going to encode the requests and replies into a message, you can encode
data in string forms, separating each piece with a , - a space, a new line character, or any other
kind of separator, you can use integer data, strucs, etc. Create a zip file with both your programs
source file(s) and executables, do a screen recording showing your programs working (with
multiple clients running one after the other and interacting with the server) and upload to
blackboard. Alternatively, just upload a zip file of your source files and executables and visit with
the TA during his office hours so you can do a demo of your client/server system. Make
incremental progress as you develop your code and back up your files often!! For instance (each
version expands on capabilities of previous one): Version 1: server creates and opens receiving
fifo, client opens servers fifo and creates its own input fifo and sends its name to the server which
display it on screen Version 2: server opens clients fifo, client sends a dummy system call to
servers receive fifo, server echoes data on clients fifo. Version 3: client reads input from user to
form requests and displays the formatted request on screen Version 4: client sends request to
server and server displays it on screen Version 5: server interprets request and creates and
returns result to client, client displays reply on screen Version 6: Final version with all features.

More Related Content

Similar to In C programming please CSCI 4534 Operating Systems Program.pdf

client-server communication using socket IPC
client-server communication using socket IPCclient-server communication using socket IPC
client-server communication using socket IPC
NarayanlalMenariya
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middlewaresanjoysanyal
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
sirajmohammed35
 
ppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project reportppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project report
sobanmoriwala1
 
Dc 12 Chiueh
Dc 12 ChiuehDc 12 Chiueh
Dc 12 Chiuehwollard
 
SystemCallsAndInvocationMethods_Mayin074.pptx
SystemCallsAndInvocationMethods_Mayin074.pptxSystemCallsAndInvocationMethods_Mayin074.pptx
SystemCallsAndInvocationMethods_Mayin074.pptx
BlackGoku18
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
To Sum It Up
 
Choose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdfChoose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdf
aghsports
 
Rpc
RpcRpc
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
farshad33
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
sehrish saba
 
SMTP and TCP protocol
SMTP and TCP protocolSMTP and TCP protocol
SMTP and TCP protocol
DivyaKS18
 
Chat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIPChat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIP
Genora Infotech
 
MSB-Remote procedure call
MSB-Remote procedure callMSB-Remote procedure call
MSB-Remote procedure call
MOHD. SHAHRUKH BHATI
 
Aspect UIP Logical Architecture
Aspect UIP Logical ArchitectureAspect UIP Logical Architecture
Aspect UIP Logical Architecture
Vishad Garg
 
Project 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdf
Project 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdfProject 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdf
Project 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdf
abhaykush25
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
FamiDan
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
Vishal Kumar
 

Similar to In C programming please CSCI 4534 Operating Systems Program.pdf (20)

client-server communication using socket IPC
client-server communication using socket IPCclient-server communication using socket IPC
client-server communication using socket IPC
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
 
ppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project reportppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project report
 
Dc 12 Chiueh
Dc 12 ChiuehDc 12 Chiueh
Dc 12 Chiueh
 
SystemCallsAndInvocationMethods_Mayin074.pptx
SystemCallsAndInvocationMethods_Mayin074.pptxSystemCallsAndInvocationMethods_Mayin074.pptx
SystemCallsAndInvocationMethods_Mayin074.pptx
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
 
Choose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdfChoose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdf
 
Rpc
RpcRpc
Rpc
 
ass2 of IP
ass2 of IPass2 of IP
ass2 of IP
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
SMTP and TCP protocol
SMTP and TCP protocolSMTP and TCP protocol
SMTP and TCP protocol
 
Rpc
RpcRpc
Rpc
 
Chat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIPChat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIP
 
MSB-Remote procedure call
MSB-Remote procedure callMSB-Remote procedure call
MSB-Remote procedure call
 
Aspect UIP Logical Architecture
Aspect UIP Logical ArchitectureAspect UIP Logical Architecture
Aspect UIP Logical Architecture
 
Project 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdf
Project 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdfProject 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdf
Project 2 Assigned Tuesday February 21tst2023 Due Tuesd.pdf
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
 

More from ankitsrivastava681882

Eskimo Joes designet of the woridis second bestselling T.pdf
Eskimo Joes designet of the woridis second bestselling T.pdfEskimo Joes designet of the woridis second bestselling T.pdf
Eskimo Joes designet of the woridis second bestselling T.pdf
ankitsrivastava681882
 
Blm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdf
Blm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdfBlm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdf
Blm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdf
ankitsrivastava681882
 
13 What is the name of the gateway interfaceport that face.pdf
13 What is the name of the gateway interfaceport that face.pdf13 What is the name of the gateway interfaceport that face.pdf
13 What is the name of the gateway interfaceport that face.pdf
ankitsrivastava681882
 
A bond has three years to maturity a 2000 face value and.pdf
A bond has three years to maturity a 2000 face value and.pdfA bond has three years to maturity a 2000 face value and.pdf
A bond has three years to maturity a 2000 face value and.pdf
ankitsrivastava681882
 
all of B all of c all of d all of e experienced a breakep at.pdf
all of B all of c all of d all of e experienced a breakep at.pdfall of B all of c all of d all of e experienced a breakep at.pdf
all of B all of c all of d all of e experienced a breakep at.pdf
ankitsrivastava681882
 
3112 Scan for vulnerabilities in organizational system and.pdf
3112 Scan for vulnerabilities in organizational system and.pdf3112 Scan for vulnerabilities in organizational system and.pdf
3112 Scan for vulnerabilities in organizational system and.pdf
ankitsrivastava681882
 
3 Please write java code to show the following stars 30 .pdf
3 Please write java code to show the following stars  30 .pdf3 Please write java code to show the following stars  30 .pdf
3 Please write java code to show the following stars 30 .pdf
ankitsrivastava681882
 
Whitney received 76000 of taxable income in 2022 All of .pdf
Whitney received 76000 of taxable income in 2022  All of .pdfWhitney received 76000 of taxable income in 2022  All of .pdf
Whitney received 76000 of taxable income in 2022 All of .pdf
ankitsrivastava681882
 
Use the table below to compare DNA and RNA two types of nuc.pdf
Use the table below to compare DNA and RNA two types of nuc.pdfUse the table below to compare DNA and RNA two types of nuc.pdf
Use the table below to compare DNA and RNA two types of nuc.pdf
ankitsrivastava681882
 
Question Need to have complete possible explanation for eac.pdf
Question Need to have complete possible explanation for eac.pdfQuestion Need to have complete possible explanation for eac.pdf
Question Need to have complete possible explanation for eac.pdf
ankitsrivastava681882
 
Review the following case study and create an action plan fo.pdf
Review the following case study and create an action plan fo.pdfReview the following case study and create an action plan fo.pdf
Review the following case study and create an action plan fo.pdf
ankitsrivastava681882
 
Python is a very powerful tool when used properly The diffe.pdf
Python is a very powerful tool when used properly The diffe.pdfPython is a very powerful tool when used properly The diffe.pdf
Python is a very powerful tool when used properly The diffe.pdf
ankitsrivastava681882
 
Smartphones A poll agency reports that 24 of teenagers age.pdf
Smartphones A poll agency reports that 24 of teenagers age.pdfSmartphones A poll agency reports that 24 of teenagers age.pdf
Smartphones A poll agency reports that 24 of teenagers age.pdf
ankitsrivastava681882
 
Problem 3 4 pts Consider a personal information record w.pdf
Problem 3 4 pts Consider a personal information record w.pdfProblem 3 4 pts Consider a personal information record w.pdf
Problem 3 4 pts Consider a personal information record w.pdf
ankitsrivastava681882
 
queja principal Ya no puedo acostarme porque no puedo resp.pdf
queja principal  Ya no puedo acostarme porque no puedo resp.pdfqueja principal  Ya no puedo acostarme porque no puedo resp.pdf
queja principal Ya no puedo acostarme porque no puedo resp.pdf
ankitsrivastava681882
 
Sara Lee Products Inc has bonds outstanding with a coupon r.pdf
Sara Lee Products Inc has bonds outstanding with a coupon r.pdfSara Lee Products Inc has bonds outstanding with a coupon r.pdf
Sara Lee Products Inc has bonds outstanding with a coupon r.pdf
ankitsrivastava681882
 
n125x1122s118 n220x2106s216 We are testing the.pdf
n125x1122s118 n220x2106s216 We are testing the.pdfn125x1122s118 n220x2106s216 We are testing the.pdf
n125x1122s118 n220x2106s216 We are testing the.pdf
ankitsrivastava681882
 
oktan semeli veya DoruYanl TF sorular iin en iyi yant.pdf
oktan semeli veya DoruYanl TF sorular iin en iyi yant.pdfoktan semeli veya DoruYanl TF sorular iin en iyi yant.pdf
oktan semeli veya DoruYanl TF sorular iin en iyi yant.pdf
ankitsrivastava681882
 
Northwest Lumber had a profit margin of 5 a total assets t.pdf
Northwest Lumber had a profit margin of 5 a total assets t.pdfNorthwest Lumber had a profit margin of 5 a total assets t.pdf
Northwest Lumber had a profit margin of 5 a total assets t.pdf
ankitsrivastava681882
 
Nueva York Nueva York Henry estaba en su ltimo semestre d.pdf
Nueva York Nueva York  Henry estaba en su ltimo semestre d.pdfNueva York Nueva York  Henry estaba en su ltimo semestre d.pdf
Nueva York Nueva York Henry estaba en su ltimo semestre d.pdf
ankitsrivastava681882
 

More from ankitsrivastava681882 (20)

Eskimo Joes designet of the woridis second bestselling T.pdf
Eskimo Joes designet of the woridis second bestselling T.pdfEskimo Joes designet of the woridis second bestselling T.pdf
Eskimo Joes designet of the woridis second bestselling T.pdf
 
Blm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdf
Blm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdfBlm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdf
Blm A 40 puan Vaka almas Aada verilen vaka almasn okuy.pdf
 
13 What is the name of the gateway interfaceport that face.pdf
13 What is the name of the gateway interfaceport that face.pdf13 What is the name of the gateway interfaceport that face.pdf
13 What is the name of the gateway interfaceport that face.pdf
 
A bond has three years to maturity a 2000 face value and.pdf
A bond has three years to maturity a 2000 face value and.pdfA bond has three years to maturity a 2000 face value and.pdf
A bond has three years to maturity a 2000 face value and.pdf
 
all of B all of c all of d all of e experienced a breakep at.pdf
all of B all of c all of d all of e experienced a breakep at.pdfall of B all of c all of d all of e experienced a breakep at.pdf
all of B all of c all of d all of e experienced a breakep at.pdf
 
3112 Scan for vulnerabilities in organizational system and.pdf
3112 Scan for vulnerabilities in organizational system and.pdf3112 Scan for vulnerabilities in organizational system and.pdf
3112 Scan for vulnerabilities in organizational system and.pdf
 
3 Please write java code to show the following stars 30 .pdf
3 Please write java code to show the following stars  30 .pdf3 Please write java code to show the following stars  30 .pdf
3 Please write java code to show the following stars 30 .pdf
 
Whitney received 76000 of taxable income in 2022 All of .pdf
Whitney received 76000 of taxable income in 2022  All of .pdfWhitney received 76000 of taxable income in 2022  All of .pdf
Whitney received 76000 of taxable income in 2022 All of .pdf
 
Use the table below to compare DNA and RNA two types of nuc.pdf
Use the table below to compare DNA and RNA two types of nuc.pdfUse the table below to compare DNA and RNA two types of nuc.pdf
Use the table below to compare DNA and RNA two types of nuc.pdf
 
Question Need to have complete possible explanation for eac.pdf
Question Need to have complete possible explanation for eac.pdfQuestion Need to have complete possible explanation for eac.pdf
Question Need to have complete possible explanation for eac.pdf
 
Review the following case study and create an action plan fo.pdf
Review the following case study and create an action plan fo.pdfReview the following case study and create an action plan fo.pdf
Review the following case study and create an action plan fo.pdf
 
Python is a very powerful tool when used properly The diffe.pdf
Python is a very powerful tool when used properly The diffe.pdfPython is a very powerful tool when used properly The diffe.pdf
Python is a very powerful tool when used properly The diffe.pdf
 
Smartphones A poll agency reports that 24 of teenagers age.pdf
Smartphones A poll agency reports that 24 of teenagers age.pdfSmartphones A poll agency reports that 24 of teenagers age.pdf
Smartphones A poll agency reports that 24 of teenagers age.pdf
 
Problem 3 4 pts Consider a personal information record w.pdf
Problem 3 4 pts Consider a personal information record w.pdfProblem 3 4 pts Consider a personal information record w.pdf
Problem 3 4 pts Consider a personal information record w.pdf
 
queja principal Ya no puedo acostarme porque no puedo resp.pdf
queja principal  Ya no puedo acostarme porque no puedo resp.pdfqueja principal  Ya no puedo acostarme porque no puedo resp.pdf
queja principal Ya no puedo acostarme porque no puedo resp.pdf
 
Sara Lee Products Inc has bonds outstanding with a coupon r.pdf
Sara Lee Products Inc has bonds outstanding with a coupon r.pdfSara Lee Products Inc has bonds outstanding with a coupon r.pdf
Sara Lee Products Inc has bonds outstanding with a coupon r.pdf
 
n125x1122s118 n220x2106s216 We are testing the.pdf
n125x1122s118 n220x2106s216 We are testing the.pdfn125x1122s118 n220x2106s216 We are testing the.pdf
n125x1122s118 n220x2106s216 We are testing the.pdf
 
oktan semeli veya DoruYanl TF sorular iin en iyi yant.pdf
oktan semeli veya DoruYanl TF sorular iin en iyi yant.pdfoktan semeli veya DoruYanl TF sorular iin en iyi yant.pdf
oktan semeli veya DoruYanl TF sorular iin en iyi yant.pdf
 
Northwest Lumber had a profit margin of 5 a total assets t.pdf
Northwest Lumber had a profit margin of 5 a total assets t.pdfNorthwest Lumber had a profit margin of 5 a total assets t.pdf
Northwest Lumber had a profit margin of 5 a total assets t.pdf
 
Nueva York Nueva York Henry estaba en su ltimo semestre d.pdf
Nueva York Nueva York  Henry estaba en su ltimo semestre d.pdfNueva York Nueva York  Henry estaba en su ltimo semestre d.pdf
Nueva York Nueva York Henry estaba en su ltimo semestre d.pdf
 

Recently uploaded

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
kitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptxkitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptx
datarid22
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 

Recently uploaded (20)

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
kitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptxkitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 

In C programming please CSCI 4534 Operating Systems Program.pdf

  • 1. In C programming please. CSCI 4534 Operating Systems Programming Assignment #2 Date Due: Monday, Mar 13th, 2023 @ 11:59pm submitted to Blackboard This assignment is meant to: 1. Introduce students to writing basic client/server programs in C using the UNIX/Linux platform 2. Provide an opportunity to write code that will become the base for projects similar to that of a simulated operating system component 3. Extend the server to be able to handle requests from multiple clients simultaneously. Objective: Create programs that run independently and can perform simple IPC using FIFOs/named pipes to pass information back and forth in a client/server fashion. This assignment requires the analysis, implementation, testing and documentation of two small programs written in C on the UHCL Linux server ruby or your own Linux box or virtual machine. A server program and a client program that will be run concurrently. Server program: There is no change in the functionality of the server program (as far as the convert&store) other than: 1. Make the server keep a simulated processID counter initialized to 1, increment and return the simulated processID value to each client that initiates a connection with the server. (Clients will need to save their simulated PID to include with each simulated system call made and sent to the server afterwards). 2. Save the file descriptors for the return fifo for each client in an array/list so that when a request comes in from client X, a proper reply is sent to client X through its own return fifo. The server program will provide a simple convert&store service to clients that connect with it and send it requests. Server program will be an iterative server (can process ONLY one client at a time) and it needs to do the following: Create a well-known receive FIFOs where it will read its input/requests from the client and open it in READ mode (will block of course until a client opens the same fifo in write mode). Then go into an infinite loop to read requests from the clients, each request will be a simulated system call, each request/system call should include: 1. Process ID of process sending/making the system call 2. System call number (integer or byte) 3. Number n of parameters in the system call (integer or byte) 4. Size of the rest of the message that includes 5. Actual value(s) for the n parameters indicated in 3 As described below: System Call 1 would be the first request sent by a new client (connect system call) 1. Process ID 2. System Call Number = 1 3. Number n of parameters = 1 4. Size of 5 5. Actual value(s) for the 1 parameter = the name of the clients specific FIFO which the server should use to reply to that client. Server should open that client-specific FIFO in WRITE mode, save the file descriptor and the pid of the client for use when replies need to be sent to that client. 6. No need to return anything. Increment the processID counter and return the next available simulated ClientID/processID System Call 2 Number to text 1. Process ID 2. System Call Number = 2 3. Number n of parameters = 1 4. Size of parameter (4 bytes for integer) 5. Actual value(s) for the parameter 6. Return the number converted to text ( 0 -> zero, 1 -> one, 2 -> two, 3 -> three, etc. assume number will be between 0 and 9) System Call 3 Text to number 1. Process ID 2. System Call Number = 3 3. Number n of parameters = 1 4. Size of parameter 5. Actual value(s) for the 1 parameter (zero, one, two, three, etc.) 6. Return the number (four -> 4, five -> 5, etc) System Call 4 Store 1. Process ID 2. System Call Number = 4 3. Number n of parameters = 1 7. Size of parameter 4. Actual value(s) for the 1 parameter 5. Return stored value System Call 5 Recall 6. Process ID 7. System Call Number = 5 8. Number n of parameters = 0 9. Actual value(s) for the 1 parameter = N/A 10. Return stored/recalled value System Call 0 Exit o Process ID o System Call Number = 0 o Number n of parameters = 0 o Actual value(s) for the parameter = N/A o Return value N/A System Call -1 Terminate o Process
  • 2. ID o System Call Number = -1 o Number n of parameters = 0 o Actual value(s) for the parameter = N/A o Return value N/A Server must print to the screen a message indicating the system call received, something like: Client pid: 1 System Call Requested: 3 with 2 parameters which are: Param1=xxxx param2=YYYY result=XXXX Server must reply back to the client through the client specific fifo with a reply message that should include a result as appropriate. If the request is the system call 0 EXIT, the server program must close the client specific fifo and continue to receive the next system call (ready for the next client to connect) When the last client terminates, i.e. sends system call -1, the server should close the well known FIFO, delete it and terminate as well. Client Program: The client program will connect to the server through the well-known FIFO and send requests through it to the server, obtaining information from the user as to what system call to make and the corresponding values for the parameter(s), more specifically, the client program should: The server will now return the ClientID/processID upon successful connection. This ID will need to be saved and included with all future system calls. Acquire from the user (through the command line or reading from the keyboard) what the client number this instance of the program will be (i.e., client 1, client 2, etc.) or use the actual processid if you prefer. Open the well-known servers fifo in write mode to communicate with the server (which will unblock the server from its fifo open call) Create the client-specific FIFO using an appropriate name (e.g., ./ClientNfifo, where N is the client number and send the initial connect system call to the server including Client number and name of the client-specific FIFO. Open the client-specific FIFO in READ mode to be able to read replies from the server. (This will block the client until the server opens the client- specific FIFO in write mode). After this, the client should go into a loop where the client will ask the user what to do next? providing three choices: o 1 Send request to server, in this case it will ask the user for data: What sytem call? How many parameters? (user enters 0, 1, 2, 3, etc.) For each of the n parameters indicated above, Read a value Take all the information gathered, appropriately format a system call request and send it to the server. Request should include: Process ID System call number (integer or byte) Number n of parameters in the system call (integer or byte) Size of the parameter(s) data Actual value(s) for the n parameter(s) indicated above After sending the request to the server, read the reply from the server in the client-specific FIFO and write it to the screen. o 2 EXIT - indicates THIS client does not want to issue more requests to the server, it should send a EXIT system call to the server, close its client specific FIFO, delete it and exit. o 3 TERMINATE - indicates THIS client does not want to issue more requests to the server, and is flagging the server to also exit. it should send a TERMINATE system call to the server, close its client specific FIFO, delete it and exit. The first step in writing a client/server application is define the communications protocol between both applications. In other words, how are you going to encode the requests and replies into a message, you can encode data in string forms, separating each piece with a , - a space, a new line character, or any other kind of separator, you can use integer data, strucs, etc. Create a zip file with both your programs source file(s) and executables, do a screen recording showing your programs working (with multiple clients running one after the other and interacting with the server) and upload to blackboard. Alternatively, just upload a zip file of your source files and executables and visit with the TA during his office hours so you can do a demo of your client/server system. Make incremental progress as you develop your code and back up your files often!! For instance (each
  • 3. version expands on capabilities of previous one): Version 1: server creates and opens receiving fifo, client opens servers fifo and creates its own input fifo and sends its name to the server which display it on screen Version 2: server opens clients fifo, client sends a dummy system call to servers receive fifo, server echoes data on clients fifo. Version 3: client reads input from user to form requests and displays the formatted request on screen Version 4: client sends request to server and server displays it on screen Version 5: server interprets request and creates and returns result to client, client displays reply on screen Version 6: Final version with all features.