Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Samson 1b47de5058
allocate AP kernel/IST stacks at bring-up, not statically
Hoist max_cpus into danos (root.zig), raise it to 128, and stop reserving a static [max_cpus][16 KiB] IST array. Only the BSP's IST stack is static (needed before the allocator); each AP's is heap-allocated when it comes online. Shrinks the kernel from ~1.1 MB to ~139 KiB in ReleaseSmall.
2026-07-08 16:04:18 +01:00
Daniel Samson 26ac97df31
test fault-on-AP and affinity; report the faulting core
fault-ap-df pins a #DF to an AP (its own IST must catch it); affinity checks a pinned task never migrates. onException now names the core, so an AP fault is attributed and shown contained. Both teeth-checked.
2026-07-08 14:45:28 +01:00
Daniel Samson debe815a5c
keep the AP trampoline inert between wakes, and retry failed cores
Arm the low frame (copy blob, make executable) only while a core climbs, then zero it and restore RW+NX; the frame stays reserved so cores can be re-woken. startSecondary is one re-runnable attempt; boot retries a non-responding core 3x. Validated the retry path by forcing a first-attempt failure.
2026-07-08 13:32:34 +01:00
Daniel Samson 43afe6bf2e
schedule tasks across all cores
Per-core GDT/TSS and AP scheduler entry; fix AP SSE + single_threaded.
2026-07-08 12:35:30 +01:00
Daniel Samson ed7f542006
wake application processors to long mode
INIT-SIPI-SIPI plus a self-relocating real-mode trampoline.
2026-07-08 12:35:30 +01:00
Daniel Samson cf7c6df41c
enumerate usable CPU cores from the MADT
Keep each Local APIC's id and expose platform.cpus().
2026-07-08 12:35:30 +01:00
Daniel Samson a6de418e42 documenting smp and scheduling to research 2026-07-03 21:24:44 +01:00