This commit is contained in:
@@ -0,0 +1,615 @@
|
||||
+++
|
||||
title = 'XTHV1: A New Registry Hive Format for ExectOS'
|
||||
author = 'Aiken Harris'
|
||||
date = '2026-11-29T12:17:03+01:00'
|
||||
+++
|
||||
We would like to share some news about what we are working on right now: configuration management and the
|
||||
registry. Like everything else in the kernel, the registry
|
||||
follows the NT model. There is a hierarchical database of keys and values, security descriptors on keys, volatile
|
||||
keys that disappear on reboot, symbolic links, and the familiar native API on top. One part of it, however, takes a
|
||||
different road. ExectOS will not store its registry in the REGF hive files known from Windows. Instead, we are
|
||||
deploying our own on-disk format, called **XTHV1**.
|
||||
<!--more-->
|
||||
|
||||
This article explains why we made that decision, what it buys us, what it costs, and what it means for NT
|
||||
compatibility. The second half is the complete specification of the format as it stands today.
|
||||
|
||||
### Why Not REGF?
|
||||
REGF is the file format of Windows registry hives. It has served Windows well for three decades, but those three
|
||||
decades show. The format accumulated revisions, compatibility rules, and fields whose meaning changed over time.
|
||||
Its crash consistency depends on a header with sequence numbers and a simple checksum, combined with separate
|
||||
transaction log files that are replayed when the primary file turns out to be inconsistent. The registry data
|
||||
itself, the bins and cells that hold keys and values, carries no integrity protection at all. A torn write, a
|
||||
flipped bit or a page written to the wrong place is only noticed if it happens to break the structure badly enough,
|
||||
and a damaged hive is typically handled by repairing it in place: dropping whatever cannot be made consistent and
|
||||
carrying on.
|
||||
|
||||
There is also the question of documentation. REGF has never been specified by its author. Everything known about it
|
||||
comes from observation and reverse engineering, and every implementation outside Windows has to rediscover the same
|
||||
corner cases. Implementing it for ExectOS would mean committing to a format we cannot fully specify, cannot change,
|
||||
and whose most important guarantees live in a log replay protocol rather than in the file itself.
|
||||
|
||||
We wanted the opposite: a format we can describe completely in one document, whose consistency does not depend on
|
||||
side files, and in which every byte on disk is verified before it is trusted.
|
||||
|
||||
### What XTHV1 Is
|
||||
XTHV1 keeps the record model that registry implementations have relied on for decades. Keys, values, security
|
||||
records and subkey indexes are stored as records in cells, and cells are grouped into bins. The configuration
|
||||
manager above the file therefore works with familiar structures. What changes is everything around those records.
|
||||
|
||||
An XTHV1 file is a sequence of 4096-byte pages. Two of them hold superblocks, the roots of the two most recent
|
||||
committed images. Every other page is either a data page carrying a piece of the registry image or a node of a
|
||||
small three-level map tree that translates logical page numbers into physical ones. Every pointer in the file, from
|
||||
the superblock down to each data page, carries a SHA-1 hash of the page it points to. The whole committed image is
|
||||
thus covered by a hash tree whose root lives in the superblock, and the superblock is protected by its own hash.
|
||||
|
||||
Changes are never written in place. A commit writes modified data pages and the map nodes above them to free pages,
|
||||
then publishes a new superblock in the slot that does not hold the current image. Until the second superblock write
|
||||
is durable, the previous image is the committed one. Afterwards the new one is. There is no log to replay and no
|
||||
intermediate state to repair.
|
||||
|
||||
### What We Gain
|
||||
**Atomic commits without logs.** A crash at any point of a commit leaves the file with either the previous image or
|
||||
the new one, both complete. Recovery after a power failure is the same procedure as a normal mount: pick the newest
|
||||
valid superblock and follow it.
|
||||
|
||||
**Every byte is verified.** Torn pages, bit rot, misdirected writes and stale pages are detected by the hash tree
|
||||
before any record is parsed. A hive that mounts successfully has been checked end to end.
|
||||
|
||||
**The previous image stays available.** Pages of the previous generation are not reused while it is still one of
|
||||
the two live images. If the newest image fails verification, the reader can fall back to the previous one, which is
|
||||
complete and consistent, instead of guessing which parts of a damaged image are still trustworthy.
|
||||
|
||||
**A canonical byte form.** Free space is zeroed, reserved fields are zero and runtime-only state never reaches the
|
||||
disk. Two hives with the same content and history produce the same bytes. Images are reproducible and comparable,
|
||||
and test fixtures can be generated from the specification alone.
|
||||
|
||||
**Strict structure.** The format defines exactly which records may appear and who may reference them. Every
|
||||
allocated cell must be reachable from the root key, every cell except a security record has exactly one owner,
|
||||
names are unique within a key, and indexes must be ordered and carry correct hints. There is no room for hidden
|
||||
data, dangling references or ambiguous interpretations, which also makes crafted hives considerably less
|
||||
interesting as an attack vector.
|
||||
|
||||
**64-bit physical addressing and a complete specification.** Physical page numbers are 64-bit, and the logical
|
||||
image can be scattered across the file in any order. The format is fully specified below, including test vectors,
|
||||
so it can be implemented independently of the ExectOS kernel.
|
||||
|
||||
### What We Give Up
|
||||
**Compatibility at the file level.** Windows cannot read XTHV1 hives, and ExectOS will not read REGF hives. Existing
|
||||
registry tools that operate on hive files will not work with ours.
|
||||
|
||||
**Write amplification.** Changing a single byte rewrites the whole data page, one map node on each of the three
|
||||
levels and a superblock, separated by two durable flushes. REGF with its log can be cheaper for small, frequent
|
||||
updates. We accept this because registry writes are batched and comparatively rare, and because the cost buys
|
||||
atomicity.
|
||||
|
||||
**Space.** Two generations are live at the same time, so a file may temporarily hold close to twice the pages of the
|
||||
logical image, plus about 1.2% for map nodes. Physical pages are also not kept in logical order.
|
||||
|
||||
**Verification cost.** Mounting a hive hashes every page and walks the entire record graph. For registry-sized data
|
||||
this is a small price, but it is not free.
|
||||
|
||||
**No automatic repair.** A strict format rejects images that a lenient implementation would silently patch. XTHV1
|
||||
1.0 can fall back to the previous generation, but it defines no procedure for rewriting damaged content. A
|
||||
dedicated repair mechanism is planned, but it is not part of this version.
|
||||
|
||||
**SHA-1.** The hash tree uses SHA-1, whose collision resistance is no longer considered strong. The purpose of the
|
||||
hashes is to detect accidental damage, not to authenticate the file. Anyone who can write the file can recompute
|
||||
any hash in it, so a stronger function without a key would not change that.
|
||||
|
||||
### What This Means for NT Compatibility
|
||||
Our compatibility target has always been the interface, not the files. Applications and drivers use the registry
|
||||
through the native API and never parse hive files themselves. The semantics they depend on, such as keys, values and
|
||||
value types, security descriptors, volatile keys and symbolic links, are preserved. From their point of view,
|
||||
nothing changes.
|
||||
|
||||
What does change is everything that handles hive files directly. Offline registry editors, forensic tools and
|
||||
anything that copies hives between systems will not understand XTHV1, and moving registry data between Windows and
|
||||
ExectOS requires conversion. Our boot loader reads XTHV1 directly, so no REGF parser is needed anywhere in the boot
|
||||
path.
|
||||
|
||||
### The XTHV1 Specification
|
||||
The rest of this article is the specification of XTHV1 version 1.0, cell format 1. It is written for implementers
|
||||
of readers, writers, validators and debugging tools, and it does not require any knowledge of the ExectOS sources.
|
||||
The keywords MUST, MUST NOT, SHOULD and MAY are to be interpreted as described in RFC 2119.
|
||||
|
||||
#### 1. Conventions
|
||||
- All multi-byte numbers are **little-endian**. Offsets are decimal unless written as `0x…`.
|
||||
- `u8`, `u16`, `u32` and `u64` are unsigned integers of the given width. `i32` is a signed 32-bit integer.
|
||||
- "Zero" means that every byte of the range is `0x00`.
|
||||
- String literals are ASCII. `\r`, `\n` and `\x1a` denote the bytes `0x0D`, `0x0A` and `0x1A`.
|
||||
- The tables define the exact byte layout. An implementation MAY map them to C structures as long as widths,
|
||||
offsets and buffer bounds match. A buffer's position in the file says nothing about its alignment in memory, so
|
||||
readers MUST NOT assume that a page buffer is aligned for typed access.
|
||||
|
||||
#### 2. Container
|
||||
An XTHV1 file is a sequence of 4096-byte **pages** addressed by a **physical block number** (PBN). The byte offset of
|
||||
a page is `PBN × 4096`.
|
||||
|
||||
| PBN | Content |
|
||||
|-----|---------|
|
||||
| 0 | Superblock, slot A |
|
||||
| 1 | Superblock, slot B |
|
||||
| ≥ 2 | Data pages and map nodes, in any order |
|
||||
|
||||
The **logical image** is the registry content: a sequence of bins (§7) of `LogicalBytes` bytes. The logical image is
|
||||
divided into **logical pages** (LPN). Logical byte address `L` lies in `LPN = L / 4096` at offset `L % 4096`. The map
|
||||
tree (§5) translates every LPN into the PBN that holds it, and consecutive logical pages need not be physically
|
||||
adjacent. All cell indexes and bin offsets refer to the logical image.
|
||||
|
||||
The pages reachable from a superblock form a **committed image**. Any other page in the file belongs to an older
|
||||
generation or to an interrupted commit and MUST be ignored by readers.
|
||||
|
||||

|
||||
|
||||
#### 3. Superblock
|
||||
A superblock is exactly 4096 bytes long. The first 176 bytes form the header, followed by reserved space and the
|
||||
superblock hash.
|
||||
|
||||

