• No results found

OS Assignments 3

N/A
N/A
Protected

Academic year: 2021

Share "OS Assignments 3"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

Assignment 3

Assignment 3

Instructions:

Instructions:Please answer the following questions in complete sentences.Please answer the following questions in complete sentences.

1.

1. What are the advantages of using dynamic loading? (What are the advantages of using dynamic loading? (6 marks6 marks))

Dynamic loading is a process being deployed by the system so

Dynamic loading is a process being deployed by the system so as to ensure proper progress of as to ensure proper progress of  the processes. By using dynamic loading a system can utilize the

the processes. By using dynamic loading a system can utilize the memory in an efficient way.memory in an efficient way. When a program is being executed then there are some parts of the program which are not 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 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. 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

Thus, main memory is free from unused routines through dynamic loading. This saves a lot of loading. This saves a lot of  execution time as well as memory

execution time as well as memory utilization is broader terms, which in turn makes the systemutilization is broader terms, which in turn makes the system and the overall processing more effective and e

and the overall processing more effective and e fficient.fficient. 2.

2. Explain the basic method for implementing paging. (Explain the basic method for implementing paging. (8 marks8 marks))

We can implement paging by breaking physical memory into frames (fixed memory

We can implement paging by breaking physical memory into frames (fixed memory blocks) andblocks) and logical memory into pages (equal sized blocks). These blocks are then

logical memory into pages (equal sized blocks). These blocks are then taken into considerationtaken into consideration for further processing. As mentioned earlier the

for further processing. As mentioned earlier the physical memory of the system is broken physical memory of the system is broken downdown into fixed memory blocks that have their defined length and have

into fixed memory blocks that have their defined length and have a constant beginning and end,a constant beginning and end, hence are referred

hence are referred to as fixed memory blocks, and then the to as fixed memory blocks, and then the logical memory is taken intological memory is taken into consideration later and it is broken down into equal sized blocks,

consideration later and it is broken down into equal sized blocks, each of which is capable of each of which is capable of  storing the same amount of data, these e

storing the same amount of data, these e qual sized blocks are called as pages. Pages qual sized blocks are called as pages. Pages are loadedare loaded

into any free memory frames, from the backing store, during a program’s execution.

into any free memory frames, from the backing store, during a program’s execution. All theAll the logical addresses are bounded by the paging hardware to

logical addresses are bounded by the paging hardware to certain physical addresses.certain physical addresses. 3.

3. Briefly describe the segmentation memory management scheme. How Briefly describe the segmentation memory management scheme. How does it differ from thedoes it differ from the paging memory management scheme in terms of the

paging memory management scheme in terms of the user's view of memory? (user's view of memory? (8 marks8 marks))

As the term indicates, the

As the term indicates, the segmentation memory is the module of memory, which works segmentation memory is the module of memory, which works in thein the form of segments and blocks. Memory addresses are taken

form of segments and blocks. Memory addresses are taken into consideration while deployinginto consideration while deploying this kind of memory and taking it to use. Logical

this kind of memory and taking it to use. Logical address is taken as a pool of segments address is taken as a pool of segments inin segmentation memory management scheme with each segment

(2)

Segment name and offset are spec

Segment name and offset are specified by the user for each address. But ified by the user for each address. But contrary to it in thecontrary to it in the paging scheme page number and offset are

paging scheme page number and offset are invisible to the user. The user only specifies theinvisible to the user. The user only specifies the address of required page, and further processing is

address of required page, and further processing is done through the system, that is of findingdone through the system, that is of finding the right segment and storing or

the right segment and storing or retrieving information from that particular block of memory.retrieving information from that particular block of memory. 4.

4. Explain the distinction between a demand-paging system and a paging system with swapping. (Explain the distinction between a demand-paging system and a paging system with swapping. (88 marks

marks))

While logical memory is taken into consideration later and it is

While logical memory is taken into consideration later and it is broken down into equal sizedbroken down into equal sized blocks, each of which is capable of storing t

blocks, each of which is capable of storing t he same amount of data, these equal sized blockshe same amount of data, these equal sized blocks are called as pages. In a

are called as pages. In a demand paging system a page is brought into the memory demand paging system a page is brought into the memory only whenonly when they are required to exe

they are required to execute the program at that cute the program at that instant. But in a paging system with swappinginstant. 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 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

into the RAM from backing store. Multiple transitions are being done as per the requirement of per the requirement of  processes form memory; both the terms could be w

processes form memory; both the terms could be w orking simultaneously in order to ensureorking simultaneously in order to ensure proper and smooth progress and execution of the program.

proper and smooth progress and execution of the program. 5.

