[Previous] - [Main menu] - [Next]
Revision 1.3

Omega File System

Published 11th of April 1999
by Lasse Krogh Thygesen


Purpose

The purpose of the Omega Partition Format (OPF) is to provide a safe format for organizing data on harddrives. The format has been designed to minimize wasted space from clusters/sectors. The cluster/sectors in the OPF are 512 bytes in length.


2 - How it works

The OPF consist of the following elements:

Picture showing the different parts of the Omega Partition Format: 1) Bootstrap, 2) SUM 1, 3) SUM 2, 4) LFAT 1, 5) LFAT 2, 6) Data area

The LBA address used in this specification are relative to the first LBA address of the partition. The later address is defined in the MBR.


Bootstrap + Partion Structure Data

This area is loaded by the bootmanager into memory and executed. It contains the secondary boot code which loads the operating system files. It also contains information on how big the SUM1/2 and LFAT1/2 data areas are.

Structure of the MBR sector
OffsetSizeDescription
0000h - 0003h4Assemble code: jmp 0080h
0004h - 000Ch8Partition serialnumber
0025h - 002Eh10LBA address location of SUM 1
002Fh - 0038h10LBA address location of SUM 2 (If 10x00h then none)
0039h - 0042h10Length of each SUM (Counting sectors)
0043h - 004Ch10LBA address location of LFAT 1
004Dh - 0056h10LBA address location of LFAT 2 (If 10x00h then none)
0057h - 0060h10Length of each LFAT (Counting sectors)
0000h - 0000h10LFAT id for the OS Launch program
0000h - 0000h128Partition name
0000h - 0000h31Reserved
0000h - 0000h4Omega Partitionformat signature (r1 - 14020100)

Partition serialnumber

A partition serialnumber which, at least should be unique in a given system. If two or more simelair numbers are found then the system should change them so that no partitions on a given system will have the same serialnumber. These serialnumbers are intended to be used when assigning drive numbers or mounting partitions in the directory hierachi.

LFAT entry for the OS Launch program

The LFAT id number makes it easy for the bootmanager or similair code to load the OS Launch program. The only thing it has to do is calculate the LBA address which hold the LFAT entry, load it, read the information and load the OS Launch program to memory.

Partition name

Very usefull for giving the partitions user friendly names.


SUM - Sector Usage Map

Each bit in this area represent a sector on the drive. If the sector contains data then this bit is 1, if not this bit is set to 0. By using this area the system can easily determine which sectors are available. The use of two maps are a protection feature against any faults in this critical system area. This protection features can be disable by setting the LBA address of the second map to 0.


LFAT - Logical File Allocation Table

All the data on the drive are logical organized in files and directories. This Logical File Allocation Table defines which data in the partition belongs to which files. The directory structure only exist inside the LFAT. The use of two tables are a protection feature against any faults in this critical system area. This protection features can be disabled by setting the LBA address of the second table to 0. Each entry in the LFAT takes 252 bytes of space. This makes room for 2 entries in each sector. At offset 01FCh each LFAT sector contains the LFAT signature (14020101h). The two entries have the following layout, with bases at 0000h and 0100h:

Structure of a LFAT entry
OffsetSizeDescription
0000h - 0003h10LFAT ID
0000h - 0003h10Parent LFAT directory entry. (10x00h if none)
0000h - 0003h128Filename
0000h - 0003h7Creation date (DD-MM-YYYY TT-MM-SS)
0000h - 0003h7Last save date (DD-MM-YYYY TT-MM-SS)
0000h - 0003h10First File Segment Header (LBA address)
0000h - 0003h12Length of logical file (Counting bytes)
0000h - 0003h1Level of fragmentation
0000h - 0003h2Status code
0000h - 0003h4Owner ID
0000h - 0003h4Group ID
0000h - 0003h1Owner Permission Flag
0000h - 0003h1Group Permission Flag
0000h - 0003h1Others Permission Flag
0000h - 0003h57Reserved

LFAT Id

This is a unique number by which the entry is recognized. Note that entry 0 is always defined as the root of the directory structure.

