1. OVERVIEW

This document defines runtime rules, execution guarantees, lifecycle behavior, and system-level constraints for SDI drivers.

It standardizes how drivers execute once loaded, including calling conventions, stack usage, concurrency assumptions, memory ownership, and failure behavior.

This document does not define new interfaces. It defines rules governing existing SDI components.

BCP 14 (RFC 2119 and RFC 8174) applies.


  1. EXECUTION MODEL

2.1 Calling Convention

All SDI driver functions and kernel-provided function pointers in sdi_ops MUST use the spec mandated platform ABI.


2.2 Permitted architecture specific ABIs

Not all architectures are listed. The below table defines what ABI MUST be used on each architecture listed (if the architecture is not listed, MUST be considered undefined for a future SDI specification to define.)

ArchitectureABI
x86_64System V AMD64 ABI
x86System V i386 ABI
AArch64AAPCS64
AArch32AAPCS (ARM EABI, 32-bit)
RISC-V32RISC-V psABI (ILP32)
RISC-V64RISC-V psABI (LP64)

2.2.1 On Architectures without a defined standard
For architectures that do not have a defined ABI, anyone can send the BDIO group a draft of an ABI. The proposed ABI MUST be implemented in at least one reference toolchain that can compile C compatible with a C99 freestanding environment. The proposal MUST come with a valid compiled (ELF) version of the example driver from the reference drivers.

Said drafts MUST also provide a new arch/{architecture} for rKern which supports the architecture and is in compliance with the ABI draft.


2.3 Stack Ownership


2.4 Execution Context


  1. CONCURRENCY MODEL

3.1 Driver State Safety


  1. DRIVER LIFECYCLE

4.1 Lifecycle States

A driver exists in the following conceptual states:


4.2 Initialization Behavior

If initialization fails:


4.3 Reinitialization


  1. MEMORY MODEL

5.1 Ownership Rules


5.2 Mapping Rules


5.3 Kernel Memory Safety


5.4 Memory allocated via kernel functions

Any function that returns a pointer within sdi_ops the pointer MAY be freed by the driver at any time.


5.4.1 Memory from kernel_ver

The pointer from kernel_ver MAY NOT be freed.


  1. ERROR HANDLING

6.1 Function Failure


6.2 Fault Handling


  1. INTERRUPT CONTEXT

  1. PORTABILITY RULES