Skip to content
benhj edited this page Apr 27, 2014 · 2 revisions

A file is composed of blocks linked together in the manner of a linked list:

File structure

Although the above example shows a contiguous arrangement, any block can point to any other block in practice.

Block allocation

  • The number of blocks indicates the size of the TeaSafe image.
  • Blocks are allocated on a first come first serve basis.
  • Allocation is represented by a volume bitmap located near the start of the file system.
  • For allocated file block 45 (I've just chosen this one at random), bit 45 in the bitmap is set to 1
  • Unallocated file blocks remain unset (set to 0).
  • When files are unlinked (or truncated), the comprising block bits are unset and the blocks are free to be reused.
Clone this wiki locally