Master the fundamental concepts of file systems through this focused micro-challenge.
ext2 partitions disk into block groups, each with superblock copy, block bitmap, inode bitmap, inode table, and data blocks. It teaches modern ext4 without journaling complexity.
Per group:
0xEF53, counts, feature flagsFor example, inode 12 in group 0 might live at byte offset inode_table_start + 11 * inode_size.
The block-group layout you're parsing here is the direct ancestor of ext3 and ext4 , the default filesystem on most Linux servers , which still uses the same superblock magic number (0xEF53) and inode-table structure. Getting the block-size-to-log_block_size formula wrong (1024 << log_block_size) means every subsequent offset calculation reads garbage instead of real metadata.
Before you call the implementation done, walk failure modes on purpose. Test empty structures, single-element edge cases, maximum concurrency, and errno paths that must not crash the program. OS code usually fails in production when happy-path tests pass but invariants break under contention or memory pressure.
Keep structures small and name fields after kernel counterparts when possible. That lets you read man pages and kernel source side by side while you work. Print observable events during development; remove noisy logs once tests pass reliably.
You will read an ext2 image and print superblock fields plus inode 2 (root) mode and size. This exercise requires decoding direct block pointers for a small file.
Parse ext2 filesystem structures.
Requirements:
Test:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github