BCOS File FormatsProject Map
BCOS Boot Image File Format Specification
Version 1.0
(Preliminary Draft)
 

Contents

1                Overview
2                General File Structure
3                File Format
3.1                Generic File Header
3.2                Extended Header
3.3                Boot Image Entries
3.3.1                Boot Image Directory Entries
3.3.1.1                Directory Group Read Flags
3.3.1.2                Directory Group Write Flags
3.3.2                Boot Image File Entries
3.3.2.1                File Group Read Flags
3.3.2.2                File Group Execute Flags
3.3.3                Owner User IDs


Tables

Table 3.1      Extended Header Format
Table 3.2      Boot Image Directory Entry Layout
Table 3.3      Boot Image File Entry Layout



1   Overview

A Boot Image is an archive of files, including a directory structure, that is loaded into RAM early during boot and used by boot code to find any files that are needed before the virtual file system is available.

The Boot Image is also used to initialize the virtual file system, so that the directory structure and files that were contained in the Boot Image become available using normal file I/O after boot (e.g. using something like a RAM disk). After boot the virtual file system sychronizes with any file systems, so that (for example) when the operating system is being installed and a new/empty file system is mounted at "/" the directory structure and files that were contained in the Boot Image will be written to the new file system.

The Boot Image itself consists of entries, where each entry describes a directory or a file.


2   General File Structure

The basic structure of the file is described in Figure 2.1: File Layout.

_End of file

 Boot Image Entries 

_Offset obtained from extended header
 Extended Header 
_Offset 32
 Generic File Header 
_Offset 0

Figure 2.1 - File Layout


3   File Format

3.1   Generic File Header

This is the native file format header defined in BCOS Native File Format Specification.


3.2   Extended Header

The extended header follows the generic file header, and is described in Table 3.1: Extended Header Format.

OffsetSizeDescription
  0x00000020
  4 bytes
  32-bit offset within file for start of Boot Image Entries (see Section 3.3: Boot Image Entries)
  0x00000024
  4 bytes
  Number of Boot Image Entries
Table 3.1 - Extended Header Format


3.3   Boot Image Entries

There are 2 types of Boot Image Entries - entries that describe a directory, and entries that describe a file.


3.3.1   Boot Image Directory Entries

The format for a Boot Image Directory Entry is described in Table 3.2: Boot Image Directory Entry Layout.

OffsetSizeDescription
  0x00000000
  4 bytes
  Size of this entry
  0x00000004
  4 bytes
  Must be zero to indicate entry is a directory entry
  0x00000008
  16 bytes
  Directory creation timestamp (see BCOS Native File System Attributes Application Note, Chapter 4: Timestamps)
  0x00000018
  2 bytes
  Directory general flags (see BCOS Native File System Attributes Application Note, Section 6.1: General Flags)
  0x0000001A
  1 byte
  Directory group read flags (see Paragraph 3.3.1.1: Directory Group Read Flags)
  0x0000001B
  1 byte
  Directory group write flags (see Paragraph 3.3.1.2: Directory Group Write Flags)
  0x0000001C
  4 bytes
  Directory owner user ID (see Subsection 3.3.3: Owner User IDs)
  0x00000020
  Varies
  UTF-8 Directory name string (see BCOS Native File System Attributes Application Note, Chapter 5: File and Directory Names)
  Varies
  Varies
  Optional padding (e.g. to align next entry on 4 byte boundary)
Table 3.2 - Boot Image Directory Entry Layout


3.3.1.1   Directory Group Read Flags

The meaning of the Directory Group Read Flags field in Directory Entries is defined by BCOS Native File System Attributes Application Note, Section 6.2: Group Read Flags for Directories, however only Fixed Group IDs (as defined by BCOS Native File System Attributes Application Note, Section 3.1: Fixed Group IDs) are valid in a Boot Image.


3.3.1.2   Directory Group Write Flags

The meaning of the Directory Group Write Flags field in Directory Entries is defined by (see BCOS Native File System Attributes Application Note, Section 6.3: Group Write Flags for Directories), however only Fixed Group IDs (as defined by BCOS Native File System Attributes Application Note, Section 3.1: Fixed Group IDs) are valid in a Boot Image.


3.3.2   Boot Image File Entries

The format for a Boot Image File Entry is described in Table 3.3: Boot Image File Entry Layout.

OffsetSizeDescription
  0x00000000
  4 bytes
  Size of this entry
  0x00000004
  4 bytes
  Offset of file data relative to the start of the entry
  0x00000008
  16 bytes
  File creation timestamp (see BCOS Native File System Attributes Application Note, Chapter 4: Timestamps)
  0x00000018
  2 bytes
  File general flags (see BCOS Native File System Attributes Application Note, Section 6.1: General Flags)
  0x0000001A
  1 byte
  File group read flags (see Paragraph 3.3.2.1: File Group Read Flags)
  0x0000001B
  1 byte
  File group execute flags (see Paragraph 3.3.2.2: File Group Execute Flags)
  0x0000001C
  4 bytes
  File owner user ID (see Subsection 3.3.3: Owner User IDs)
  0x00000020
  4 bytes
  Size of the file data in bytes
  0x00000024
  4 bytes
  File type (see BCOS File Type Specification)
  0x00000028
  Varies
  UTF-8 File name string (see BCOS Native File System Attributes Application Note, Chapter 5: File and Directory Names)
  Varies
  Varies
  Optional padding (e.g. to align file data on 4 byte boundary)
  Varies
  Varies
  File data
  Varies
  Varies
  Optional padding (e.g. to align next entry on 4 byte boundary)
Table 3.3 - Boot Image File Entry Layout

Note: During boot, boot code will set bit 14 in the general flags for file entries that were accessed. This is intended to make it easier for software to generate a minimal boot image (containing only the accessed files) after boot.


3.3.2.1   File Group Read Flags

The meaning of the File Group Read Flags field in File Entries is defined by BCOS Native File System Attributes Application Note, Section 6.4: Group Read Flags for Files, however only Fixed Group IDs (as defined by BCOS Native File System Attributes Application Note, Section 3.1: Fixed Group IDs) are valid in a Boot Image.


3.3.2.2   File Group Execute Flags

The meaning of the File Group Execute Flags field in File Entries is defined by BCOS Native File System Attributes Application Note, Section 6.5: Group Execute Flags for Files, however only Fixed Group IDs (as defined by BCOS Native File System Attributes Application Note, Section 3.1: Fixed Group IDs) are valid in a Boot Image.


3.3.3   Owner User IDs

The meaning of the Owner User ID field in Directory Entries and File Entries is defined by BCOS Native File System Attributes Application Note, Chapter 2: User IDs, however only Fixed User IDs (as defined by BCOS Native File System Attributes Application Note, Section 2.1: Fixed User IDs) are valid in a Boot Image.


Generated on Tue Sep 22 05:34:46 2009