Schematically Structured File System 00.01

Master Boot Record Format

 

DRAFT: #1

WRITTEN BY: Vandad Nahavandipoor

EMAIL: AlexiLaiho.cob@GMail.com

 

*1 to 65536 sectors long depending on LLLL

*All reserved bits must be set to zero

 

Start Byte

End Byte

Length

Value

Description

0

439

440

Variable


The boot code for the media.
The bootstrap code for the media is not limited to 440 bytes of assembled code. The LLLL after the SSFS Signature (Described below) can be set to any value from 0 to 65535 as the number of sectors that the bootstrap code can use.

 

Therefore, if the LLLL after the SSFS Signature is set to 4 for example, then the bootstrap code will have 4 extra sectors right after the Master Boot Sector to continue its code stream. Or if LLLL is set to 0x0000 (zero) in the SSFS Signature, then the bootstrap code will be limited to 440 bytes in the Master Boot Record from Bytes #0 to #439 inclusive.

 

440

441

2

0x8ACE


SSFS Signature (Constant for all SSFS formatted media).


If this 2-bytes-long value is not set to 0x8ACE then it means that this media is not formatted as a SSFS compliant media.

442

443

2

0xLLLL


Extended Bootstrap Sector Count. LLLL
is the length of the bootstrap code that must be attached to the end of the Master Boot Sector at Sector #0. For example, if this value is set to 0x0003 then it means that the Master Boot Record will be extended for 3 more sectors right after Sector #0 of the media.

 

Therefore, the bootstrap code will have enough space for its initialization and etc. This value can be set to anything in the range 0…65535 therefore the bootstrap code can contain up to 65535 sectors. If this value is set to 0xFFFF for 65535, the bootstrap code can be extended for:

 

440 + (65535 * 512) = 33554360 bytes. 440 bytes is the main bootstrap code from Byte #0 to Byte#439 inclusive and since each sector on the disk is 512 bytes long, the above result will be yielded.

If LLLL is set to 0x0000 (zero), the bootstrap code will be limited to 440 bytes that have been set aside originally, from Bytes #0 to Byte #439 inclusive.

444

445

2

0x0000

Reserved.

446

493

48

Variable


The PART (Partition Table).
Each partition on the media is described by a 12-bytes-long descriptor called PARD or the Partition Descriptor. The format of each PARD is shown below:

 

typedef STRUCT PARD{

  BYTE       PartitionType;

  BYTE       PartitionNameInASCII;

  BYTE[6]   LBA48AddressofFirstSector;

  DWORD   LengthofPartitionInSectors;

}


Using this scheme, in the space of 48 bytes, there can be 4 partitions saved (4*12=48) and described.

 

The [PartitionType] member of the PARD structure can be any of the below values and even a mixture of these values (OR):

 

  • 0x01 = Partition is present.
  • 0x02 = Partition is bootable.
  • 0x04 = Partition is formatted.
  • 0x08 = Reserved.
  • 0x10 = Reserved.
  • 0x20 = Reserved.
  • 0x40 = Reserved.
  • 0x80 = Reserved.

 

The [LBA48AddressofFirstSector] must be greater than LLLL+1. For example, if LLLL is set to 1 then the [LBA48AddressofFirstSector] of any of the partitions must be bigger than or equal to 2 because obviously Sector #1 in this case is given to the Extended Bootstrap.

If LLLL is set to 3 for example, the [LBA48AddressofFirstSector] of any of the partitions should not be less than or equal to 3.

The [PartitionNameInASCII] member of the PARD structure must be a character in the range ‘A’…’Z’, ‘a’…’z’, ‘0’…’9’. Special characters such as null, ‘^’, ‘\’ and etc are not allowed. This allows up to 26+26+10 different names to be selected for each drive using the SSFS format.

494

497

4

Variable


Format Date Stamp.
This 4-bytes-long Time Stamp must have the below format of bits (Ordered from right to left):

 

  • 8 Bits for the Day.
  • 8 Bits for the Month.
  • 16 Bits for the Year.

 

Constraints on these values:

 

  1. The Day must be > 0 and < 32.
  2. The Month must be > 0 and < 13.
  3. The Year must be > 2006.

 

498

501

4

Variable


Format Time Stamp in Military Format (24H).
This 4-bytes-long Date Stamp must follow the below format for bits ordered from right to left as shown below:

 

  • 6 Bits for the Seconds (0…59).
  • 6 Bits for the Minutes (0…59).
  • 5 Bits for the Hours (0…24)*.
  • 15 Bits are reserved.

 

Constraints on these values:

 

  1. The Seconds must be < 60.
  2. The Minutes must be < 60.
  3. The Hours must be >= 0 and <= 24.

 

* The Hours field must be in the range 0…24 inclusive meaning that the time 24:00:00 is completely valid. The time must turn in this way:

23:59:59
à 24:00:00 à 00:00:01 à etc.

 

502

509

8

Variable

Size of the media in sectors.

510

511

2

0xAA55

MBR Signature (LSB = 0x55, MSB = 0xAA).