You are viewing skolk

skolk kolk

SDI file format specification

Windows (R) XP Embedded
SDI file format specification

Definitions

Page as used in SDI file format is default i386 MMU page, 4096 bytes.
All numeric values in SDI file are stored in little-endian 64-bit format.
Empty (reserved) fields and space from a BLOB end to the beginning of next BLOB
are padded with 0-s.

SDI file is not padded at the end, so total length of an SDI file equals to
sum of aligned offset to last BLOB and exact (not aligned) length of that BLOB.

All BLOBs are aligned on boundary of alignment block.
Size of alignment block is specified as multiple of page size.
Size of SDI header alone is always 1 page, so if SDI consists of only a header,
its length is exactly 4096 bytes regardless of alignment block size.

First sector (512 bytes, the header) is checksummed, as described in previous article
http://skolk.livejournal.com/886.html
For empty header with 1-page alignment the checksum value is 0x3A.

TOC begins at third sector (at 0x400 = 1K) (may be it can last until end of page ;-) )

Header format (offset 0)

char magic[4] (= '$SDI')
char ver[4]   (= '0001', you can define char magic[8] instead )
QWORD MDBtype
0 --- (Unspecified)
1 RAM
2 ROM

QWORD BootCodeOffset
QWORD BootCodeSize
Them are just copies of Offset and Size fields from the BOOT BLOB TOC record, if present.
QWORD VendorID (16-bit HEX value, PCI SIG?)
QWORD DeviceID (16-bit HEX value - what chip do you mean? Northbridge? Network?)

GUID DeviceModel
QWORD DeviceRole (int32 value)
QWORD Reserved1
GUID RuntimeGUID
QWORD RuntimeOEMrev (int32 value)
QWORD Reserved2
QWORD PageAlignment (BLOB alignment value in pages, as specified in /pack: )
QWORD Reserved3[48] (48=384/8; 384=0x80*3)
QWORD Checksum

TOC (Table-of-Content) record format (record size 64 bytes (0x40) ), offset of first record 0x400

char BLOBtype[8] (3-4 bytes UPPERCASE value, 0-padded)
QWORD Attr (uint32 value)
QWORD Offset
QWORD Size
QWORD BaseAddress
(0 for non-filesystem BLOBs, filesystem code for PART (as in MBR) - 7 for NTFS, 6 for BIGFAT, etc)
QWORD Reserved[3]

end-of-TOC is just 0-record (may be detected by 0-blobtype)

known BLOB types:
BOOT (startrom.*, you could use server' hdlscom?.* for debug)
LOAD (osloader.exe, bootmgr.exe for PE 2.0)
You can unstub regular ntldr or setupldr.bin with oneliner from oss.netfarm.it
- get fixloader.py from here: http://oss.netfarm.it/guides/pxe.php

PART (Winimage .ima - just a filesystem, as old Linux initrd)
DISK (image with a MBR, you could import flat-VHD or *-flat.vmdk)
WIM (a new squashfs-style Windows Vista filesystem)

sdimgr /pack just needs to alphabetically sort BLOBs ('BOOT' < 'LOAD' < 'PART')

There are neither checksums for TOC and files (BLOB-s), nor sdimgr supports
signing of SDI file.

You should not make BootCodeOffset point to non-aligned-boundary
(for example to point into unused part of TOC in the first page),
some loaders can depend on it!

I hope this info is enough to write your own open-source version of sdimgr :-)

This post is discussed here:
http://www.boot-land.net/forums/index.php?showtopic=4182&mode=linear
Tags: , , ,

Comments

skolk kolk

March 2008

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
Powered by LiveJournal.com