0
0
Operating Systemsknowledge~30 mins

Free space management in Operating Systems - Mini Project: Build & Apply

Choose your learning style9 modes available
Free Space Management in Operating Systems
📖 Scenario: You are learning how operating systems keep track of free space on a disk. This helps the system know where new files can be stored.
🎯 Goal: Build a simple representation of free space management using a list to track free blocks on a disk.
📋 What You'll Learn
Create a list called free_blocks with exact block numbers
Add a variable total_blocks to represent total disk blocks
Use a loop to find all free blocks less than a given threshold
Add a final statement to mark the end of free space tracking
💡 Why This Matters
🌍 Real World
Operating systems must manage disk space efficiently to store and retrieve files without errors.
💼 Career
Understanding free space management is important for system administrators and software developers working with file systems.
Progress0 / 4 steps
1
Create the initial free blocks list
Create a list called free_blocks with these exact block numbers: 2, 5, 7, 10, and 15.
Operating Systems
Need a hint?

Use square brackets to create a list and separate numbers with commas.

2
Add total disk blocks variable
Add a variable called total_blocks and set it to 20 to represent the total number of blocks on the disk.
Operating Systems
Need a hint?

Just assign the number 20 to the variable total_blocks.

3
Find free blocks below a threshold
Use a for loop with variable block to go through free_blocks. Create a new list called low_free_blocks that includes only blocks less than 10.
Operating Systems
Need a hint?

Use a list comprehension to filter blocks less than 10.

4
Mark the end of free space tracking
Add a variable called end_marker and set it to "END" to indicate the end of free space tracking.
Operating Systems
Need a hint?

Assign the string "END" to the variable end_marker.