Skip to content

Project for "Operating Systems" course at Unviversity of Verona

License

Notifications You must be signed in to change notification settings

AlexPasqua/system-calls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Practice project for the course "Operating Systems" @ UniVR.

By Alex Pasquali

(Read "consegna-pdf" (in Italian) for more explenation -> NOTE: the project's language is Italian)

NOTE: use Linux Bash or Windows' Linux subsystem emulator

Step 1:

1. Open the bash and enter system-call directory.
2. With one bash window, open clientReq-server directory. Type make
3. With a second bash window, open clientExec directory. Type make
4. Open a third bash window and go into clientReq-server directory

Step 2:

1. With the first bash (in clientReq-server directory) execute the server process:  ./server
2. With the third bash (in clientReq-server directory) exectute "clientReq":  ./clientReq

Now everything is ready to begin using the program

Step 3:

1. Insert a userid with clientReq
2. Insert the name of the desired service
("stampa", "salva", "invia")
3. WIth the bash in clientExec directory execute "clientExec":  ./clientExec userid server_key args
      note: userid is the one chosen by the user (in clientReq)
           server_key is the code returned by the server process after entering data with clientReq
           args: see below

args, depending on the service chosen, is...

  1. service stampa: what you want to print
  2. service salva: the name of the destination file followed by what you want to write in it
  3. service invia: id key of a message queue already existing in the system followed by what you want to send in it

To kill:
NOTE: the server is only sensitive to SIGTERM. So to kill it it's necessary to throw: killall server
PAY ATTENTION NOT TO KILL THE WRONG PROCESS!!!


In case of problems: execute the following
  ipcrm --semaphore-id X
  ipcrm --shmem-id X
  rm /tmp/FIFOSERVER
  rm /tmp/FIFOCLIENT
(where X stands for the id of the IPC. Try starting from 0 and repeting the same command until it says  ipcrm: invalid id (X)
NOTE: this will delete some IPCs in your system. If you're aware of some needed IPC that you don't want to delete, please be sure not to insert its id key.

Now everything should work properly, otherwise open a new issue (or check existing ones) if you pleased.
Thank you.