|
||||
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 8 | Magic | bytes `58 54 48 56 31 0D 0A 1A` (`"XTHV1\r\n\x1a"`) |
|
||||
| 8 | 2 | Major | `u16`, `1` |
|
||||
| 10 | 2 | Minor | `u16`, `0` |
|
||||
| 12 | 4 | HeaderBytes | `u32`, `176` |
|
||||
| 16 | 4 | PageBytes | `u32`, `4096` |
|
||||
| 20 | 4 | SlotId | `u32`, `0` for slot A, `1` for slot B. MUST match the page the superblock is stored in. |
|
||||
| 24 | 16 | HiveId | Opaque hive identity. MUST NOT be all zero. Both slots MUST agree. |
|
||||
| 40 | 8 | Generation | `u64`, non-zero. Grows by one with every commit and never wraps. |
|
||||
| 48 | 8 | LogicalBytes | `u64`, size of the logical image. `4096 ≤ LogicalBytes ≤ 0x7FFFF000`, a multiple of 4096. |
|
||||
| 56 | 8 | FilePageLimit | `u64`, ≥ 2. Exclusive upper bound of every PBN used by the live generations (§12). |
|
||||
| 64 | 4 | RootCell | `u32`, cell index of the root key node. |
|
||||
| 68 | 4 | CellFormat | `u32`, `1` (the record catalog of §8). |
|
||||
| 72 | 48 | MapRoot | Descriptor (§5.2) of the level-2 map node. |
|
||||
| 120 | 8 | CommitTime | `u64`, 100 ns units since 1601-01-01. Diagnostic, not interpreted. |
|
||||
| 128 | 8 | RequiredFeatures | `u64`, `0` in version 1.0 (§13). |
|
||||
| 136 | 8 | ReadOnlyFeatures | `u64`, `0` in version 1.0 (§13). |
|
||||
| 144 | 8 | CompatibleFeatures | `u64`, `0` in version 1.0 (§13). |
|
||||
| 152 | 16 | WriterId | Opaque writer identity. Diagnostic, not interpreted. |
|
||||
| 168 | 4 | HashAlgorithm | `u32`, `1` (SHA-1, §4). |
|
||||
| 172 | 4 | Reserved | `u32`, zero. |
|
||||
| 176 | 3888 | — | Reserved, zero. |
|
||||
| 4064 | 32 | SuperblockHash | SHA-1 digest of the superblock (§4.2) in bytes 0–19. Bytes 20–31 are zero. |
|
||||
|
||||
**Validating a slot.** Each slot is examined independently.
|
||||
|
||||
1. A slot is **absent** if the file is too short to contain its page. It is **torn** if the magic does not match, if
|
||||
any of the last 12 bytes of `SuperblockHash` is non-zero, or if the digest does not match the computed
|
||||
superblock hash. Absent and torn slots are skipped. They are never repaired.
|
||||
2. A slot that passes these checks is **authenticated**. If an authenticated slot carries `Major ≠ 1`, `Minor ≠ 0`,
|
||||
`HeaderBytes ≠ 176`, `PageBytes ≠ 4096`, `CellFormat ≠ 1`, `HashAlgorithm ≠ 1` or `RequiredFeatures ≠ 0`, the file
|
||||
is **unsupported** and MUST be refused. A reader MUST NOT fall back to the other slot in that case.
|
||||
3. An authenticated slot whose `HiveId` is all zero, whose `SlotId` does not match its page, whose `Reserved` field
|
||||
or any byte in 176–4063 is non-zero, whose `Generation` is zero, whose `LogicalBytes` is out of range or not a
|
||||
multiple of 4096, or whose `FilePageLimit` is below 2 makes the file **corrupt**.
|
||||
4. Otherwise the slot is **valid**.
|
||||
|
||||
**Selecting the current image.**
|
||||
|
||||
- If both slots are valid, their `HiveId` values MUST be equal and their `Generation` values MUST differ. Otherwise
|
||||
the file is corrupt. The slot with the higher generation holds the **current** image, and the other holds the
|
||||
**previous** image.
|
||||
- If one slot is valid, it holds the current image and there is no previous image. A newly created hive has slot A
|
||||
at generation 1 and slot B filled with zeros.
|
||||
- If no slot is valid, the file is not an XTHV1 hive.
|
||||
|
||||
#### 4. Hashes
|
||||
`HashAlgorithm = 1` selects SHA-1 (FIPS 180-1). Every hash field is 32 bytes long: the 20-byte digest followed by 12
|
||||
zero bytes, which readers MUST verify. Digests cover the exact bytes stored in the file.
|
||||
|
||||
##### 4.1 Page hash
|
||||
Data pages and map nodes are hashed together with a 52-byte context that binds the page to its position:
|
||||
|
||||
```
|
||||
preimage = Domain[8] ‖ HiveId[16] ‖ u64 PBN ‖ u64 BirthGeneration ‖ u64 BaseLpn ‖ u32 LevelTag ‖ Page[4096]
|
||||
hash = SHA-1(preimage)
|
||||
```
|
||||
|
||||
| Field | Data page | Map node |
|
||||
|-------|-----------|----------|
|
||||
| Domain | `"XTHVDAT1"` | `"XTHVMAP1"` |
|
||||
| HiveId | hive identity | hive identity |
|
||||
| PBN | page's own PBN | page's own PBN |
|
||||
| BirthGeneration | from the page's descriptor | the node's `BirthGeneration` |
|
||||
| BaseLpn | the page's LPN | the node's `BaseLpn` |
|
||||
| LevelTag | `0xFFFFFFFF` | the node's `Level` |
|
||||
|
||||
The context is exactly 52 bytes long. There are no padding bytes between `LevelTag` and the page data, and the full
|
||||
preimage is 4148 bytes long. Because the PBN and the generation are part of the preimage, a valid page copied to
|
||||
another location, or a stale page from an older generation, does not verify.
|
||||
|
||||
A child's hash MUST equal the hash stored in its parent's descriptor. The root descriptor is stored in the
|
||||
superblock and protected by the superblock hash.
|
||||
|
||||
##### 4.2 Superblock hash
|
||||
```
|
||||
preimage = "XTHVSUP1" ‖ Superblock[4096], with bytes 4064–4095 set to zero
|
||||
hash = SHA-1(preimage)
|
||||
```
|
||||
|
||||
#### 5. Map Tree
|
||||
##### 5.1 Shape
|
||||
The map tree has exactly three levels. Each node holds up to 84 descriptors, so the tree can address
|
||||
84³ = 592 704 pages. That is more than the 524 287 pages of the largest logical image, so the depth never depends on
|
||||
the image size. The level-2 root covers the whole image. Each level-1 node covers 84² = 7056 logical pages, each
|
||||
level-0 node covers 84 logical pages, and level-0 descriptors point at data pages.
|
||||
|
||||

|
||||
|
||||
The mapping is dense. With `N = LogicalBytes / 4096`, the LPNs `0 … N − 1` exist, and no others do. To resolve an
|
||||
LPN, take entry `LPN / 7056` of the root, entry `(LPN % 7056) / 84` of the level-1 node and entry `LPN % 84` of the
|
||||
level-0 node.
|
||||
|
||||
##### 5.2 Descriptor
|
||||
A descriptor is 48 bytes long. It is used for the superblock's `MapRoot` and for every node entry.
|
||||
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 8 | PBN | `u64`. `2 ≤ PBN < FilePageLimit`, and the page MUST lie entirely within the file. |
|
||||
| 8 | 8 | BirthGeneration | `u64`, the generation in which the child page was written. `1 ≤ BirthGeneration ≤ Generation` of the superblock. |
|
||||
| 16 | 32 | Hash | Page hash of the child (§4.1), followed by 12 zero bytes. |
|
||||
|
||||
An **empty descriptor** is 48 zero bytes. Within one committed image, no PBN may appear twice: not as the root, not
|
||||
as a node and not as a data page. Pages are shared across generations, never within one.
|
||||
|
||||
##### 5.3 Map node
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 8 | Magic | `"XTHVMAP1"` |
|
||||
| 8 | 16 | HiveId | Equals the superblock's `HiveId`. |
|
||||
| 24 | 8 | BirthGeneration | Equals the `BirthGeneration` of the descriptor that points to this node. |
|
||||
| 32 | 8 | BaseLpn | First LPN covered by the node (global, not relative to the parent). |
|
||||
| 40 | 4 | Level | `0`, `1` or `2`. |
|
||||
| 44 | 4 | UsedEntries | `1 … 84`. Nodes are never empty. |
|
||||
| 48 | 16 | — | Reserved, zero. |
|
||||
| 64 | 4032 | Entries | 84 descriptors. Entries `0 … UsedEntries − 1` are present, and the rest are empty. |
|
||||
|
||||
Every node field is fully determined by the node's position:
|
||||
|
||||
- Root: `Level = 2`, `BaseLpn = 0`, `UsedEntries = ⌈N / 7056⌉`.
|
||||
- Level-1 node at root entry `i`: `Level = 1`, `BaseLpn = i × 7056`,
|
||||
`UsedEntries = ⌈(min(N, BaseLpn + 7056) − BaseLpn) / 84⌉`.
|
||||
- Level-0 node at entry `j` of a level-1 node with base `B`: `Level = 0`, `BaseLpn = B + j × 84`,
|
||||
`UsedEntries = min(84, N − BaseLpn)`.
|
||||
|
||||
A reader MUST verify every node against these values and its descriptor, and MUST verify that the level-0 nodes
|
||||
together cover all `N` logical pages.
|
||||
|
||||
#### 6. Limits
|
||||
| Quantity | Limit |
|
||||
|----------|-------|
|
||||
| Logical image | 4096 … `0x7FFFF000` bytes, a multiple of 4096 |
|
||||
| Physical file | bounded by `FilePageLimit × 4096`. The format imposes no fixed cap. |
|
||||
| Generation | 1 … 2⁶⁴ − 1. Exhaustion stops commits, and the counter never wraps. |
|
||||
| Bin | at least 4096 bytes, a multiple of 4096 |
|
||||
| Cell | 8 … 1 048 576 bytes, a multiple of 8 |
|
||||
| Big value data | at most 65 535 chunks of 16 344 bytes (1 071 104 040 bytes) |
|
||||
| Index record | 1 … 65 535 entries, limited by its cell |
|
||||
|
||||
Implementations MAY impose stricter resource limits, such as a maximum file size or a maximum nesting depth of the
|
||||
key and index graph, and MUST document them. Such limits belong to the implementation, not to the format. For
|
||||
reference, the ExectOS kernel accepts files of up to 2²⁰ pages (4 GiB) and key/index nesting up to 64 levels deep.
|
||||
|
||||
#### 7. Bins and Cells
|
||||

