Files
RedBear-OS/local
vasilito 5897eefc3a submodule: bump kernel to 1be659b (Phase II.X S3 resume trampoline)
The local/sources/kernel fork at 1be659b adds the
hardware-agnostic S3 resume trampoline (Phase II.X):

* Saves the CPU state (general-purpose registers,
  segment registers, RFLAGS, RSP, RIP, CR3) to a static
  S3State struct in `enter_s3()`.
* Adds a 64-bit `naked_asm!` trampoline
  (`s3_resume::s3_trampoline`) that the platform
  firmware jumps to on S3 wake. The trampoline:
  - Verifies the magic value (0x123456789abcdef0) in
    S3_STATE.saved_magic (a la Linux's
    `arch/x86/kernel/acpi/wakeup_64.S`)
  - Restores ds/es/fs/gs/ss to __KERNEL_DS
  - Restores CR3 (page table base)
  - Restores RSP, RFLAGS
  - Restores 13 general-purpose registers
  - Sets the RESUMING_FROM_S3 flag
  - Pushes saved RIP onto the stack and uses `ret`
* Exposes `s3_resume_address()` that acpid writes
  to FACS.waking_vector.
* Exposes `s3_state_valid()` that the kernel checks
  during boot to determine if this is a cold boot
  or a resume from S3.

Hardware-agnostic: works on any x86_64 system with
standard ACPI S3 support (Dell, HP, Lenovo, LG Gram 14).
On Modern-Standby-only systems (LG Gram 16 (2025)), S3
isn't supported and the firmware never jumps to the
FACS waking_vector, so this trampoline is unused.

Build: redbear-mini.iso (512 MB) builds successfully.
The S3 resume path is verified to compile and be
present in the ISO. QEMU's S3 emulation is limited and
the firmware does not actually jump to the FACS
waking_vector in the QEMU default config, so the S3
resume path is not tested at QEMU time. The acpid <-> kernel
wiring via FACS.waking_vector is the next step (separate
Phase II.X.W commit).
2026-07-01 15:57:14 +03:00
..