Task: 1. Write a C program to simulate the sequential file allocation in a very simple file system. 2. Assume a disk of 32 blocks, each block is of 1 KB size 3. First 8 blocks (0 to 7) are allocated to the “iNodes” and can’t be used by the file system. Hence blocks available for allocation are from block 8 to block 31. 4. Minimum file size is 1 KB. Hence the file system can have minimum of one file of size 24 KB or maximum of 24 files. 5. At the start, it is assumed that the file system has no files. 6. The program shall ask the user to input the number of files to allocate and their respective names and file sizes. 7. The program shall randomly (set a seed with srand(seed) to replicate the randomness) select any free block as a start block. Check that the start block and the required contiguous blocks are free. If free, allocate those blocks to the file. If not free, find next available contiguous blocks. 8. After allocating blocks for all the files, the program shall print file name, file size, and the contiguously allocated blocks for each file. Refer to the program output shown below. 9. Required test case: Use the example file names and sizes shown above 10. Not required test cases:
Task: 1. Write a C program to simulate the sequential file allocation in a very simple file system. 2. Assume a disk of 32 blocks, each block is of 1 KB size 3. First 8 blocks (0 to 7) are allocated to the “iNodes” and can’t be used by the file system. Hence blocks available for allocation are from block 8 to block 31. 4. Minimum file size is 1 KB. Hence the file system can have minimum of one file of size 24 KB or maximum of 24 files. 5. At the start, it is assumed that the file system has no files. 6. The program shall ask the user to input the number of files to allocate and their respective names and file sizes. 7. The program shall randomly (set a seed with srand(seed) to replicate the randomness) select any free block as a start block. Check that the start block and the required contiguous blocks are free. If free, allocate those blocks to the file. If not free, find next available contiguous blocks. 8. After allocating blocks for all the files, the program shall print file name, file size, and the contiguously allocated blocks for each file. Refer to the program output shown below. 9. Required test case: Use the example file names and sizes shown above 10. Not required test cases:
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Topic Video
Question
Task:
1. Write a C program to simulate the sequential file allocation in a very simple file system.
2. Assume a disk of 32 blocks, each block is of 1 KB size
3. First 8 blocks (0 to 7) are allocated to the “iNodes” and can’t be used by the file system. Hence blocks
available for allocation are from block 8 to block 31.
4. Minimum file size is 1 KB. Hence the file system can have minimum of one file of size 24 KB or maximum
of 24 files.
5. At the start, it is assumed that the file system has no files.
6. The program shall ask the user to input the number of files to allocate and their respective names and
file sizes.
7. The program shall randomly (set a seed with srand(seed) to replicate the randomness) select any free
block as a start block. Check that the start block and the required contiguous blocks are free. If free,
allocate those blocks to the file. If not free, find next available contiguous blocks.
8. After allocating blocks for all the files, the program shall print file name, file size, and the contiguously
allocated blocks for each file. Refer to the program output shown below.
9. Required test case: Use the example file names and sizes shown above
10. Not required test cases:
2. Assume a disk of 32 blocks, each block is of 1 KB size
3. First 8 blocks (0 to 7) are allocated to the “iNodes” and can’t be used by the file system. Hence blocks
available for allocation are from block 8 to block 31.
4. Minimum file size is 1 KB. Hence the file system can have minimum of one file of size 24 KB or maximum
of 24 files.
5. At the start, it is assumed that the file system has no files.
6. The program shall ask the user to input the number of files to allocate and their respective names and
file sizes.
7. The program shall randomly (set a seed with srand(seed) to replicate the randomness) select any free
block as a start block. Check that the start block and the required contiguous blocks are free. If free,
allocate those blocks to the file. If not free, find next available contiguous blocks.
8. After allocating blocks for all the files, the program shall print file name, file size, and the contiguously
allocated blocks for each file. Refer to the program output shown below.
9. Required test case: Use the example file names and sizes shown above
10. Not required test cases:
o If there are not enough contiguous blocks available for a file, the program can exit.
o Program need not implement file deletion or modification.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education