5. How does the second-chance algorithm for page How does the second-chance algorithm for page replacement differ from the FIFO replacement differ from the FIFO pagepage replacement algorithm? (

replacement algorithm? (8 marks8 marks))

Second-chance algorithm works like FIFO does

Second-chance algorithm works like FIFO does by looking at the front of the queue. by looking at the front of the queue. In a pagingIn a paging system with swapping when a program requires a

system with swapping when a program requires a page and it is in the page and it is in the main memory, then amain memory, then a couple of pages are copied into the

couple of pages are copied into the RAM from backing store The difference RAM from backing store The difference between the twobetween the two algorithms is that instead of immediately paging out that page, second chance

algorithms is that instead of immediately paging out that page, second chance verifies whetherverifies whether

the page’s referenced bit is set. Because if set

the page’s referenced bit is set. Because if set then the referenced bit is cleared and the page isthen 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 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 swapped out. Second chance algorithm degenerates into pure FIFO if reference bit is set for all pages.

pages. 6.

6. Explain how copy-on-write operates. (Explain how copy-on-write operates. (8 marks8 marks))

Processes basically occur into the memory of the

Processes basically occur into the memory of the system and require a reasonable amount of system and require a reasonable amount of  memory in order to continue with their

memory in order to continue with their amount of effectiveness and working. While logicalamount of effectiveness and working. While logical memory is taken into consideration and it is broken down into equal sized

memory is taken into consideration and it is broken down into equal sized blocks, each of whichblocks, each of which is capable of storing the same amount of

(3)

paging system with swapping when a program requires a

paging system with swapping when a program requires a page and it is in the main memory,page and it is in the main memory, then a couple of pages are

then a couple of pages are copied into the RAM from backing store copied into the RAM from backing store When more than oneWhen more than one process is sharing a page and one of

process is sharing a page and one of them tries to modify that page tthem tries to modify that page then a copy of the page hen a copy of the page isis made on which modifications are done and original remains the same. COW is

made on which modifications are done and original remains the same. COW is an optimizationan optimization strategy used in virtual memory operating systems.

strategy used in virtual memory operating systems. 7.

7. If you were creating an If you were creating an operating system to handle files, what are the operating system to handle files, what are the six basic file operationssix basic file operations that you should implement? (

that you should implement? (8 marks8 marks))

Six basic file operations that should be implemented are: Six basic file operations that should be implemented are:

o

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

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

to the file. to the file.

o

o Reading a file: A system callReading a file: A system callwhich tells the required file’s name and location of which tells the required file’s name and location of requiredrequired

block is made. block is made.

o

o Repositioning within a fileRepositioning within a file o

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

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

8.

8. To create a new To create a new file, an application program calls on the logical file system. Describe file, an application program calls on the logical file system. Describe the stepsthe steps the logical file system takes to create a file. (

the logical file system takes to create a file. (8 marks8 marks))

The logical file system takes its roots from t

The logical file system takes its roots from t he logical memory, which is taken into considerationhe logical memory, which is taken into consideration in the form of pages that are

in the form of pages that are being deployed for the processing of the obeing deployed for the processing of the o verall system. Wheneververall system. Whenever a new file is to be

a new file is to be creates, an application program calls upon the logical file system for creates, an application program calls upon the logical file system for thethe processing on this file. The steps involved in this logical file system, which are to

processing on this file. The steps involved in this logical file system, which are to be consideredbe considered for the creation of the

for the creation of the new file, are such that new file, are such that a new file control block is allocated by the a new file control block is allocated by the logicallogical file system. An appropriate directory is read into memory

file system. An appropriate directory is read into memory by the system which updates theby the system which updates the

directory with new file’s name and file control block and writes it to disk. directory with new file’s name and file control block and writes it to disk.

9.

9. How is a hash table superior to a How is a hash table superior to a simple linear list structure? What issue must be handled bysimple linear list structure? What issue must be handled by hash table implementation? (

hash table implementation? (8 marks8 marks))

Hash table and simple linear structure are two

Hash table and simple linear structure are two unique kinds of data storage and retrievingunique kinds of data storage and retrieving methodologies, the implementation and the advantages of both are

(4)

The simple linear list is used for the purpose of

The simple linear list is used for the purpose of storing a rather simpler kind of data in which thestoring a rather simpler kind of data in which the storing and fetching is simpler and quicker. Linear list is used

storing and fetching is simpler and quicker. Linear list is used to store directory entries to store directory entries in hashin hash table implementation and hash data structure speeds up search

table implementation and hash data structure speeds up search process and allows help forprocess and allows help for linear list to compute file location in the

linear list to compute file location in the linear list. Collisions should be handled with hash tablelinear list. Collisions should be handled with hash table implementation which occurs due to mapping of multiple files on map.

implementation which occurs due to mapping of multiple files on map. 10.

