Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I'm stuck on this c programming lab regarding file allocation memory. So my program needs to implement a contiguous allocation method and bit-map to

Hi, I'm stuck on this c programming lab regarding file allocation memory.

So my program needs to implement a contiguous allocation method and bit-map to determine the free blocks allocations.

"The physical store is represented by an array of 256 entries with entries as a disk block.

File is represented as a series of integer number ranging from 100 to 9999. The first number is taken as the file identifier (i.e. 100, 200, 1000, 1100, ., 9800, 9900). The content of the file is represented as successive integer number increment from the file identifier (i.e. 1101, 1102, 1103, ).

Each entry in the array holds one number. The number is the file content. In this example, the user input add 100, 6. The first number, 100, is the file identifier. The second number is the number of data block it requires. Hence, 101, 102, 103, 104, 105 and 106 represents the data. "

What my program should is that;

I have should have empty 256 array.

"Your program will start by simulating the formatting process by asking the user for the required block size or number of blocks. To simplify it, user can only enter block size of 1, 2,4,8,16,32,64,128 or 256 which corresponds to 256, 128, 64, 32, 16,8, 4,2 or 1 blocks. "

"Your program needs to add or delete files based on user inputs.

a. add 100, 6 b. delete 200

For a, the file handler is 100 and you need to have 6 data blocks to be added. Hence, 101, 102, 103, 104, 105 and 106 are added.

For b, the file handler is 200. Hence, the entries from 201 to 208 in Table 1 have to be deleted. Thus, block 2 and 3 are free and can be used to store new data "

"Your program will terminate if either one of the 2 conditions occur:

a. When there is no available contiguous space for addition file. That is, at the first instance when a user request to add the file cannot be done. A terminating message such as Disk is full will be printed out. b. When user key in -1. "

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

What determines domicile for an individual?

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago