Skip to content

feat(kernel): added improved time management as well as RTC support#67

Merged
FlareCoding merged 3 commits intostellux-3.0-prototypingfrom
pr/rtc-time-support
Mar 4, 2026
Merged

feat(kernel): added improved time management as well as RTC support#67
FlareCoding merged 3 commits intostellux-3.0-prototypingfrom
pr/rtc-time-support

Conversation

@FlareCoding
Copy link
Owner

@FlareCoding FlareCoding commented Mar 4, 2026

Note

High Risk
Touches AArch64 trap vectors and scheduler switch/return semantics, which are highly sensitive and can cause hard-to-debug crashes if incorrect; RTC/syscall additions are comparatively straightforward but broaden kernel surface area.

Overview
Adds wall-clock time support by introducing an rtc subsystem (x86 CMOS RTC, AArch64/QEMU PL031, and an RPi4 build-epoch fallback via STLX_BUILD_EPOCH) and wiring it into boot so clock::boot_realtime_ns() can back realtime calculations.

Implements Linux-compatible time syscalls (clock_gettime, clock_getres, gettimeofday) and registers the syscall numbers for both x86_64 and aarch64; userland gains new date and clockbench apps to exercise these APIs.

Fixes an AArch64 context-switch/trap-return correctness issue by extending trap_frame with sp_el1 and rewriting the exception vector epilogue + scheduler handoff to properly switch EL1 exception stacks when returning to EL0t/EL1t versus EL1h, preventing kernel stack corruption across task switches.

Written by Cursor Bugbot for commit ee26e04. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

FlareCoding and others added 2 commits March 4, 2026 15:30
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
@FlareCoding FlareCoding merged commit c40b5b7 into stellux-3.0-prototyping Mar 4, 2026
15 checks passed
@FlareCoding FlareCoding deleted the pr/rtc-time-support branch March 4, 2026 23:41
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