Skip to content

Conversation

@IanSeyler
Copy link
Member

This pull request refactors the timer and initialization subsystems to improve portability and support for both physical hardware and virtualized environments. It replaces the previous HPET-only timer implementation with a unified timer abstraction that automatically selects the appropriate timer source (HPET or KVM) based on the environment. Additionally, it enhances initialization progress reporting by outputting status messages via serial when framebuffer (LFB) output is unavailable, improving visibility for headless or serial-only systems.

Timer subsystem refactor:

  • Removed the old HPET-specific driver (drivers/hpet.asm) and replaced it with a new, unified timer driver (drivers/timer.asm) that supports both HPET and KVM timers, automatically selecting the correct source during initialization. [1] [2] [3]
  • Updated initialization to call os_timer_init instead of the HPET-specific os_hpet_init, ensuring the timer subsystem works in both physical and virtualized environments.

Serial and output initialization improvements:

  • Enhanced serial initialization to conditionally skip ACPI checks when booting via BIOS and set the kernel output to the serial port when framebuffer is disabled. [1] [2] [3]
  • Added a new os_debug_string syscall for serial output and refactored progress reporting throughout initialization to use serial output when LFB is unavailable, ensuring status messages are visible in headless or serial-only setups. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Boot mode detection:

  • Added detection and storage of the boot mode (BIOS or other) during system initialization, allowing conditional logic during hardware setup.

These changes improve hardware abstraction, initialization reliability, and diagnostics in diverse environments.

@IanSeyler IanSeyler self-assigned this Oct 29, 2025
@IanSeyler IanSeyler merged commit 2f6152d into master Oct 29, 2025
6 checks passed
@IanSeyler IanSeyler deleted the kvm branch October 29, 2025 23:39
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.

2 participants