|
||||
|
||||
##### 7.1 Bin
|
||||
A bin is a contiguous range of the logical image consisting of a 32-byte header followed by cells.
|
||||
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 4 | Signature | `u32` `0x6E696268` (bytes `"hbin"`) |
|
||||
| 4 | 4 | FileOffset | `u32`, logical offset of this bin. MUST equal its actual position. |
|
||||
| 8 | 4 | Size | `u32`, total size of the bin: ≥ 4096, a multiple of 4096, and within the image. |
|
||||
| 12 | 8 | — | Reserved, written as zero, not interpreted by readers. |
|
||||
| 20 | 8 | TimeStamp | Diagnostic, not interpreted. |
|
||||
| 28 | 4 | Spare | Written as zero, not interpreted by readers. |
|
||||
|
||||
The first bin starts at logical offset 0. Each following bin starts where the previous one ends, and the last one
|
||||
ends exactly at `LogicalBytes`. A bin may span several logical pages, which may be stored anywhere in the file.
|
||||
Bins never move, because cell indexes stored inside them depend on their position.
|
||||
|
||||
##### 7.2 Cell
|
||||
A cell consists of an `i32 Size` header followed by `|Size| − 4` bytes of payload.
|
||||
|
||||
- `Size < 0`: an **allocated** cell. Its payload holds a record (§8) or raw data.
|
||||
- `Size > 0`: a **free** cell. Its payload MUST be zero.
|
||||
- `Size = 0` and `Size = 0x80000000` are invalid.
|
||||
- `|Size|` includes the header, is a multiple of 8, satisfies `8 ≤ |Size| ≤ 1 048 576`, and MUST NOT extend past the
|
||||
end of the bin.
|
||||
- The first cell starts at bin offset 32. Cells follow each other without gaps, and the last one ends exactly at the
|
||||
end of the bin.
|
||||
|
||||
The usable payload of a cell is `|Size| − 4` bytes. Cell format 1 has no backward pointer: the 4-byte header is the
|
||||
entire cell header.
|
||||
|
||||
A **cell index** is the 32-bit logical offset of a cell header. `0xFFFFFFFF` (`HCELL_NIL`) means "no cell". Bit 31
|
||||
marks a cell in volatile storage, which exists only in memory, so it never appears in a file. Every cell index stored
|
||||
in a record MUST be below `LogicalBytes`, MUST have bit 31 clear, and MUST point at the start of an allocated cell,
|
||||
never into the middle of a cell or at a free cell.
|
||||
|
||||
#### 8. Record Catalog
|
||||
Records live in the payload of allocated cells. Offsets below are relative to the payload start, which lies four
|
||||
bytes after the cell header. Records are byte-packed: a field's offset is exactly the one given, even if this
|
||||
leaves it unaligned in memory. The fixed parts of `nk` and `vk` are 76 and 20 bytes long. Each record type is
|
||||
identified by a `u16` signature at offset 0:
|
||||
|
||||
| Record | `u16` value | Bytes on disk |
|
||||
|--------|------------:|---------------|
|
||||
| Key node | `0x6B6E` | `"nk"` |
|
||||
| Value node | `0x6B76` | `"vk"` |
|
||||
| Big data | `0x6264` | `"db"` |
|
||||
| Security | `0x6B73` | `"sk"` |
|
||||
| Index root | `0x6972` | `"ri"` |
|
||||
| Index leaf | `0x696C` | `"li"` |
|
||||
| Fast leaf | `0x666C` | `"lf"` |
|
||||
| Hash leaf | `0x686C` | `"lh"` |
|
||||
|
||||
Value data, class data, value lists and chunk lists are raw cells without a signature. They are validated through
|
||||
the record that references them.
|
||||
|
||||
##### 8.1 Key node (`nk`)
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 2 | Signature | `0x6B6E` |
|
||||
| 2 | 2 | Flags | See the flag table below. |
|
||||
| 4 | 8 | LastWriteTime | Diagnostic, not interpreted. |
|
||||
| 12 | 4 | Spare | Not interpreted. |
|
||||
| 16 | 4 | Parent | Cell of the parent key. The root key points to itself. |
|
||||
| 20 | 4 | SubKeyCounts[0] | Number of subkeys. |
|
||||
| 24 | 4 | SubKeyCounts[1] | Volatile subkey count. `0` on disk. |
|
||||
| 28 | 4 | SubKeyLists[0] | Subkey index (§8.5). `HCELL_NIL` if and only if `SubKeyCounts[0] = 0`. |
|
||||
| 32 | 4 | SubKeyLists[1] | Volatile subkey index. `HCELL_NIL` on disk. |
|
||||
| 36 | 4 | ValueList.Count | Number of values. |
|
||||
| 40 | 4 | ValueList.List | Value list (§8.6). `HCELL_NIL` if and only if `Count = 0`. |
|
||||
| 44 | 4 | Security | `sk` record, or `HCELL_NIL`. |
|
||||
| 48 | 4 | Class | Class data cell, or `HCELL_NIL`. |
|
||||
| 52 | 16 | MaxNameLen, MaxClassLen, MaxValueNameLen, MaxValueDataLen | Advisory `u32` counters, not validated. |
|
||||
| 68 | 4 | WorkVar | Runtime scratch. Zero on disk. |
|
||||
| 72 | 2 | NameLength | Length of the name in bytes. |
|
||||
| 74 | 2 | ClassLength | Length of the class data in bytes. `0` if and only if `Class = HCELL_NIL`. |
|
||||
| 76 | var | Name | `NameLength` bytes (§9). |
|
||||
|
||||
| Flag | Name | On disk |
|
||||
|------|------|---------|
|
||||
| `0x0001` | `KEY_VOLATILE` | Forbidden (runtime only). |
|
||||
| `0x0002` | `KEY_HIVE_EXIT` | Forbidden (runtime only). |
|
||||
| `0x0004` | `KEY_HIVE_ENTRY` | Forbidden (runtime only). |
|
||||
| `0x0008` | `KEY_NO_DELETE` | Allowed. The key cannot be deleted. |
|
||||
| `0x0010` | `KEY_SYM_LINK` | Allowed. The key is a symbolic link. |
|
||||
| `0x0020` | `KEY_COMP_NAME` | Allowed. The name is stored in compressed form (§9.1). |
|
||||
| `0x0040` | `KEY_PREDEF_HANDLE` | Allowed. See below. |
|
||||
| `0x0080`–`0x0800` | — | Undefined, forbidden. |
|
||||
| `0xF000` | User flags | Allowed. Four bits for the configuration manager, not interpreted by the format. |
|
||||
|
||||
Rules:
|
||||
|
||||
- A key node with any forbidden flag bit is invalid. New bits require a new format version or feature bit (§13).
|
||||
- The name MUST fit into the cell (`76 + NameLength ≤ |Size| − 4`) and MUST follow §9.1. Every key except the root
|
||||
MUST have a non-empty name.
|
||||
- `Parent` MUST name the key whose index lists this key. The root key's `Parent` is its own cell.
|
||||
- If `ClassLength > 0`, the class cell MUST hold at least `ClassLength` payload bytes.
|
||||
- If `KEY_PREDEF_HANDLE` is set, `ValueList.List` MUST be `HCELL_NIL`. `ValueList.Count` then holds a handle value
|
||||
that the format does not interpret, and the key has no values.
|
||||
- `SubKeyCounts[0]` MUST equal the number of keys reachable through `SubKeyLists[0]`, counted through index roots.
|
||||
- `SubKeyCounts[1]` MUST be `0` and `SubKeyLists[1]` MUST be `HCELL_NIL`. Volatile subkeys exist only in memory.
|
||||
|
||||
##### 8.2 Value node (`vk`)
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 2 | Signature | `0x6B76` |
|
||||
| 2 | 2 | NameLength | Length of the name in bytes. `0` denotes the default value of a key. |
|
||||
| 4 | 4 | DataLength | Encoded data size (below). |
|
||||
| 8 | 4 | Data | Inline data, data cell or `db` cell (below). |
|
||||
| 12 | 4 | Type | Registry value type, passed through without interpretation. |
|
||||
| 16 | 2 | Flags | `0x0001` = `VALUE_COMP_NAME`. All other bits MUST be zero. |
|
||||
| 18 | 2 | Spare | Not interpreted. |
|
||||
| 20 | var | Name | `NameLength` bytes (§9). The name MUST fit into the cell. |
|
||||
|
||||
| `DataLength` (D) | Storage |
|
||||
|------------------|---------|
|
||||
| `0x80000000 ≤ D ≤ 0x80000004` | **Inline.** The data (`D − 0x80000000` bytes) is stored in the `Data` field itself. Unused bytes SHOULD be zero. |
|
||||
| `0 ≤ D ≤ 0x3FD8` | **External.** `Data` names a cell whose payload holds at least `D` bytes. |
|
||||
| `0x3FD8 < D < 0x80000000` | **Big data.** `Data` names a `db` record (§8.3). |
|
||||
| `D > 0x80000004` | Invalid. |
|
||||
|
||||
The external form requires a data cell even when `D = 0`, so writers SHOULD store empty data inline as
|
||||
`0x80000000`. Values are not ordered.
|
||||
|
||||
##### 8.3 Big data (`db`)
|
||||
| Offset | Size | Field |
|
||||
|-------:|-----:|-------|
|
||||
| 0 | 2 | Signature (`0x6264`) |
|
||||
| 2 | 2 | Count: number of chunks, `u16`, ≥ 1 |
|
||||
| 4 | 4 | List: cell holding `Count` chunk cell indexes (`u32`) |
|
||||
|
||||
The value data is split into chunks of 16 344 bytes (`0x3FD8`). `Count` MUST equal `⌈D / 0x3FD8⌉`. The list cell
|
||||
MUST hold at least `4 × Count` payload bytes. Every chunk except the last MUST hold at least `0x3FD8` payload bytes,
|
||||
and the last chunk at least the remainder. Bytes between the logical end of a chunk and the end of its payload MUST
|
||||
be zero. Chunk contents are opaque value data and are never interpreted as records.
|
||||
|
||||
##### 8.4 Security record (`sk`)
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 2 | Signature | `0x6B73` |
|
||||
| 2 | 2 | Reserved | Zero. |
|
||||
| 4 | 4 | Flink | Next `sk` in the ring. |
|
||||
| 8 | 4 | Blink | Previous `sk` in the ring. |
|
||||
| 12 | 4 | ReferenceCount | `u32`, ≥ 1. |
|
||||
| 16 | 4 | DescriptorLength | `u32`, ≥ 20, and `20 + DescriptorLength` MUST fit into the cell's payload. |
|
||||
| 20 | var | Descriptor | Self-relative security descriptor of `DescriptorLength` bytes. |
|
||||
|
||||
All `sk` records of an image form a circular, doubly linked ring. For every element, the `Blink` of its `Flink`
|
||||
successor MUST point back at it, and following `Flink` MUST return to the starting element. A single record points to
|
||||
itself in both directions. Security records are the only records that may be shared: `ReferenceCount` MUST equal the
|
||||
number of key nodes whose `Security` field names the record.
|
||||
|
||||
The descriptor is validated structurally only, with no security policy implied:
|
||||
|
||||
| Offset | Size | Field | Rule |
|
||||
|-------:|-----:|-------|------|
|
||||
| 0 | 1 | Revision | `1` |
|
||||
| 1 | 1 | Sbz1 | `0` |
|
||||
| 2 | 2 | Control | MUST contain `SE_SELF_RELATIVE` (`0x8000`). Other bits are passed through. |
|
||||
| 4 | 4 | Owner | `0`, or an offset ≥ 20 of a SID inside the descriptor. |
|
||||
| 8 | 4 | Group | `0`, or an offset ≥ 20 of a SID inside the descriptor. |
|
||||
| 12 | 4 | Sacl | `0`, or an offset ≥ 20 of an ACL inside the descriptor. |
|
||||
| 16 | 4 | Dacl | `0`, or an offset ≥ 20 of an ACL inside the descriptor. |
|
||||
|
||||
A SID MUST have revision 1 and 1–15 subauthorities, and all of them MUST lie inside the descriptor. An ACL MUST have
|
||||
revision 2, a zero `Sbz1` byte, and an `AclSize` of at least 8 that fits inside the descriptor. Each of its
|
||||
`AceCount` ACEs MUST have a 4-byte header with an `AceSize` of at least 4, and MUST lie inside `AclSize`.
|
||||
|
||||
##### 8.5 Subkey indexes
|
||||
An index record starts with a `u16` signature and a `u16 Count`, followed by `Count` entries. `Count` MUST be at
|
||||
least 1, and all entries MUST fit into the cell.
|
||||
|
||||
| Record | Entry | Points to |
|
||||
|--------|-------|-----------|
|
||||
| `ri` (index root) | `u32 Cell` | further index records of any type |
|
||||
| `li` (leaf) | `u32 Cell` | key nodes |
|
||||
| `lf` (fast leaf) | `u32 Cell`, `u8 NameHint[4]` | key nodes |
|
||||
| `lh` (hash leaf) | `u32 Cell`, `u32 HashKey` | key nodes |
|
||||
|
||||
- Within one `li` or `lf` leaf, keys MUST be sorted in strictly increasing order of name (§9.3).
|
||||
- Within one `lh` leaf, entries MUST be sorted in non-decreasing order of `HashKey`. Equal hashes are allowed.
|
||||
- No ordering is imposed across the leaves of an index root.
|
||||
- `NameHint` holds the low bytes of the first `min(4, characters)` upcased name characters (§9.2). The remaining
|
||||
bytes are zero.
|
||||
- `HashKey` MUST equal the hash of the key's name (§9.4).
|
||||
- Writers SHOULD keep `li` records at or below 1014 entries and `lf`, `lh` and `ri` records at or below 507 entries,
|
||||
splitting a full leaf under an index root. Readers accept any record that fits into its cell.
|
||||
|
||||
##### 8.6 Value list
|
||||
A raw cell holding `ValueList.Count` `u32` cell indexes of `vk` records. The cell MUST hold at least
|
||||
`4 × Count` payload bytes.
|
||||
|
||||
#### 9. Names
|
||||
##### 9.1 Encodings
|
||||
- **UTF-16LE.** `NameLength` bytes form `NameLength / 2` characters. `NameLength` MUST be even.
|
||||
- **Compressed.** Used when `KEY_COMP_NAME` or `VALUE_COMP_NAME` is set. Each byte is one character, zero-extended to
|
||||
16 bits. `NameLength` may be odd.
|
||||
- Names are not terminated and MUST NOT contain the character `U+0000`.
|
||||
- Names are stored as written. Comparisons are case-insensitive.
|
||||
|
||||
##### 9.2 Upcase table
|
||||
XTHV1 pins its own fixed upcase mapping. It is not the full Unicode mapping:
|
||||
|
||||
- `U+0061`–`U+007A` (`a`–`z`) map to `U+0041`–`U+005A`.
|
||||
- `U+00E0`–`U+00FE`, except `U+00F7`, map to the code point minus `0x20`.
|
||||
- `U+00FF` (`ÿ`) maps to `U+0178` (`Ÿ`).
|
||||
- Every other code point maps to itself.
|
||||
|
||||
Characters outside these ranges therefore compare case-sensitively. For example, `ł` and `Ł` are different
|
||||
characters to XTHV1. Writers and readers MUST use exactly this table.
|
||||
|
||||
##### 9.3 Comparison
|
||||
Two names are compared character by character as upcased 16-bit values. The first difference decides. If one name
|
||||
is a prefix of the other, the shorter one orders first. There is no locale and no collation.
|
||||
|
||||
##### 9.4 Hash
|
||||
```
|
||||
hash = 0
|
||||
for each character c of the name:
|
||||
hash = (37 × hash + upcase(c)) mod 2³²
|
||||
```
|
||||
|
||||
#### 10. Whole-Image Rules
|
||||
A conforming image satisfies the following rules in addition to the per-record rules above. A full traversal from
|
||||
`RootCell` is required to check them.
|
||||
|
||||
1. **Reachability.** Every allocated cell is reached by the traversal from the root key. An unreachable allocated
|
||||
cell makes the image invalid.
|
||||
2. **Single ownership.** Every value list, value node, value data cell, class cell, index record, `db` record, chunk
|
||||
list and chunk is referenced exactly once in the whole image. Security records are the only exception.
|
||||
3. **A proper tree.** Every key node is reached exactly once, and its `Parent` field names the key that reached it.
|
||||
There are no cycles through keys or indexes.
|
||||
4. **Unique names.** No two subkeys of one key, in any of its leaves, have equal names under §9.3. This also applies
|
||||
when their hashes collide. No two values of one key have equal names.
|
||||
5. **Stable references only.** No cell index stored in the image has bit 31 set.
|
||||
6. **Zeroed free space.** Every free cell has a zero payload.
|
||||
|
||||
#### 11. Canonical Form
|
||||
Hashes cover every byte, so writers MUST produce canonical bytes. The rules of §10 and the following ones apply:
|
||||
|
||||
1. Free cell payloads are zero.
|
||||
2. Reserved fields are zero. This covers the superblock reserved areas, map node reserved bytes, unused map entries,
|
||||
the tails of hash fields, bin reserved fields, `sk.Reserved` and descriptor `Sbz1` bytes.
|
||||
3. Stable key nodes store `SubKeyCounts[1] = 0`, `SubKeyLists[1] = HCELL_NIL` and `WorkVar = 0`, regardless of the
|
||||
in-memory values. If a key node spans two logical pages, each page receives the canonical bytes of the part it
|
||||
contains.
|
||||
4. Runtime-only flags (`KEY_VOLATILE`, `KEY_HIVE_EXIT`, `KEY_HIVE_ENTRY`) never appear on disk.
|
||||
5. The padding at the end of big data chunks is zero.
|
||||
6. Raw value data is opaque. It MUST NOT be rewritten, even if it happens to look like a record.
|
||||
7. `HiveId` is 16 opaque bytes, generated once per hive. It MUST NOT be all zero.
|
||||
|
||||
#### 12. Generations, Commits and Recovery
|
||||

