In: Computer Science
1) Calculate the cache hit ratio assuming that the total number of requests is 2,056 and 647 of those requests are found in the cache.
2) Draw a figure of dead lock with three processes and three resources.
3) the operating system provides an interface between application programs and the computer hardware. Discuss the process of the execution of any application program on the hardware using all managers of the operating system.
4) The operating system offers a graphical vs command line user interface to interact with an electronic device. Compare the graphical user interface and the command line interface in terms of speed, remote access, resource utilization, multitasking, and control
1. Cache Hit Ration = (No. of hits / (No. misses + No. hits))*100 = (647 / 2056)*100 = 31.46%
2.
3. When an application is to be executed, it will place a request to the operating system through the appropriate system call, and then the operating system will load that application in the memory, while loading the mode bit will be '0', which represents that it is a kernel process. Once loaded, the mode bit will become '1' (user process). As a resource manager the operating system manages the system resources like processor time (CPU cycles), Memory, IO Devices and Files.
As a process manager the Operating System will provide a process id for the newly created process and it will be represented through a PCB (Process Control Block) which includes process_id, Program Counter, Stack and General Purpose Registers. Also, it decides the priority of this process and how much slice of CPU cycle it should be given during each round of execution. It also makes a entry for this process in the process table.
As a memory manager the Operating System allocates memory for the newly created process which includes text segment (to store th actual .exe file of the process), data segment (to store the global variables), stack (to store temporary variables - function params, return address and local variables) and Head (for dynamic memory allocation).
As a resource manager Operating Systems allocates IO devices and Files required for the newly created process.
During its lifetime the process may be in differnt states like new, ready (waiting for CPU), waiting (for IO Operation), running (assigned to CPU) and terminate. Once the process terminate, the operating system will remove its entry from the process table.
4. An ordinary user would feel that graphical interface is more convenient and faster than commandline interface, but an experienced user (like network administrator etc...) will fell much comfartable with commandline interface and can do things fastly from commandline interface than GUI.
Remote communication is possible through GUI and also through Command line interface. More sophisticated tasks can be done through commandline interface but considerable knowledge and experience is required.
effective Resource utilization and Multitasking and controls on files are also possible through commandline interface but its for experience users.