10. What are the factors What are the factors influencing the selection of a disk-scheduling algorithm? (influencing the selection of a disk-scheduling algorithm? (8 marks8 marks))

Disk-Disk-scheduling algorithm’s performance is based on the quantity and type of requests.scheduling algorithm’s performance is based on the quantity and type of requests. As theAs the quantity of requests increase, there occurs and

quantity of requests increase, there occurs and increases in the overall disk-schedulingincreases in the overall disk-scheduling algorithm, it then has to work

algorithm, it then has to work in a different way so as to ensure in a different way so as to ensure the correct processing. The overthe correct processing. The over all outcome of disk scheduling algorithm is based on the quantity of requests as

all outcome of disk scheduling algorithm is based on the quantity of requests as well as the typewell as the type and complexity of the requests being taken up.

and complexity of the requests being taken up. Rotational latency and constraints of operatingRotational latency and constraints of operating system also influence it along with location of index block and directorie

system also influence it along with location of index block and directorie s. Constraints of s. Constraints of  operating system referring to the idea

operating system referring to the idea that the operating system is not as that the operating system is not as effectively able toeffectively able to perform to cope up with the

perform to cope up with the efficiency of the disk-scheduling system.efficiency of the disk-scheduling system.

11.

11. Explain the disadvantage(s) of the SSTF scheduling algorithm. (Explain the disadvantage(s) of the SSTF scheduling algorithm. (8 marks8 marks))

Disadvantages of the SSTF scheduling algorithms are: Disadvantages of the SSTF scheduling algorithms are:

a.

a. We can stay in one We can stay in one area of the disk for a long area of the disk for a long time due to heavy traffic leading totime due to heavy traffic leading to starvation. Starvation being the process in

starvation. Starvation being the process in which proper resources are not beingwhich proper resources are not being allocated to the processes upon their required time frame and the efficiency 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

hence decreases, each of the process waits for the other one to f ree theree the resources and the currently executed processes never leave the resources for resources and the currently executed processes never leave the resources for others.

others. b.

b. The performance is slowed if directions are The performance is slowed if directions are switched. The direction switchingswitched. The direction switching being a continuous process being taken up while the execution is taken into being a continuous process being taken up while the execution is taken into consideration hence a lot of delay in per

(5)

12.

12. Explain the concepts of aExplain the concepts of abusbusand aand adaisy chaindaisy chain. Indicate how these concepts are related. (. Indicate how these concepts are related. (88 marks

marks))

A bus specifies messages that can be

A bus specifies messages that can be sent and is a set of sent and is a set of a rigid protocol and wires. Buses withina rigid protocol and wires. Buses within a board are responsible for the tr

a board are responsible for the travelling of data from one part of the system avelling of data from one part of the system to be utilized andto be utilized and catered in another part of the

catered in another part of the system. Buses in real are rigid protocols and wiresystem. Buses in real are rigid protocols and wire s, through whichs, through which data travelling is being done. Messages are timed e

data travelling is being done. Messages are timed e lectrical patterns of voltage applied to wires.lectrical patterns of voltage applied to wires. A daisy chain on the other hand is a

A daisy chain on the other hand is a device configuration in which each device is connected device configuration in which each device is connected toto other device with a cable in t

other device with a cable in the form of a chain. This also takes into consideration the he form of a chain. This also takes into consideration the process of process of  passing message but the procedure and time

passing message but the procedure and time frame are the main things that frame are the main things that differ between thediffer between the two.

two. 13.

13. What are the three reasons that buffering is performed? (What are the three reasons that buffering is performed? (6 marks6 marks))

Buffering is performed because: Buffering is performed because:

a.

a. Application I/O need to support copy semanticsApplication I/O need to support copy semantics b.

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

be handled c.

References

Related documents

Like all other ProSim modules, ProSimCDU needs to know the IP address of the computer running the ProSim737 main program.. Fill in this information in the

– YES: Democrats are moving to the left, the left is getting more powerful in the party, partisan media is getting more popular – NO: There have yet to be major ideological

Hooked up as on serial up line protocol down, the cisco tech and check the configs, the error count does serial link that it, contact your clock.. Best for use a serial is up

IPT01 – IP Telephony (core IPT Service) management and support for IP telephone devices and the underlying infrastructure components and ongoing voice service operations. The

Kjørstad et al (2000) have analysed transfers from use of private car to public transport. For four major urban areas, they found that the average proportion of new passengers..

In addition, polyvinyl chloride (PVC)- supported palladium species have also been reported as catalyst in the Sonogashira reaction, as exemplified in the

In this chapter, I examine how contemporary performances of hapa, or mixed-Asian, characters complicate the identity narratives of the twenty-first century and highlight the