|
||||
|
||||
**Writer obligations.** A commit turns the current generation `G` into `G + 1`:
|
||||
|
||||
- The new superblock carries `Generation = G + 1` and is written to the slot that does **not** hold generation `G`.
|
||||
The first commit of a new hive writes slot A and fills slot B with zeros. A writer MUST stop committing rather than
|
||||
wrap the generation counter.
|
||||
- New data pages and map nodes MUST be written to pages that are not reachable from any live generation. Unchanged
|
||||
pages and subtrees are referenced by their existing descriptors, including their original `BirthGeneration`.
|
||||
- The order of durable effects is:
|
||||
1. any growth of the file,
|
||||
2. all data pages and map nodes,
|
||||
3. a durable flush of the data **and** the file size,
|
||||
4. the superblock,
|
||||
5. a second durable flush.
|
||||
|
||||
The superblock MUST NOT become durable before the pages it references. Writers MUST NOT assume that a 4096-byte
|
||||
write is atomic: torn pages are caught by hashes, and torn superblocks by slot validation.
|
||||
- `FilePageLimit` MUST be greater than every PBN reachable from either live generation. It may be larger than
|
||||
necessary.
|
||||
- After a successful commit, `G` becomes the previous generation. Pages reachable only from `G − 1` are free.
|
||||
|
||||
**Recovery.** Readers recover in three stages:
|
||||
|
||||
1. **Slot selection.** Torn and absent superblocks are skipped automatically (§3).
|
||||
2. **Rollback.** If the current image fails any later check (map tree, page hashes, bins, records), a reader MAY roll
|
||||
back to the previous image, provided it passes the complete verification itself. Rollback never modifies content.
|
||||
The price is the loss of the last commit. A writer that continues from a rolled-back generation `P`, after a failed
|
||||
generation `D`, writes its next commit as `Generation = D + 1` into the slot that holds `D`. Pages reachable only
|
||||
from `D` are free, and pages shared with `P` stay protected. Until that commit, every mount performs the same
|
||||
rollback.
|
||||
3. **Repair.** Version 1.0 defines no repair of damaged content. An image that fails both the current and the
|
||||
previous generation cannot be mounted.
|
||||
|
||||
#### 13. Versioning and Features
|
||||
- `Major ≠ 1`, `Minor ≠ 0` or `CellFormat ≠ 1`: the file MUST be refused.
|
||||
- `RequiredFeatures ≠ 0`: the file MUST be refused.
|
||||
- `ReadOnlyFeatures ≠ 0`: the file MAY be opened, but only read-only.
|
||||
- `CompatibleFeatures`: ignored by readers.
|
||||
- Version 1.0 defines no feature bits. Writers MUST store zero in all three masks.
|
||||
- A non-zero byte in a reserved range that readers check is a structural error. Reserved bytes have no
|
||||
forward-compatible meaning in version 1.0.
|
||||
|
||||
#### 14. The Empty Hive
|
||||
The smallest valid hive can be built from this specification alone. It is six pages (24 576 bytes) long:
|
||||
|
||||
| PBN | Content |
|
||||
|-----|---------|
|
||||
| 0 | Superblock, slot A: `Generation = 1`, `LogicalBytes = 4096`, `FilePageLimit = 6`, `RootCell = 32`, `MapRoot → PBN 2` |
|
||||
| 1 | Slot B, all zero |
|
||||
| 2 | Level-2 node: `BaseLpn 0`, `UsedEntries 1`, entry → PBN 3 |
|
||||
| 3 | Level-1 node: `BaseLpn 0`, `UsedEntries 1`, entry → PBN 4 |
|
||||
| 4 | Level-0 node: `BaseLpn 0`, `UsedEntries 1`, entry → PBN 5 |
|
||||
| 5 | Data page, LPN 0: a single bin |
|
||||
|
||||
All `BirthGeneration` values are 1. The bin has `FileOffset = 0`, `Size = 4096` and a zero timestamp. It contains
|
||||
two cells:
|
||||
|
||||
- At offset 32: an allocated cell with `Size = −80` holding the root key. The key has no flags, its `Parent` is 32,
|
||||
its counts and lengths are zero, all cell references are `HCELL_NIL`, and its name is empty.
|
||||
- At offset 112: a free cell with `Size = 3984` and a zero payload.
|
||||
|
||||
### Specification Status
|
||||
The XTHV1 specification presented here is a **draft**. The format is implemented and in active use during
|
||||
development, but registry support in ExectOS is still in progress, and the specification may change before the first
|
||||
release that ships it. Any change to on-disk bytes, hash preimages or test vectors will be published together with an
|
||||
updated version of this document.
|
||||
@@ -0,0 +1,49 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 920 430" font-family="Helvetica, Arial, sans-serif">
|
||||
<rect width="920" height="430" fill="#ffffff"/>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#555"/></marker>
|
||||
</defs>
|
||||
<text x="460" y="30" font-size="18" font-weight="bold" text-anchor="middle" fill="#222">Logical image: bins tiled with cells</text>
|
||||
|
||||
<g font-size="12" text-anchor="middle">
|
||||
<!-- logical image strip -->
|
||||
<text x="40" y="66" text-anchor="start" fill="#555">Logical image</text>
|
||||
<rect x="40" y="76" width="260" height="40" rx="3" fill="#2f6f8f"/><text x="170" y="100" fill="#fff">bin @ 0, Size 4096</text>
|
||||
<rect x="302" y="76" width="520" height="40" rx="3" fill="#2f6f8f"/><text x="562" y="100" fill="#fff">bin @ 4096, Size 8192 (may span non-adjacent PBNs)</text>
|
||||
<rect x="824" y="76" width="56" height="40" rx="3" fill="#ffffff" stroke="#999" stroke-dasharray="5,4"/><text x="852" y="100" fill="#777">…</text>
|
||||
<line x1="40" y1="118" x2="40" y2="150" stroke="#999" stroke-dasharray="3,3"/>
|
||||
<line x1="300" y1="118" x2="880" y2="150" stroke="#999" stroke-dasharray="3,3"/>
|
||||
|
||||
<!-- bin layout -->
|
||||
<rect x="40" y="152" width="150" height="48" rx="3" fill="#2f6f8f"/><text x="115" y="172" fill="#fff" font-weight="bold">Bin header</text><text x="115" y="189" fill="#fff">32 bytes</text>
|
||||
<rect x="192" y="152" width="150" height="48" rx="3" fill="#3c8d5c"/><text x="267" y="172" fill="#fff" font-weight="bold">Allocated cell</text><text x="267" y="189" fill="#fff" font-family="monospace">Size = −80</text>
|
||||
<rect x="344" y="152" width="90" height="48" rx="3" fill="#3c8d5c"/><text x="389" y="172" fill="#fff" font-weight="bold">Allocated</text><text x="389" y="189" fill="#fff" font-family="monospace">−24</text>
|
||||
<rect x="436" y="152" width="130" height="48" rx="3" fill="#d9d9d9"/><text x="501" y="172" fill="#333" font-weight="bold">Free cell</text><text x="501" y="189" fill="#333" font-family="monospace">+48, zeroed</text>
|
||||
<rect x="568" y="152" width="120" height="48" rx="3" fill="#3c8d5c"/><text x="628" y="172" fill="#fff" font-weight="bold">Allocated</text><text x="628" y="189" fill="#fff" font-family="monospace">−136</text>
|
||||
<rect x="690" y="152" width="190" height="48" rx="3" fill="#d9d9d9"/><text x="785" y="172" fill="#333" font-weight="bold">Free tail</text><text x="785" y="189" fill="#333" font-family="monospace">+N, zeroed</text>
|
||||
<g font-family="monospace" fill="#555" font-size="10">
|
||||
<text x="40" y="214" text-anchor="start">+0</text><text x="192" y="214" text-anchor="start">+32</text><text x="880" y="214" text-anchor="end">+Size</text>
|
||||
</g>
|
||||
<text x="460" y="236" fill="#555">Cells start at bin offset 32, are packed in 8-byte multiples and cover every byte of the bin.</text>
|
||||
|
||||
<!-- bin header detail -->
|
||||
<text x="40" y="276" text-anchor="start" font-weight="bold" fill="#222">Bin header</text>
|
||||
<rect x="40" y="286" width="100" height="40" rx="3" fill="#2f6f8f"/><text x="90" y="303" fill="#fff">Signature</text><text x="90" y="318" fill="#fff" font-family="monospace">"hbin"</text>
|
||||
<rect x="142" y="286" width="100" height="40" rx="3" fill="#2f6f8f"/><text x="192" y="310" fill="#fff">FileOffset</text>
|
||||
<rect x="244" y="286" width="100" height="40" rx="3" fill="#2f6f8f"/><text x="294" y="310" fill="#fff">Size</text>
|
||||
<rect x="346" y="286" width="200" height="40" rx="3" fill="#bbbbbb"/><text x="446" y="310" fill="#333">Reserved (2 × u32)</text>
|
||||
<rect x="548" y="286" width="200" height="40" rx="3" fill="#888888"/><text x="648" y="310" fill="#fff">TimeStamp (u64)</text>
|
||||
<rect x="750" y="286" width="100" height="40" rx="3" fill="#bbbbbb"/><text x="800" y="310" fill="#333">Spare</text>
|
||||
<g font-family="monospace" fill="#555" font-size="10">
|
||||
<text x="40" y="340" text-anchor="start">0</text><text x="142" y="340" text-anchor="start">4</text><text x="244" y="340" text-anchor="start">8</text>
|
||||
<text x="346" y="340" text-anchor="start">12</text><text x="548" y="340" text-anchor="start">20</text><text x="750" y="340" text-anchor="start">28</text><text x="850" y="340" text-anchor="end">32</text>
|
||||
</g>
|
||||
|
||||
<!-- cell detail -->
|
||||
<text x="40" y="374" text-anchor="start" font-weight="bold" fill="#222">Cell</text>
|
||||
<rect x="40" y="384" width="100" height="36" rx="3" fill="#3c8d5c"/><text x="90" y="406" fill="#fff" font-family="monospace">i32 Size</text>
|
||||
<rect x="142" y="384" width="440" height="36" rx="3" fill="#6fae86"/><text x="362" y="406" fill="#fff">Payload: |Size| − 4 bytes (record or raw data)</text>
|
||||
<text x="600" y="400" text-anchor="start" fill="#333">Size < 0: allocated, Size > 0: free</text>
|
||||
<text x="600" y="416" text-anchor="start" fill="#333">Cell index = logical offset of Size</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,76 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 920 430" font-family="Helvetica, Arial, sans-serif">
|
||||
<rect width="920" height="430" fill="#ffffff"/>
|
||||
<text x="460" y="30" font-size="18" font-weight="bold" text-anchor="middle" fill="#222">XTHV1 file: 4096-byte pages addressed by PBN</text>
|
||||
|
||||
<!-- page row -->
|
||||
<g font-size="12" text-anchor="middle">
|
||||
<g transform="translate(30,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#4a6fa5"/><text x="40" y="28" fill="#fff" font-weight="bold">Superblock</text><text x="40" y="46" fill="#fff">slot A</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 0</text>
|
||||
</g>
|
||||
<g transform="translate(115,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#4a6fa5"/><text x="40" y="28" fill="#fff" font-weight="bold">Superblock</text><text x="40" y="46" fill="#fff">slot B</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 1</text>
|
||||
</g>
|
||||
<g transform="translate(200,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#3c8d5c"/><text x="40" y="28" fill="#fff" font-weight="bold">Data</text><text x="40" y="46" fill="#fff">LPN 1</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 2</text>
|
||||
</g>
|
||||
<g transform="translate(285,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#7a5ea8"/><text x="40" y="28" fill="#fff" font-weight="bold">Map node</text><text x="40" y="46" fill="#fff">level 2</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 3</text>
|
||||
</g>
|
||||
<g transform="translate(370,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#bbbbbb"/><text x="40" y="28" fill="#333" font-weight="bold">Unused</text><text x="40" y="46" fill="#333">garbage</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 4</text>
|
||||
</g>
|
||||
<g transform="translate(455,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#7a5ea8"/><text x="40" y="28" fill="#fff" font-weight="bold">Map node</text><text x="40" y="46" fill="#fff">level 0</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 5</text>
|
||||
</g>
|
||||
<g transform="translate(540,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#3c8d5c"/><text x="40" y="28" fill="#fff" font-weight="bold">Data</text><text x="40" y="46" fill="#fff">LPN 0</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 6</text>
|
||||
</g>
|
||||
<g transform="translate(625,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#7a5ea8"/><text x="40" y="28" fill="#fff" font-weight="bold">Map node</text><text x="40" y="46" fill="#fff">level 1</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 7</text>
|
||||
</g>
|
||||
<g transform="translate(710,60)">
|
||||
<rect width="80" height="64" rx="4" fill="#3c8d5c"/><text x="40" y="28" fill="#fff" font-weight="bold">Data</text><text x="40" y="46" fill="#fff">LPN 2</text>
|
||||
<text x="40" y="84" fill="#555" font-family="monospace">PBN 8</text>
|
||||
</g>
|
||||
<g transform="translate(795,60)">
|
||||
<rect width="95" height="64" rx="4" fill="#ffffff" stroke="#999" stroke-dasharray="5,4"/><text x="47" y="38" fill="#777">…</text>
|
||||
<text x="47" y="84" fill="#555" font-family="monospace">PBN 9+</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- logical view -->
|
||||
<text x="460" y="190" font-size="15" font-weight="bold" text-anchor="middle" fill="#222">Committed image, as reached from the current superblock</text>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#555"/></marker>
|
||||
</defs>
|
||||
<g font-size="12" text-anchor="middle">
|
||||
<rect x="40" y="215" width="150" height="44" rx="4" fill="#4a6fa5"/><text x="115" y="234" fill="#fff" font-weight="bold">Superblock (slot A)</text><text x="115" y="250" fill="#fff">MapRoot → PBN 3</text>
|
||||
<rect x="250" y="215" width="130" height="44" rx="4" fill="#7a5ea8"/><text x="315" y="234" fill="#fff" font-weight="bold">Level 2 root</text><text x="315" y="250" fill="#fff" font-family="monospace">PBN 3</text>
|
||||
<rect x="440" y="215" width="130" height="44" rx="4" fill="#7a5ea8"/><text x="505" y="234" fill="#fff" font-weight="bold">Level 1</text><text x="505" y="250" fill="#fff" font-family="monospace">PBN 7</text>
|
||||
<rect x="630" y="215" width="130" height="44" rx="4" fill="#7a5ea8"/><text x="695" y="234" fill="#fff" font-weight="bold">Level 0</text><text x="695" y="250" fill="#fff" font-family="monospace">PBN 5</text>
|
||||
<line x1="190" y1="237" x2="248" y2="237" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="380" y1="237" x2="438" y2="237" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="570" y1="237" x2="628" y2="237" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
|
||||
<rect x="580" y="320" width="100" height="44" rx="4" fill="#3c8d5c"/><text x="630" y="339" fill="#fff" font-weight="bold">LPN 0</text><text x="630" y="355" fill="#fff" font-family="monospace">PBN 6</text>
|
||||
<rect x="690" y="320" width="100" height="44" rx="4" fill="#3c8d5c"/><text x="740" y="339" fill="#fff" font-weight="bold">LPN 1</text><text x="740" y="355" fill="#fff" font-family="monospace">PBN 2</text>
|
||||
<rect x="800" y="320" width="100" height="44" rx="4" fill="#3c8d5c"/><text x="850" y="339" fill="#fff" font-weight="bold">LPN 2</text><text x="850" y="355" fill="#fff" font-family="monospace">PBN 8</text>
|
||||
<line x1="695" y1="259" x2="632" y2="318" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="700" y1="259" x2="738" y2="318" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="710" y1="259" x2="845" y2="318" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
|
||||
<text x="40" y="320" text-anchor="start" fill="#333" font-size="13">Every descriptor carries the child's PBN,</text>
|
||||
<text x="40" y="338" text-anchor="start" fill="#333" font-size="13">birth generation and SHA-1 hash.</text>
|
||||
<text x="40" y="364" text-anchor="start" fill="#333" font-size="13">Logical image = LPN 0, 1, 2 … concatenated:</text>
|
||||
<text x="40" y="382" text-anchor="start" fill="#333" font-size="13">the bins and cells of the registry.</text>
|
||||
<text x="40" y="408" text-anchor="start" fill="#777" font-size="12">Pages not reachable from a live superblock are ignored.</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.2 KiB |
@@ -0,0 +1,54 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 920 420" font-family="Helvetica, Arial, sans-serif">
|
||||
<rect width="920" height="420" fill="#ffffff"/>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#555"/></marker>
|
||||
<marker id="b" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#c07a2c"/></marker>
|
||||
</defs>
|
||||
<text x="460" y="30" font-size="18" font-weight="bold" text-anchor="middle" fill="#222">Copy-on-write commit: generation G + 1 shares unchanged pages with G</text>
|
||||
|
||||
<g font-size="12" text-anchor="middle">
|
||||
<!-- superblocks -->
|
||||
<rect x="60" y="60" width="200" height="48" rx="4" fill="#4a6fa5"/>
|
||||
<text x="160" y="80" fill="#fff" font-weight="bold">Slot A: generation G</text><text x="160" y="97" fill="#fff">previous image</text>
|
||||
<rect x="660" y="60" width="200" height="48" rx="4" fill="#4a6fa5" stroke="#c07a2c" stroke-width="3"/>
|
||||
<text x="760" y="80" fill="#fff" font-weight="bold">Slot B: generation G + 1</text><text x="760" y="97" fill="#fff">current image</text>
|
||||
|
||||
<!-- old tree -->
|
||||
<rect x="100" y="140" width="120" height="40" rx="4" fill="#7a5ea8"/><text x="160" y="164" fill="#fff">root (G)</text>
|
||||
<rect x="100" y="210" width="120" height="40" rx="4" fill="#7a5ea8"/><text x="160" y="234" fill="#fff">level 1 (G)</text>
|
||||
<rect x="40" y="280" width="110" height="40" rx="4" fill="#7a5ea8"/><text x="95" y="304" fill="#fff">level 0 #0 (G)</text>
|
||||
<rect x="170" y="280" width="110" height="40" rx="4" fill="#7a5ea8"/><text x="225" y="304" fill="#fff">level 0 #1 (G)</text>
|
||||
<line x1="160" y1="108" x2="160" y2="138" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="160" y1="180" x2="160" y2="208" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="140" y1="250" x2="100" y2="278" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="180" y1="250" x2="220" y2="278" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
|
||||
<!-- new tree -->
|
||||
<rect x="700" y="140" width="120" height="40" rx="4" fill="#7a5ea8" stroke="#c07a2c" stroke-width="3"/><text x="760" y="164" fill="#fff">root (G+1)</text>
|
||||
<rect x="700" y="210" width="120" height="40" rx="4" fill="#7a5ea8" stroke="#c07a2c" stroke-width="3"/><text x="760" y="234" fill="#fff">level 1 (G+1)</text>
|
||||
<rect x="770" y="280" width="120" height="40" rx="4" fill="#7a5ea8" stroke="#c07a2c" stroke-width="3"/><text x="830" y="304" fill="#fff">level 0 #1 (G+1)</text>
|
||||
<line x1="760" y1="108" x2="760" y2="138" stroke="#c07a2c" stroke-width="1.8" marker-end="url(#b)"/>
|
||||
<line x1="760" y1="180" x2="760" y2="208" stroke="#c07a2c" stroke-width="1.8" marker-end="url(#b)"/>
|
||||
<line x1="790" y1="250" x2="825" y2="278" stroke="#c07a2c" stroke-width="1.8" marker-end="url(#b)"/>
|
||||
<!-- shared: new L1 points to old L0 #0 -->
|
||||
<path d="M 700 236 C 450 250, 250 262, 125 278" fill="none" stroke="#c07a2c" stroke-width="1.8" stroke-dasharray="6,4" marker-end="url(#b)"/>
|
||||
<text x="430" y="228" fill="#c07a2c">unchanged subtree is shared by reference</text>
|
||||
|
||||
<!-- data pages -->
|
||||
<g font-family="monospace">
|
||||
<rect x="20" y="360" width="70" height="36" rx="4" fill="#3c8d5c"/><text x="55" y="382" fill="#fff">LPN 0</text>
|
||||
<rect x="100" y="360" width="70" height="36" rx="4" fill="#3c8d5c"/><text x="135" y="382" fill="#fff">LPN 1</text>
|
||||
<rect x="190" y="360" width="70" height="36" rx="4" fill="#3c8d5c"/><text x="225" y="382" fill="#fff">LPN 84</text>
|
||||
<rect x="800" y="360" width="90" height="36" rx="4" fill="#3c8d5c" stroke="#c07a2c" stroke-width="3"/><text x="845" y="382" fill="#fff">LPN 84'</text>
|
||||
</g>
|
||||
<line x1="80" y1="320" x2="58" y2="358" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="110" y1="320" x2="132" y2="358" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="225" y1="320" x2="225" y2="358" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="840" y1="320" x2="845" y2="358" stroke="#c07a2c" stroke-width="1.8" marker-end="url(#b)"/>
|
||||
|
||||
<text x="420" y="330" fill="#333">One modified page (LPN 84) costs: the new data page,</text>
|
||||
<text x="420" y="348" fill="#333">one new node per level and one superblock.</text>
|
||||
<text x="420" y="372" fill="#333">Nothing reachable from generation G is overwritten,</text>
|
||||
<text x="420" y="390" fill="#333">so a crash at any point leaves G or G + 1 intact.</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,69 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 920 560" font-family="Helvetica, Arial, sans-serif">
|
||||
<rect width="920" height="560" fill="#ffffff"/>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#555"/></marker>
|
||||
</defs>
|
||||
<text x="460" y="30" font-size="18" font-weight="bold" text-anchor="middle" fill="#222">Map tree: three fixed levels, 84 descriptors per node</text>
|
||||
|
||||
<g font-size="12" text-anchor="middle">
|
||||
<!-- level 2 -->
|
||||
<rect x="370" y="55" width="180" height="46" rx="4" fill="#7a5ea8"/>
|
||||
<text x="460" y="74" fill="#fff" font-weight="bold">Level 2 (root)</text>
|
||||
<text x="460" y="91" fill="#fff" font-family="monospace">index = LPN / 7056</text>
|
||||
<!-- level 1 -->
|
||||
<rect x="130" y="150" width="180" height="46" rx="4" fill="#7a5ea8"/>
|
||||
<text x="220" y="169" fill="#fff" font-weight="bold">Level 1, entry 0</text>
|
||||
<text x="220" y="186" fill="#fff" font-family="monospace">LPN 0 … 7055</text>
|
||||
<rect x="610" y="150" width="180" height="46" rx="4" fill="#7a5ea8"/>
|
||||
<text x="700" y="169" fill="#fff" font-weight="bold">Level 1, entry k</text>
|
||||
<text x="700" y="186" fill="#fff" font-family="monospace">LPN k·7056 …</text>
|
||||
<text x="460" y="178" fill="#777" font-size="16">…</text>
|
||||
<line x1="420" y1="101" x2="240" y2="148" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="500" y1="101" x2="680" y2="148" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<text x="600" y="128" fill="#555" font-family="monospace" text-anchor="start">index = (LPN % 7056) / 84</text>
|
||||
<!-- level 0 -->
|
||||
<rect x="40" y="245" width="150" height="46" rx="4" fill="#7a5ea8"/>
|
||||
<text x="115" y="264" fill="#fff" font-weight="bold">Level 0, entry 0</text>
|
||||
<text x="115" y="281" fill="#fff" font-family="monospace">LPN 0 … 83</text>
|
||||
<rect x="250" y="245" width="150" height="46" rx="4" fill="#7a5ea8"/>
|
||||
<text x="325" y="264" fill="#fff" font-weight="bold">Level 0, entry 1</text>
|
||||
<text x="325" y="281" fill="#fff" font-family="monospace">LPN 84 … 167</text>
|
||||
<line x1="200" y1="196" x2="125" y2="243" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="240" y1="196" x2="315" y2="243" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<text x="440" y="273" fill="#555" font-family="monospace" text-anchor="start">index = LPN % 84</text>
|
||||
<!-- data -->
|
||||
<rect x="20" y="335" width="60" height="40" rx="4" fill="#3c8d5c"/><text x="50" y="359" fill="#fff" font-family="monospace">LPN 0</text>
|
||||
<rect x="86" y="335" width="60" height="40" rx="4" fill="#3c8d5c"/><text x="116" y="359" fill="#fff" font-family="monospace">LPN 1</text>
|
||||
<text x="164" y="360" fill="#777" font-size="16">…</text>
|
||||
<rect x="182" y="335" width="60" height="40" rx="4" fill="#3c8d5c"/><text x="212" y="359" fill="#fff" font-family="monospace">LPN 83</text>
|
||||
<line x1="90" y1="291" x2="52" y2="333" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="115" y1="291" x2="116" y2="333" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<line x1="140" y1="291" x2="208" y2="333" stroke="#555" stroke-width="1.6" marker-end="url(#a)"/>
|
||||
<text x="620" y="300" fill="#333" text-anchor="start">Capacity: 84³ = 592 704 pages</text>
|
||||
<text x="620" y="318" fill="#333" text-anchor="start">Largest image: 524 287 pages</text>
|
||||
<text x="620" y="336" fill="#333" text-anchor="start">Depth never depends on the data.</text>
|
||||
</g>
|
||||
|
||||
<!-- node page layout -->
|
||||
<text x="460" y="420" font-size="15" font-weight="bold" text-anchor="middle" fill="#222">Map node page (4096 bytes) and descriptor (48 bytes)</text>
|
||||
<g font-size="11" text-anchor="middle">
|
||||
<rect x="40" y="440" width="64" height="40" rx="3" fill="#7a5ea8"/><text x="72" y="464" fill="#fff">Magic</text>
|
||||
<rect x="106" y="440" width="96" height="40" rx="3" fill="#c07a2c"/><text x="154" y="464" fill="#fff">HiveId</text>
|
||||
<rect x="204" y="440" width="72" height="40" rx="3" fill="#7a5ea8"/><text x="240" y="458" fill="#fff">Birth</text><text x="240" y="472" fill="#fff">Generation</text>
|
||||
<rect x="278" y="440" width="64" height="40" rx="3" fill="#7a5ea8"/><text x="310" y="464" fill="#fff">BaseLpn</text>
|
||||
<rect x="344" y="440" width="40" height="40" rx="3" fill="#7a5ea8"/><text x="364" y="464" fill="#fff">Level</text>
|
||||
<rect x="386" y="440" width="48" height="40" rx="3" fill="#7a5ea8"/><text x="410" y="458" fill="#fff">Used</text><text x="410" y="472" fill="#fff">Entries</text>
|
||||
<rect x="436" y="440" width="60" height="40" rx="3" fill="#bbbbbb"/><text x="466" y="464" fill="#333">reserved</text>
|
||||
<rect x="498" y="440" width="382" height="40" rx="3" fill="#3c8d5c"/><text x="689" y="464" fill="#fff">Entries[84] — 84 × 48-byte descriptors</text>
|
||||
<g font-family="monospace" fill="#555" font-size="10">
|
||||
<text x="40" y="495" text-anchor="start">0</text><text x="106" y="495" text-anchor="start">8</text><text x="204" y="495" text-anchor="start">24</text>
|
||||
<text x="278" y="495" text-anchor="start">32</text><text x="344" y="495" text-anchor="start">40</text><text x="386" y="495" text-anchor="start">44</text>
|
||||
<text x="436" y="495" text-anchor="start">48</text><text x="498" y="495" text-anchor="start">64</text><text x="880" y="495" text-anchor="end">4096</text>
|
||||
</g>
|
||||
<rect x="498" y="510" width="90" height="36" rx="3" fill="#3c8d5c"/><text x="543" y="532" fill="#fff">PBN (u64)</text>
|
||||
<rect x="590" y="510" width="120" height="36" rx="3" fill="#3c8d5c"/><text x="650" y="532" fill="#fff">BirthGeneration (u64)</text>
|
||||
<rect x="712" y="510" width="168" height="36" rx="3" fill="#a5484a"/><text x="796" y="532" fill="#fff">Hash: SHA-1 + 12 zero</text>
|
||||
<line x1="498" y1="482" x2="498" y2="508" stroke="#999" stroke-dasharray="3,3"/>
|
||||
<line x1="560" y1="482" x2="880" y2="508" stroke="#999" stroke-dasharray="3,3"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.9 KiB |
@@ -0,0 +1,100 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 824 644" font-family="Helvetica, Arial, sans-serif">
|
||||
<rect width="824" height="644" fill="#ffffff"/>
|
||||
<text x="412.0" y="30" font-size="18" font-weight="bold" text-anchor="middle" fill="#222">XTHV1 superblock (4096 bytes, slot A at PBN 0, slot B at PBN 1)</text>
|
||||
<text x="112.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+0</text>
|
||||
<text x="156.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+1</text>
|
||||
<text x="200.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+2</text>
|
||||
<text x="244.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+3</text>
|
||||
<text x="288.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+4</text>
|
||||
<text x="332.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+5</text>
|
||||
<text x="376.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+6</text>
|
||||
<text x="420.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+7</text>
|
||||
<text x="464.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+8</text>
|
||||
<text x="508.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+9</text>
|
||||
<text x="552.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+A</text>
|
||||
<text x="596.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+B</text>
|
||||
<text x="640.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+C</text>
|
||||
<text x="684.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+D</text>
|
||||
<text x="728.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+E</text>
|
||||
<text x="772.0" y="60" font-size="11" font-family="monospace" text-anchor="middle" fill="#777">+F</text>
|
||||
<text x="80" y="91" font-size="12" font-family="monospace" text-anchor="end" fill="#555">0</text>
|
||||
<text x="80" y="125" font-size="12" font-family="monospace" text-anchor="end" fill="#555">16</text>
|
||||
<text x="80" y="159" font-size="12" font-family="monospace" text-anchor="end" fill="#555">32</text>
|
||||
<text x="80" y="193" font-size="12" font-family="monospace" text-anchor="end" fill="#555">48</text>
|
||||
<text x="80" y="227" font-size="12" font-family="monospace" text-anchor="end" fill="#555">64</text>
|
||||
<text x="80" y="261" font-size="12" font-family="monospace" text-anchor="end" fill="#555">80</text>
|
||||
<text x="80" y="295" font-size="12" font-family="monospace" text-anchor="end" fill="#555">96</text>
|
||||
<text x="80" y="329" font-size="12" font-family="monospace" text-anchor="end" fill="#555">112</text>
|
||||
<text x="80" y="363" font-size="12" font-family="monospace" text-anchor="end" fill="#555">128</text>
|
||||
<text x="80" y="397" font-size="12" font-family="monospace" text-anchor="end" fill="#555">144</text>
|
||||
<text x="80" y="431" font-size="12" font-family="monospace" text-anchor="end" fill="#555">160</text>
|
||||
<rect x="91" y="71" width="350" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="266.0" y="91.0" font-size="12" text-anchor="middle" fill="#fff">Magic "XTHV1\r\n\x1a"</text>
|
||||
<rect x="443" y="71" width="86" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="486.0" y="91.0" font-size="12" text-anchor="middle" fill="#fff">Major</text>
|
||||
<rect x="531" y="71" width="86" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="574.0" y="91.0" font-size="12" text-anchor="middle" fill="#fff">Minor</text>
|
||||
<rect x="619" y="71" width="174" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="706.0" y="91.0" font-size="12" text-anchor="middle" fill="#fff">HeaderBytes</text>
|
||||
<rect x="91" y="105" width="174" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="178.0" y="125.0" font-size="12" text-anchor="middle" fill="#fff">PageBytes</text>
|
||||
<rect x="267" y="105" width="174" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="354.0" y="125.0" font-size="12" text-anchor="middle" fill="#fff">SlotId</text>
|
||||
<rect x="443" y="105" width="350" height="32" rx="3" fill="#c07a2c"/>
|
||||
<text x="618.0" y="125.0" font-size="12" text-anchor="middle" fill="#fff">HiveId</text>
|
||||
<rect x="91" y="139" width="350" height="32" rx="3" fill="#c07a2c"/>
|
||||
<text x="266.0" y="159.0" font-size="12" text-anchor="middle" fill="#fff">HiveId (cont.)</text>
|
||||
<rect x="443" y="139" width="350" height="32" rx="3" fill="#c07a2c"/>
|
||||
<text x="618.0" y="159.0" font-size="12" text-anchor="middle" fill="#fff">Generation</text>
|
||||
<rect x="91" y="173" width="350" height="32" rx="3" fill="#c07a2c"/>
|
||||
<text x="266.0" y="193.0" font-size="12" text-anchor="middle" fill="#fff">LogicalBytes</text>
|
||||
<rect x="443" y="173" width="350" height="32" rx="3" fill="#c07a2c"/>
|
||||
<text x="618.0" y="193.0" font-size="12" text-anchor="middle" fill="#fff">FilePageLimit</text>
|
||||
<rect x="91" y="207" width="174" height="32" rx="3" fill="#c07a2c"/>
|
||||
<text x="178.0" y="227.0" font-size="12" text-anchor="middle" fill="#fff">RootCell</text>
|
||||
<rect x="267" y="207" width="174" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="354.0" y="227.0" font-size="12" text-anchor="middle" fill="#fff">CellFormat</text>
|
||||
<rect x="443" y="207" width="350" height="32" rx="3" fill="#7a5ea8"/>
|
||||
<text x="618.0" y="227.0" font-size="12" text-anchor="middle" fill="#fff">MapRoot.PBN</text>
|
||||
<rect x="91" y="241" width="350" height="32" rx="3" fill="#7a5ea8"/>
|
||||
<text x="266.0" y="261.0" font-size="12" text-anchor="middle" fill="#fff">MapRoot.BirthGeneration</text>
|
||||
<rect x="443" y="241" width="350" height="32" rx="3" fill="#7a5ea8"/>
|
||||
<text x="618.0" y="261.0" font-size="12" text-anchor="middle" fill="#fff">MapRoot.Hash (SHA-1 + 12 zero bytes)</text>
|
||||
<rect x="91" y="275" width="702" height="32" rx="3" fill="#7a5ea8"/>
|
||||
<text x="442.0" y="295.0" font-size="12" text-anchor="middle" fill="#fff">MapRoot.Hash (cont.)</text>
|
||||
<rect x="91" y="309" width="350" height="32" rx="3" fill="#7a5ea8"/>
|
||||
<text x="266.0" y="329.0" font-size="12" text-anchor="middle" fill="#fff">MapRoot.Hash (cont.)</text>
|
||||
<rect x="443" y="309" width="350" height="32" rx="3" fill="#888888"/>
|
||||
<text x="618.0" y="329.0" font-size="12" text-anchor="middle" fill="#fff">CommitTime</text>
|
||||
<rect x="91" y="343" width="350" height="32" rx="3" fill="#3c8d5c"/>
|
||||
<text x="266.0" y="363.0" font-size="12" text-anchor="middle" fill="#fff">RequiredFeatures</text>
|
||||
<rect x="443" y="343" width="350" height="32" rx="3" fill="#3c8d5c"/>
|
||||
<text x="618.0" y="363.0" font-size="12" text-anchor="middle" fill="#fff">ReadOnlyFeatures</text>
|
||||
<rect x="91" y="377" width="350" height="32" rx="3" fill="#3c8d5c"/>
|
||||
<text x="266.0" y="397.0" font-size="12" text-anchor="middle" fill="#fff">CompatibleFeatures</text>
|
||||
<rect x="443" y="377" width="350" height="32" rx="3" fill="#888888"/>
|
||||
<text x="618.0" y="397.0" font-size="12" text-anchor="middle" fill="#fff">WriterId</text>
|
||||
<rect x="91" y="411" width="350" height="32" rx="3" fill="#888888"/>
|
||||
<text x="266.0" y="431.0" font-size="12" text-anchor="middle" fill="#fff">WriterId (cont.)</text>
|
||||
<rect x="443" y="411" width="174" height="32" rx="3" fill="#4a6fa5"/>
|
||||
<text x="530.0" y="431.0" font-size="12" text-anchor="middle" fill="#fff">HashAlgorithm</text>
|
||||
<rect x="619" y="411" width="174" height="32" rx="3" fill="#bbbbbb"/>
|
||||
<text x="706.0" y="431.0" font-size="12" text-anchor="middle" fill="#333">Reserved</text>
|
||||
<text x="80" y="479" font-size="12" font-family="monospace" text-anchor="end" fill="#555">176</text>
|
||||
<rect x="91" y="459" width="702" height="51.0" rx="3" fill="#e6e6e6" stroke="#bbb" stroke-dasharray="5,4"/>
|
||||
<text x="442" y="488.5" font-size="12" text-anchor="middle" fill="#333">Reserved, 3888 bytes, all zero (part of the hash preimage)</text>
|
||||
<text x="80" y="544.0" font-size="12" font-family="monospace" text-anchor="end" fill="#555">4064</text>
|
||||
<rect x="91" y="524.0" width="702" height="32" rx="3" fill="#a5484a"/>
|
||||
<text x="442" y="544.0" font-size="12" text-anchor="middle" fill="#fff">SuperblockHash: SHA-1 digest (bytes 0..19)</text>
|
||||
<text x="80" y="578.0" font-size="12" font-family="monospace" text-anchor="end" fill="#555">4080</text>
|
||||
<rect x="91" y="558.0" width="174" height="32" rx="3" fill="#a5484a"/>
|
||||
<text x="178" y="578.0" font-size="11" text-anchor="middle" fill="#fff">digest (cont.)</text>
|
||||
<rect x="267" y="558.0" width="526" height="32" rx="3" fill="#bbbbbb"/>
|
||||
<text x="530" y="578.0" font-size="12" text-anchor="middle" fill="#333">12 bytes, MUST be zero</text>
|
||||
<rect x="90" y="615.0" width="14" height="14" rx="2" fill="#4a6fa5"/><text x="110" y="627.0" font-size="12" fill="#333">format identification</text>
|
||||
<rect x="250.20000000000002" y="615.0" width="14" height="14" rx="2" fill="#c07a2c"/><text x="270.20000000000005" y="627.0" font-size="12" fill="#333">image description</text>
|
||||
<rect x="385.6" y="615.0" width="14" height="14" rx="2" fill="#7a5ea8"/><text x="405.6" y="627.0" font-size="12" fill="#333">map root descriptor</text>
|
||||
<rect x="533.4000000000001" y="615.0" width="14" height="14" rx="2" fill="#3c8d5c"/><text x="553.4000000000001" y="627.0" font-size="12" fill="#333">feature masks</text>
|
||||
<rect x="644.0000000000001" y="615.0" width="14" height="14" rx="2" fill="#888888"/><text x="664.0000000000001" y="627.0" font-size="12" fill="#333">diagnostic</text>
|
||||
<rect x="736.0000000000001" y="615.0" width="14" height="14" rx="2" fill="#a5484a"/><text x="756.0000000000001" y="627.0" font-size="12" fill="#333">integrity</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
Reference in New Issue
Block a user