Parent LFAT directory entry

In the directory structure this is the directory entry in which the entry is logical placed. If the entry is located in the root this must be set to entry 0.

Filename

The name of the file/directory/object. This can be any of the 256 caraters from the ASCII table.

Dates

The creation date marks the time when the entry was created. This date can't be changed. The last save date marks the time when the file was last written or partially written. Note: Systems could set the creation date when deleting an entry.

First File Segment Header (FSH)

This LBA address is the location of where the file's data is located on the disc. If the file is fragmented the address should be of the first filesegment. More about Data Segment and File Segment Header (FSH) later. For LFAT directory entries the FSH should be 10x00h.

Level of fragmentation

May be set by the disk service routines, for later use with deframentation.

Status code

The two bytes should be read as 4 values ranging from 0 to F in the hexadecimal system. Usually the two bytes are shown as xx xx, where position 1 is the one on the left.

Structure of the status codes
PositionUsage
1 - Hide information: 0 = Not hidden
1 = Hidden for low priviledge program
3 = Hidden for user
2 = Hidden for high priviledge program
F = Hidden for all but OS
2 - Protection info.: 0 = Not protected
1 = Erase protected
2 = Write protected
3 = Read protected for low priviledge program
4 = Read protected for high priviledge program
F = Protected for all but OS
3 - Owner information: 0 = Public
1 = Shared
2 = Program
3 = User
F = System
4 - Type information: 0 = Not used / Deleted file
1 = Deleted directory
2 = File
3 = Directory
4 = Directory List
5 = Link

Owner ID / Group ID

For use with the OS security mechanism. A user with the same ID as the Owner ID (the actual owner of the file) may perform the operations which the Owner Permission Flag allow. User which are members of a group with the same ID as the Group ID field, may perform the operations which the Group Permission Flag allow. And finally other user may perform the operations which the Others Permission Flag allow.

Owner / Group / Others Permission Flags

The Owner Permission Flag describes what the owner may do with the object. The Group Permission Flag describes what members of the group may do with the object. And the Others Permission Flag describes what other users may do with the object. The format of the Permission Flags are:

Structure of the Permission Flags
7 6 5 4 3 2 1 0
Reserved Executable Linkable Writable Readable


Data area

This area is where the actual data is located.

File Segment Header

Each segment of a file has it own File Segment Header. This 512 bytes preceeding every datasegment in the partition, holds information about which LFAT entry the segment belongs to, how long the file is, and if the data segment is part of a fragmented file, it contains the LBA address of the previous filesegment, and the next filesegment, the length of this datasegment, and the offset from the start of the file.

Structure of the File Segment Headers
OffsetSizeDescription
0000h - 0009h10Link to previous File Segment Header (LBA). 10x00h if none.
000Ah - 0013h10Link to next File Segment Header (LBA). 10x00h if none.
0014h - 001dh10LFAT ID
001Eh - 0027h10Length of this filesegment (Counting sectors)
0028h - 0031h10Segments offset in LFAT file (Counting sectors)
0032h - 0032h1FSH status: deleted file/dir (0h/1h), file (2h), directory (3h)
0033h - 01FBh425Reserved
0033h - 01FBh32Password
01FCh - 01FFh4Omega Partition Format - FSH signature (14020102)


Maximum capacity

As the sectors are identified by a 10 bytes (80 bit) number, the total number of addressable sectors are 1.2089e24, which is around 524288 * 1.073.741.824 Terabyte. This is a rather big number, so the capacity will not be a problem in the near future.


Advantages & Disadvantages

As every datasegent need a FSH, the minimum disc usage for a file would be 2 * 512 bytes (512 for the FSH and 512 for the minimum cluster size). At some time there may become a free discspace of 512 bytes, between two datasegments. This free space won't be available until one of the segments around it is moved (Forexampel by a disc utility program).

When a file is very fragmented it may influence the system performace, because the drive needs to move its head a lot. This can be solved by running a disc utility program to defragment the files.


Tips



Changes from previous revision