Skip to content

Skip ENDBR64 in invalid-op exceptions, add SS to InterruptFrame, and show ELF load progress#31

Merged
pradosh-arduino merged 2 commits intomainfrom
codex/fix-invalid-opcode-in-busybox
Mar 31, 2026
Merged

Skip ENDBR64 in invalid-op exceptions, add SS to InterruptFrame, and show ELF load progress#31
pradosh-arduino merged 2 commits intomainfrom
codex/fix-invalid-opcode-in-busybox

Conversation

@pradosh-arduino
Copy link
Copy Markdown
Collaborator

Motivation

  • Fix false-positive invalid-op exceptions caused by Intel CET ENDBR64 instruction and expose the stack segment in interrupt dumps.
  • Provide visual progress feedback when loading ELF program headers from VFS.
  • Remove in-place ELF relocation application to simplify the loader path used by this build.

Description

  • Add ss to InterruptFrame and reorder saved registers in source/includes/isr.h so the interrupt frame captures the stack segment.
  • Add skip_endbr64_if_present in source/kernel/C/interrupts/isr.c and call it from the invalid-op (#UD) handler to detect and skip a leading ENDBR64 (bytes F3 0F 1E FA) when running in user mode.
  • Add elf_log_load_progress to source/kernel/C/executables/elf.c and invoke it during VFS-based program header staging to print a textual progress bar and percent for each segment loaded.
  • Remove the in-file relocation application functions (elf_apply_relocation_entries, elf_apply_relocations_from_memory, elf_apply_relocations_from_vfs) and related calls so relocations are no longer applied during the current ELF load paths.
  • Update source/kernel/C/meltdown.c to print the new SS field in the interrupt_frame_dump output.

Testing

  • Built the kernel with make successfully.
  • Ran the automated QEMU boot script (make qemu) which reached the kernel prompt and exercised the ELF loader path that emits the new progress output.
  • No build errors or regressions were observed in the exercised boot/load scenario.

Codex Task

@pradosh-arduino pradosh-arduino merged commit 361d5e2 into main Mar 31, 2026
2 checks passed
@pradosh-arduino pradosh-arduino deleted the codex/fix-invalid-opcode-in-busybox branch April 2, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant