FROZEN V11 ARCHIVE — historical DByteOS/native documentation. Read current v12.2.1 release notes.
RELEASE LINE13.2 STABLE13.1 PREDECESSOR13.0 PREVIOUS12.4 NATIVE MIRARCHIVE

HISTORICAL · FROZEN EVIDENCE

DBYTE32 ABI + ELF contract

This page consolidates the contracts that were split between v11.0 DBYTE_NATIVE.md, v11.1 DBYTE_NATIVE_LINK.md, and later interrupt/entry metadata.

Compilation path§

.dby
 -> shared lexer / parser / AST
 -> systems type checking
 -> typed native IR
 -> bounded i686 encoder
 -> ELF32 ET_REL object
 -> DByte in-process static linker
 -> ELF32 ET_EXEC
 -> Multiboot entry

DBYTE32 calling convention§

PropertyContract
Argument evaluationleft to right
Argument slotone 32-bit stack word per scalar argument
Parameter location[EBP + 8 + 4 * (N - 1 - i)] before copy to local slot
Stack cleanupcaller removes argument words after call
Scalar resultEAX
Caller-savedEAX ECX EDX
Preserved when usedEBX ESI EDI EBP
Frame pointerEBP
Return invariantgenerated return restores ESP and EBP exactly

Systems type layout§

TypeSizeAlignmentSignedness
bool11no
i8 / u811type-dependent
i16 / u1622type-dependent
i32 / u3244type-dependent
usize44no
ptr[T]44no
  • Arithmetic wraps at the declared integer width.
  • Mixed-width arithmetic and implicit narrowing are rejected.
  • Explicit as casts are required.
  • Only usize may convert explicitly to or from a pointer.
  • array[T,N] uses declaration-order elements and T's alignment.
  • Literal out-of-range array indices are compile errors; dynamic indexing in the low-level profile is intentionally unchecked at runtime.
  • Normal structs use natural alignment plus tail padding. packed struct has alignment one and no inserted padding.

ET_REL object contract§

CLASS        ELFCLASS32
ENDIAN       LITTLE
TYPE         ET_REL
MACHINE      EM_386
SECTIONS     .text .rodata .data .bss .symtab .strtab .shstrtab .rel.*
RELOCS       R_386_PC32  cross-object relative calls
             R_386_32    absolute addresses
ADDENDS      stored in relocated bytes
ORDERING     canonical / source-independent

The linker validates object class, machine, sections, string/symbol tables, relocation indices, relocation offsets, arithmetic and final layout bounds before output is replaced.

Symbol model§

  • import "relative.dby" as name is compile-time, relative to the importing file, filesystem-only, cycle checked and deterministically ordered.
  • pub fn, pub static and pub const are visible across modules.
  • Unqualified definitions remain object-local.
  • Duplicate strong exports and unresolved final symbols are link errors.
  • Weak symbols, dynamic symbols, network package lookup and runtime module loading are outside the profile.

Executable contract§

TYPE         ELF32 ET_EXEC / EM_386
LOAD BASE    1 MiB foundation contract
BOOT         Multiboot v1
START        linker-synthesized _start
STACK        bounded bootstrap stack
RETURN       cli / hlt permanent loop
DYNAMIC      none
LIBC         none
DLL IMPORTS  none

Interrupt entry ABI§

interrupt(no_error_code) fn handler(frame: ptr[InterruptFrame])
interrupt(error_code)    fn handler(frame: ptr[InterruptFrame], error_code: u32)

The compiler-generated entry stub saves interrupted general registers, normalizes the CPL0 frame, enters a DBYTE32 body, restores registers, performs class-specific stack cleanup and emits iretd. Handler address-taking is through interrupt_address(vector, handler), with compile-time vector/class checks.

Scheduler resume image§

+00 EDI
+04 ESI
+08 EBP
+0C ignored PUSHAD ESP
+10 EBX
+14 EDX
+18 ECX
+1C EAX
+20 EIP
+24 CS
+28 EFLAGS

v11.5 reuses the CPU/PUSHAD image directly rather than introducing a second register-context structure. Later blocking and IRQ I/O milestones preserve this context ABI.

Output replacement law§

Compilation/link failures use a temporary sibling and leave an existing output unchanged. --dump-ir, --dump-machine-code and post-emission disassembly are inspection surfaces; they are not code generators in the native pipeline.