Advanced Computing Environment
Hosted by SourceForge
brix-os project page

Object File System

OFS is a lightweight flat file system that uses a single hybrid B-tree to store all files. It supports both 32bit and 64bit addressing and the B-tree can scale from 256 up to 2^64 maximum files. The 32bit OFS can access drives with a capacity of 2 terabytes while the 64bit OFS can access drives greater than 8 billion terabytes, using 512 byte sectors. See the design concepts page for more information on OFS.

Boot sector header
The root block pointer is accessed by BIOS code during setup and must be located in the first 2 terabytes on the boot device.


Bad sectors block
The bad block pointer in the boot sector will be NULL if the drive does not contain any bad sectors. A single sector block will be allocated when bad sectors are found during a scan. The block contains 63 64bit pointers to bad sectors and the last 64bits holds a pointer to the next bad sectors block.

Free sectors block
The free block pointer must point to a single sector block containing 31 free sector entries, 1 64bit reserved value and 1 64bit pointer to the next free block.

Root block
The root tree holds all files and an 8 to 64bit index is used to access each file. The number of primary levels for the root tree is stored in the boot sector attributes.

Primary block

Object block

Sector Link Tables
If the 'SLT' attribute is not set then the sector pointer points to the first sector of the object. Otherwise it points to a Sector Link Table (SLT). When an object is created it will be stuck in continuous sectors. If there aren't enough continuous sectors then an SLT is created. Each entry in the SLT points to a run of sectors for the object. If the object grows beyond what a single SLT can provide then another SLT is created and linked to the end of the last SLT.

The first object (ID=0) is reserved for the setup code and can't use a sector link table because the boot code doesn't support them.