File System & Block Allocation
Navigate the directory tree and watch files land on disk blocks.
//
readme.md— blocks
todo.txt— blocks
Disk blocks (32 × 4 KB)
1 free fragments0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
On-disk files
boot.sys(3 blocks)blocks 0–2
kernel.bin(6 blocks)blocks 3–8
user.db(4 blocks)blocks 9–12
doc.txt(2 blocks)blocks 13–14
media.mp4(5 blocks)blocks 15–19
Trade-offs
Contiguous is fast but suffers external fragmentation. Linked allocation uses free blocks anywhere but each block carries a pointer. Indexed allocation needs one index block per file but supports direct random access.