Skip to content

AHCI Refactor and Silent Initialization Logic#3

Open
rtech-technologies wants to merge 1 commit into
sovereign-core-expansion-2313558312167675719from
ahci-refactor-and-silent-init-14052438335677510432
Open

AHCI Refactor and Silent Initialization Logic#3
rtech-technologies wants to merge 1 commit into
sovereign-core-expansion-2313558312167675719from
ahci-refactor-and-silent-init-14052438335677510432

Conversation

@rtech-technologies

Copy link
Copy Markdown
Owner

This PR implements a major refactor of the AHCI driver and system initialization logic for the OSx2 Sovereign kernel.

Key changes include:

  1. Hardware Abstraction: Created include/ahci_hw.h to centralize AHCI structure definitions, reducing code duplication in ahci.c and satapi.c.
  2. Silent AHCI: Replaced VGA console output in the AHCI driver with serial-only logging to reduce boot noise on the main display.
  3. Optimized Initialization: Implemented a "skip-if-live" optimization that bypasses the destructive port reset sequence if a SATA link is already established (e.g., by the BIOS). This is paired with an explicit engine start to ensure the controller uses the kernel's memory buffers.
  4. Mechanical Truth Safety: Improved AHCI command handshakes by clearing the Interrupt Status register before command issuance and monitoring the Task File Error Status (TFES) bit during polling.
  5. Boot Ritual Refinement: Moved the automated execution of BOOT.RSL from the kernel core to the RSL Shell. This ensures the filesystem environment is fully prepared and provides a fallback to the ramdisk if the primary boot volume is missing.
  6. Responsiveness: Added strategic sys_yield() calls in long-running I/O and drawing functions to ensure the cooperative scheduler remains fluid.
  7. Code Quality: Cleaned up various compiler warnings regarding unused variables and implicit declarations.

PR created automatically by Jules for task 14052438335677510432 started by @rtech-technologies

…ialization

- Move mirrored AHCI HBA structures into a shared `include/ahci_hw.h` header.
- Update `kernel/libs/storage/ahci.c` to use serial-only logging, silencing VGA output.
- Optimize AHCI initialization to skip `ahci_force_port_reset` on 'live' ports (SSTS DET=0x03), invoking `ahci_port_start` instead to ensure engine readiness.
- Enhance AHCI I/O with explicit `PxIS` clearing and `TFES` (bit 30) monitoring for fatal hardware errors.
- Relocate Sovereign boot script delegation from the kernel to `shell_main` in `programs/shell.c`, adding a fallback mechanism for `INITRD:/BOOT.RSL`.
- Inject `sys_yield()` into AHCI read/write and RRIF drawing routines to maintain system responsiveness in the Clock-Synchronous Cooperative model.
- Resolve compiler warnings in `ahci.c` and `usb_xhci.c` by removing unused variables and parameters.

Co-authored-by: rtech-technologies <254326487+rtech-technologies@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant