File size: 3,011 Bytes
9425aed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* ════════════════════════════════════════════════════════════════

 * start.S β€” SOVEREIGN ENTRY POINT

 * Zero runtime. No libc. No crt0. Pure metal.

 * Targets: ARM64 (primary) | x86_64 (secondary)

 * ════════════════════════════════════════════════════════════════ */

/* ── ARM64 ────────────────────────────────────────────────────── */
#if defined(__aarch64__)

.section .text
.global _start
.type   _start, %function



_start:
    /* Stack alignment: AArch64 ABI requires 16-byte alignment */
    mov     x29, sp
    bic     sp,  x29, #0xF

    /* Call Fortran entry: sov_apl_evolve_sequence

     * Caller sets up X0..X7 with H, rho, n, steps, dt, sk, pk, receipts

     * before jumping here (Lean FFI trampoline handles this) */
    bl      sov_apl_evolve_sequence

    /* Sovereign halt β€” we own the metal, no exit syscall */
    hlt     #0



.L_fault:
    /* Write fault code to known address, halt */
    ldr     x1, =0x0000DEAD0000
    str     x0, [x1]
    hlt     #1

.size _start, . - _start


/* ── x86_64 ───────────────────────────────────────────────────── */
#elif defined(__x86_64__)

.section .text
.global _start
.type   _start, @function



_start:
    /* Stack alignment: System V AMD64 ABI requires 16-byte at call */
    andq    $-16, %rsp

    /* Call Fortran entry */
    call    sov_apl_evolve_sequence

    /* Sovereign halt */
    hlt



.L_fault:
    movq    $0x0000DEAD0000, %rsi
    movq    %rax, (%rsi)
    hlt

.size _start, . - _start


/* ── NVIDIA PTX (stub β€” real entry via nvcc driver) ───────────── */
#elif defined(__nvptx__)
/* PTX does not use _start; kernel launched via cuLaunchKernel.

 * Entry point is sov_fused_uru declared in sov_pipeline.mlir.

 * This file intentionally empty for PTX target. */
#endif


/* ── .note.sov section: Blake3 hash + Ed25519 sig baked at build ─

 * Populated by build_monster.sh after linking.

 * Format: [magic:8]["BIFROST\0"] [hash:32] [sig:64]

 * ─────────────────────────────────────────────────────────────── */
.section .note.sov, "a", %note
.align 4
.long   8                    /* namesz */
.long   96                   /* descsz: 32 + 64 */
.long   1                    /* type: NT_SOV_BIFROST */
.ascii  "BIFROST\0"          /* name */
.fill   96, 1, 0             /* desc: filled by build_monster.sh */