Skip to content

Tested#1

Merged
veighnsche merged 5 commits intomasterfrom
tested
Jan 11, 2026
Merged

Tested#1
veighnsche merged 5 commits intomasterfrom
tested

Conversation

@veighnsche
Copy link
Copy Markdown
Contributor

No description provided.

veighnsche and others added 5 commits January 11, 2026 17:14
- Enable CPACR_EL1.FPEN before any Rust code runs
- Fix movz/movk sequence for 0xFFFF_8000_0000_0000 constant
- Flush entire 16KB page table region (256 cache lines)
- Set VBAR_EL1 before jumping to Rust
- Split DTB memory regions around kernel physical range

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
handle_irq_dispatch was a TODO stub returning false, causing the
timer IRQ (27) to spam "Unhandled IRQ" infinitely. Now delegates
to los_hal::aarch64::gic::dispatch() which calls registered handlers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The syscall layer needs hooks to resolve executables from initramfs
and spawn processes. These were defined but never registered, causing
"resolve_initramfs_executable: hook not set" and ENOSYS on shell spawn.

Added register_process_hooks() in init.rs that sets:
- RESOLVE_EXECUTABLE_HOOK: reads ELF from initramfs by path
- SPAWN_FROM_ELF_HOOK: creates UserTask from ELF data
- SPAWN_FROM_ELF_WITH_ARGS_HOOK: creates UserTask with argv/envp

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added secondary input hook to HAL console that allows VirtIO keyboard
input to be used in addition to UART. The kernel registers the VirtIO
keyboard as secondary input after device initialization.

Changes:
- HAL: Added set_secondary_input() callback for alternate input sources
- HAL: read_byte() now checks secondary input before UART
- Kernel: Registers VirtIO keyboard as secondary input after virtio init

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two issues preventing userspace entry:

1. GPF with error code 0x28 (GDT index 5 = TSS)
   - Limine's segment selectors were still loaded after our lgdt
   - Added segment reload via far return (CS) and mov (DS/ES/SS/FS/GS)
   - Now properly sets kernel segments (CS=0x08, others=0x10)

2. #UD on SSE instructions (xorps)
   - SSE/FPU wasn't explicitly enabled after GDT reload
   - Added CR0.MP, cleared CR0.EM, set CR4.OSFXSR and CR4.OSXMMEXCPT
   - Added fninit to initialize FPU state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@veighnsche veighnsche merged commit 7b6e256 into master Jan 11, 2026
1 of 3 checks passed
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