OS Assignments 3

Share Embed Donate


Short Description

Published because of non-payment by a client on liveperson...

Description

Assignment 3 Instructions: Please

answer the following questions in complete sentences.

1. What are the advantages of using dynamic loading? ( 6 marks) Dynamic loading is a process being deployed by the system so as to ensure proper progress of  the processes. By using dynamic loading a system can utilize the memory in an efficient way. When a program is being executed then there are some parts of the program which are not doing anything and memory space is being wasted. Dynamic loading is based on the principle that a program does not have to be stored in the main memory except for the parts executing. Thus, main memory is free from unused routines through dynamic loading. This saves a lot of  execution time as well as memory utilization is broader terms, which in turn makes the system and the overall processing more effective and e fficient. 2. Explain the basic method for implementing paging. ( 8 marks) We can implement paging by breaking physical memory into frames (fixed memory blocks) and logical memory into pages (equal sized blocks). These blocks are then taken into consideration for further processing. As mentioned earlier the physical memory of the system is broken down into fixed memory blocks that have their defined length and have a constant beginning and end, hence are referred to as fixed memory blocks, and then the logical memory is taken into consideration later and it is broken down into equal sized blocks, each of which is capable of  storing the same amount of data, these e qual sized blocks are called as pages. Pages are loaded into any free memory frames, from the backing store, during a program’s execution. All the

logical addresses are bounded by the paging hardware to certain physical addresses. 3. Briefly describe the segmentation memory management scheme. How does it differ from the paging memory management scheme in terms of the user's view of memory? (8 marks) As the term indicates, the segmentation memory is the module of memory, which works in the form of segments and blocks. Memory addresses are taken into consideration while deploying this kind of memory and taking it to use. Logical address is taken as a pool of segments in segmentation memory management scheme with each segment having a name and length.

Segment name and offset are specified spec ified by the user for each address. But contrary to it in the paging scheme page number and offset are invisible to the user. The user only specifies the address of required page, and further processing is done through the system, that is of finding the right segment and storing or retrieving information from that particular block of memory. 4. Explain the distinction between a demand-paging system and a paging system with swapping. ( 8 marks)

While logical memory is taken into consideration later and it is broken down into equal sized blocks, each of which is capable of storing t he same amount of data, these equal sized blocks are called as pages. In a demand paging system a page is brought into the memory only when they are required to execute exe cute the program at that instant. But in a paging system with swapping when a program requires a page and it is in the main memory, then a couple of pages are copied into the RAM from backing store. Multiple transitions are being done as per the requirement of  processes form memory; both the terms could be w orking simultaneously in order to ensure proper and smooth progress and execution of the program. 5. How does the second-chance algorithm for page replacement differ from the FIFO page replacement algorithm? (8 marks) Second-chance algorithm works like FIFO does by looking at the front of the queue. In a paging system with swapping when a program requires a page and it is in the main memory, then a couple of pages are copied into the RAM from backing store The difference between the two algorithms is that instead of immediately paging out that page, second chance verifies whether the page’s referenced bit is set. Because if set then the referenced bit is cleared and the page is

inserted at the back of the queue (as if it were a new page). If the bit is not set then page is swapped out. Second chance algorithm degenerates into pure FIFO if reference bit is set for all pages. 6. Explain how copy-on-write operates. (8 marks) Processes basically occur into the memory of the system and require a reasonable amount of  memory in order to continue with their amount of effectiveness and working. While logical memory is taken into consideration and it is broken down into equal sized blocks, each of which is capable of storing the same amount of data, these equal sized blocks are called as pages. In a

paging system with swapping when a program requires a page and it is in the main memory, then a couple of pages are copied into the RAM from backing store When more than one process is sharing a page and one of them tries to modify that page then t hen a copy of the page is made on which modifications are done and original remains the same. COW is an optimization strategy used in virtual memory operating systems. 7. If you were creating an operating system to handle files, what are the six basic file operations that you should implement? (8 marks) Six basic file operations that should be implemented are: o

Creating a file: Free space is found and a file is created in a directory.

o

Writing a file: A system call is made which specifies the name and the info to be written to the file.

o

Reading a file: A system call which tells the required file’s name and location of required block is made.

o

Repositioning within a file

o

Deleting a file: Search the directory for the required file and release all file space.

o

Truncating a file: Contents of a file are erased but attributes are kept.

8. To create a new file, an application program calls on the logical file system. Describe the steps the logical file system takes to create a file. (8 marks) The logical file system takes its roots from t he logical memory, which is taken into consideration in the form of pages that are being deployed for the processing of the o verall system. Whenever a new file is to be creates, an application program calls upon the logical file system for the processing on this file. The steps involved in this logical file system, which are to be considered for the creation of the new file, are such that a new file control block is allocated by the logical file system. An appropriate directory is read into memory by the system which updates the directory with new file’s name and file control block and writes it to disk.

9. How is a hash table superior to a simple linear list structure? What issue must be handled by hash table implementation? ( 8 marks) Hash table and simple linear structure are two unique kinds of data storage and retrieving methodologies, the implementation and the advantages of both are also quite unique in nature.

The simple linear list is used for the purpose of storing a rather simpler kind of data in which the storing and fetching is simpler and quicker. Linear list is used to store directory entries in hash table implementation and hash data structure speeds up search process and allows help for linear list to compute file location in the linear list. Collisions should be handled with hash table implementation which occurs due to mapping of multiple files on map. 10. What are the factors influencing the selection of a disk-scheduling algorithm? (8 marks) Disk-scheduling algorithm’s performance is based on the quantity and type of requests. As the quantity of requests increase, there occurs and increases in the overall disk-scheduling algorithm, it then has to work in a different way so as to ensure the correct processing. The over all outcome of disk scheduling algorithm is based on the quantity of requests as well as the type and complexity of the requests being taken up. Rotational latency and constraints of operating system also influence it along with location of index block and directorie s. Constraints of  operating system referring to the idea that the operating system is not as effectively able to perform to cope up with the efficiency of the disk-scheduling system.

11. Explain the disadvantage(s) of the SSTF scheduling algorithm. ( 8 marks) Disadvantages of the SSTF scheduling algorithms are:

a. We can stay in one area of the disk for a long time due to heavy traffic leading to starvation. Starvation being the process in which proper resources are not being allocated to the processes upon their required time frame and the efficiency hence decreases, each of the process waits for the other one to f ree the resources and the currently executed processes never leave the resources for others. b. The performance is slowed if directions are switched. The direction switching being a continuous process being taken up while the execution is taken into consideration hence a lot of delay in per formance occurs.

12. Explain the concepts of a bus and a daisy chain. Indicate how these concepts are related. (8 marks)

A bus specifies messages that can be sent and is a set of a rigid protocol and wires. Buses within a board are responsible for the tr avelling of data from one part of the system to be utilized and catered in another part of the system. Buses in real are rigid protocols and wire s, through which data travelling is being done. Messages are timed e lectrical patterns of voltage applied to wires. A daisy chain on the other hand is a device configuration in which each device is connected to other device with a cable in t he form of a chain. This also takes into consideration the process of  passing message but the procedure and time frame are the main things that differ between the two. 13. What are the three reasons that buffering is performed? (6 marks) Buffering is performed because: a.

Application I/O need to support copy semantics

b. A speed mismatch b/w producer and consumer data stream has occurred and data is to be handled c.

Different data transfer sized devices need some adaption in between.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF