allocation methods continuous method.47

21
http://raj- os.blogspot.in/ 1 Allocation Methods

Upload: myrajendra

Post on 28-Nov-2014

3.535 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 1

Allocation Methods

Page 2: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 2

HOME PREVIOUS TOPIC NEXTPREVIOUS QUESTION PAPERS FOR OSCPP TUTORIALS

Page 3: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 3

Recap

In the last class, you have learnt:

• Various free space management techniques

Page 4: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 4

Objectives

On completion of this period, you would be able to know

• Why allocation methods are needed

• Various allocation methods

Page 5: Allocation methods continuous method.47

http://raj-os.blogspot.in/

• An allocation method refers to how disk blocks

are allocated for files

• Allocation methods are for

- effective disk space utilization

– allow fast file access

Allocation Methods

5

Page 6: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 6

Allocation Methods

Three major methods of allocation of disk space are

– Contiguous

– Linked

– Indexed

Page 7: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 7

Contiguous Allocation

• Each file occupies a set of contiguous blocks on

the disk

• Simple – only starting location (block #) and length (number of blocks) are required

• Random access

• Wasteful of space (dynamic storage-allocation problem)

• Files cannot grow

Page 8: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 8

Contiguous Allocation

• Accessing block b+1 after block b

(assuming that only one job is accessing the disk )

– Requires no head movement

– When needed only one track to the next

Page 9: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 9

Contiguous Allocation

• The number of disk seeks are Minimal

• The seek time when a seek is needed Minimal

Page 10: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 10

Contiguous Allocation

• Contiguous allocation file is defined by

– Disk address

– Length (in block units) of the block

Page 11: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 11

Contiguous Allocation

Example: • If file is n block long and starts at location b, then

– The blocks occupied are b, b+1, b+2…..b+n-1

Page 12: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 12

Contiguous Allocation

• The directory entry for file has

– Name

– Starting address

– Length

Page 13: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 13

Contiguous allocation

Example:

Fig 1

Page 14: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 14

Contiguous Allocation

Fig 2

Page 15: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 15

Problems of Contiguous Allocation

• Finding space for a new file or a resized file.

• Determining size requirements.

• External fragmentation of the hard disk.

Page 16: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 16

Wasteful if only a few pointers are stored in the index block

Number of disk access necessary to retrieve the address of target block address

Indexed Allocation Disadvantages

16

Page 17: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 17

In this class, you have learnt

Various allocation methods

Their advantages and disadvantages

Summary

17

Page 18: Allocation methods continuous method.47

http://raj-os.blogspot.in/

Frequently Asked Questions

1.Why allocation methods are needed

2. Explain various allocation methods

3.List the advantages and disadvantages of

various allocation methods

18

Page 19: Allocation methods continuous method.47

http://raj-os.blogspot.in/ 19

Quiz

• Allocation methods are for effective disk space utilization [T/F]

• With contiguous allocation the disk movement is minimal [T/F]

True

True

Page 20: Allocation methods continuous method.47

http://raj-os.blogspot.in/

Quiz

Linked allocation support direct access [T/F]– False

Space is wasted for pointers [T/F]– True

20

Page 21: Allocation methods continuous method.47

Other subject materials

• Web designing

• Micro processors

• C++ tutorials

• java

home

21http://raj-os.blogspot.in/