Introduction: The ice cream industry is a multi-billion dollar industry that continues to grow every year. With the increasing demand for ice cream, there is a need for efficient management of ice cream production processes. This project aims to implement a system call that will facilitate the management of ice cream flavors and their associated recipes in an operating system.
Objective: The main objective of this project is to implement a system call in an operating system that simulates an ice cream factory system. The system call should allow users to enter the ice cream shop, wait for their turn, get their specified flavors, have toppings on their ice cream, get billed and then leave the shop. Since there can be several customers our main objective is to provide process Synchronization using Semaphores to prevent collisions of different process of Customers The problem is how to design a discipline of behavior (a concurrent algorithm) such that no customer will be left behind, i.e., each can continue to have the ice cream of their favorite flavor with toppings.
This project objectives would be: Create a System Call Use the System Call in the Project . Thread Synchronization Semaphores Deadlock Handling
Background: The reason for creating an ice cream factory system call is to facilitate the management of ice cream production processes within an operating system. The ice cream industry is a complex and rapidly growing industry, and managing the various stages of the ice cream production process can be challenging. By implementing an ice cream factory system call, users can handle operations there through the operating system. This system call provides a standardized and efficient way of managing ice cream flavors and toppings, reducing the potential for errors and ensuring consistency across the production process. Moreover, the ice cream factory system call can be integrated with other system-level programming tools, such as file systems, to provide a complete solution for managing the production process at advanced level. This integration can lead to increased efficiency, improved quality control, and reduced costs. Overall, the ice cream factory system call provides a valuable tool for managing the ice cream production process within an operating system, streamlining the production process, and improving overall efficiency. So this is the main reason to implement the system call which is the background that why we use this through system call.
Platforms: The platform we used was Linux Operating System using Oracle Virtual Box. Version of Ubuntu used is 16.04 LTS.
Languages: The language used for this project is C Language. C language is often used for system call programming because it provides low-level access to system resources and hardware. C is a compiled language, meaning that the code is translated directly into machine code, making it faster and more efficient than interpreted languages.
Methodology: ● Components of ice creams are made by Thread at each counter. ● These Threads will be executing concurrently with other threads. ● Then it will write data on a thread by allocating flavors to our ice cream and then it will call another processor. ● Local semaphore will be used there. It will also show as Ice cream or thread has been successfully created. Semaphores used in our code are that of tickets,3 types of flavors,2 types of topping and payment. ● Order of ice cream will arrive at first counters then a sequence of counters will accomplish the order by providing different flavors for their ice-creams. ● They will be served in multiple flavors including in the critical section and after that, it will wait for 5 sec so that ice cream flavors will be assigned to ice cream without any hurdle. Toppings would be assigned after flavors. ● After completely filling, Ice cream orders will be ready to distribute, preventing deadlock. Then the customer can leave the shop
Kernel Configuration Images: To implement the system call we need to update the version of kernel which is the elementary step leading towards a system call. This configuration involves making main.c file which invokes system call at kernel level along with alterations in config files such as creating a Make file, adding system call to a new index at the system call table, adding function’s prototype in the syscall.h file and then adding the system call name in the Original Make file. We used the following link to add the system call: https://youtu.be/qcsKGWshRZE.
Results: Attached below are the outputs received upon compiling the code. This code is implemented at user level, and it calls system call at index 335 recursively whenever it is needed. In user level code we first ask the number of customers which can be within a range of 1-30 at a time to manage all resources effectively. At the end the Business Journal will help us find the total Revenue generated with the number of customers entertained at the shop.
Conclusion: To ensure all the customers, have ice cream, firstly tickets should be greater than customers, if tickets less than customers then deadlock occurs, so more customers won't be entertained. Race Condition will occur here a thread will proceed even though flavors have been finished. If this is not used, then a thread will check each condition below which will be time consuming. If any of the threads did not get any flavor, the Race condition remains 0 and threads will exit.
In conclusion, this project aims to implement a system call in an operating system that will facilitate the management of ice cream flavors and their associated recipes. The project will be implemented in the Linux operating system using the C programming language and the file system. The project will involve the design, implementation, testing, and integration of the system call with the file system.