PROJECT: SINGLIX Operation System   Issue: 1    Revision: 11    Date: 03/03/2007

OWNER: ERDOĐAN TAN / Istanbul / Turkiye

 

 

 

 

 

 

BOOT SECTOR PARAMETERS of  SINGLIX FS1, FS2  file systems

 

 

 

 

 

 

Offset

Item

DATA

Type

Size

Description of Item

0

Jmp bootstrap

XXXXh

Word

2 byte

“Jump to boot code” / OPCODE

2

Nop

90h

Byte

1 byte

Reserved (Must be 90h)

3

FileSystem ID

‘FS’

Char

2 byte

SINGLIX ATA(PI) File System Identifier

5

Terminator

0

Byte

1 byte

Zero String Terminator

6

Bytes Per Sector

XXXXh

Word

2 byte

FS1 = 512 (ATA), FS2 = 2048 (ATAPI)

8

Media Attributes

XXh

Byte

1 byte

Media Attributes Byte

9

Partition ID

XXh

Byte

1 byte

SINGLIX, FS Hard Disk = A1h, FD = 0

10

FS Version Major

XXh

Byte

1 byte

File System Version – Major = 1

11

FS Version Minor

XXh

Byte

1 byte

File System Ver. – Minor/Revision = 0

12

Beginning Sector

XXXXXXXXh

Dword

4 byte

Volume Beginning (Boot) Sector (LBA)

16

Volume Size

XXXXXXXXh

Dword

4 byte

Volume/Partition Size in Sectors

20

Startup File Addr.

XXXXXXXXh

Dword

4 byte

OS Startup File/Code/Prog. Location

24

MAT Location

XXXXXXXXh

Dword

4 byte

Master Allocation Table Location

28

Root Dir Location

XXXXXXXXh

Dword

4 byte

Root Directory Descriptor Address

32

Registry File Addr.

XXXXXXXXh

Dword

4 byte

System Config. File Descriptor Location

36

Swap File Addr.

XXXXXXXXh

Dword

4 byte

Swap File/Space Descriptor Location

40

Undelete Dir Addr.

XXXXXXXXh

Dword

4 byte

Undelete/Restore Directory Location

44

Operation System

16 chars

Char

16 byte

‘TR-SINGLIX v1.0b’  etc.

60

Terminator

0

Byte

1 byte

Zero String Terminator

61

OS BUILD No.

XXXXh

Word

2 byte

Operation System BUILD (ID) Number

63

Reserved (Drive)

XXh

Byte

1 byte

Reserved (for Drive Number)

64

Magic Word

01A1h

Byte

2 byte

TR-SINGLIX OS Boot Code Sign

66

Boot Code

444 bytes

Byte

444 byte

OS Boot (Startup File Loader) Code

510

BootSign

AA55h

Word

2 byte

Boot Sector Identifier

 

NOTE: Volume Beginning Sector is LBA address of Boot Sector. Startup File/Code Address, MAT Location, Root Dir. Descriptor Location, Registry File Location, Swap File Descriptor Location are offset LBA addresses are offset addresses (from beginning of the fs/volume, boot sector); these are NOT absolute addresses. Reserved byte at Offset 63 is not valid/mandatory for boot sector, but it can be used for passing the drive number to operation system startup code/program. (Byte at Offset 63 must not be used as true/correct drive number reference/parameter. It will/may be updated/changed during boot procedure.)

Volume Beginning Sector (LBA) value is needed for passing it to operation system; because, operation system will use it to convert offset addresses to absolute/physical disk adresses. (It points boot sector’s itself. Bootstrap code can not know boot sector LBA address as default, because boot code runs after INT 19h loads Boot Sectors at the 0:7C00h memory adress. Rombios INT 19h code does not pass Boot Sector LBA address to bootstrap code as default. TR-SINGLIX disk format program will assign that 32 bit boot sector address for fixed/partitioned disks in LBA format. For removable/non-partitioned disks, it is ZERO as default.)

 

Master Allocation Table keep locations and free counts of 64K Disk Allocation Tables, 4 bytes for DAT location, 4 bytes for free sector count. The high word of the volume size shows count of Disk Allocation Tables. DAT pointers are 1 byte pointers which show allocation status of the sector offsets of the DAT section (For example: DAT 0 allocates/represent the first 32 MB of the TR-SINGLIX volume, and the pointer FFFFh in the DAT 0 represents the sector 0000FFFFh (LBA) exactly, 4 bytes offset value of the sector in FS.) Absolute address of this sector is internal/volume address offset + Volume Beginning Sector. DAT pointers with ZERO values show free sectors, others show allocated sectors. Some pointer values carry special meanings like File Description Table, Directory Description Table, Root Dir Descriptor, Master Table, Disk Alloc. Table, Boot Sector, Bad Sector, Deleted Data Sector, Registry File, Swap File etc.) Do not forget: Every DAT shows allocation status/map of a 32 MB disk section.

 

Root Directory and sub directories do not include OS Startup File, that file (with maximum 64 K size) is a boot block file, which initializes Operation System. Also, root directory and sub directories do not include Registry (System Config.) File, that file is a boot block file which reserves OS configuration like GUI settings etc. Also, swap file (instead of a separate swap partition/volume) is for memory extension and will not appear in root or subdirectories. Shortly, we can say that: we can not make, delete boot (super) block files in directory tree. (File System formatting programs responsible for that.)

 

Remember that: in SINGLIX FS, directory and file data is just after their/its description table sector.

(For example: If the first FDT Address is 00006E00h, file data starts from sector 00006E01h.)

 

Operation System Software can start boot code from Offset 64, only “SINGLIX” have to start boot code from Offset 66; Offset 64 which is selfcheck point for SINGLIX code, it can look for “417” there. (For example: Singlix OS Startup File/Program starts with special/trick options, at the beginning of startup file code, if register AX has 417, it is special startup sign for the program. The boot code may load register AX with value at Boot Sector Offset 64, just before jump to optional startup file/program. Because, if startup file address is non-zero, boot sector code will load and jump to startup file/program code.)

 

This FS project is for INTEL x86 CPU models, but compatible for other CPU models. (Media Attributes Byte, FS Version Word, OS BUILD Number Word can be used as CPU, Software Architecture Identifier.)

 

Media Attributes Byte:

 

Bit 0 => If Bit 0 is ‘0’, file system is read only. (CD-ROM etc.) WRITE flag

Bit 1 => If Bit 1 is ‘1’, file system is on removable/mountable/unmountable media. REMOVABLE flag

Bit 2 to Bit 7 => Reserved. Must be ‘0’ for This FS Version. (These BITs may be assigned in future.)

 

FS on ATAPI CD-ROM =  xxxxxx10b = 2h

FS on ATA Hard/Fixed Disk = xxxxxx01b = 1h

FS on USB Virtual/Flash Disk = xxxxxx11b = 3h