Week 5
Post for the fifth week.
Introduction
Over the past week, labs 13 and 14 were completed on the following topics:
- Tools used in software development in OS such as UNIX/Linux
- Named pipes
Lab #13
As a result of the laboratory work, she acquired the simplest skills in developing, analyzing, testing and debugging applications in the UNIX/Linux operating system using the example of creating a calculator with simple functions in the C programming language.
The following tasks were completed:
- Create a subdirectory ~/work/os/lab_prog in your home directory.
- Create files in it: calculate.h, calculate.c, main.c. It will be the most primitive calculator capable of adding, subtracting, multiplying and divide, raise a number to a power, take the square root, calculate sin, cos, tan. When run, it will ask for the first number, the operation, the second number. Thereafter the program will print the result and stop.
- Compile the program with gcc.
- Correct syntax errors if necessary.
- Create a Makefile.
- Use gdb to debug the calcul program.
- Using the splint utility, try to analyze the codes of the calculate.c files and main.c.
Lab #14
As a result of the laboratory work, she gained practical skills in working with named pipes.
The following tasks were solved:
Study the server.c and client.c programs given in the text. Taking these examples for the sample, write similar programs with the following changes:
- Not 1 client works, but several (for example, two).
- Clients transmit the current time with some frequency (for example, once every five seconds). Use the sleep() function to pause the client.
- The server does not work indefinitely, but stops working after a while (for example, measure, 30 sec). Use the clock() function to determine the server’s uptime. What happens if the server terminates without closing the channel?
Conclusions
Over the past week, I’ve been learning about named pipes and getting hands-on with them. I also acquired the simplest skills in developing, analyzing, testing and debugging applications in UNIX/Linux operating systems using the example of creating a calculator with simple functions in a programming language. . In general, I am satisfied with the results of the past week, I completed all the work in advance and I did not have any particular difficulties.