]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: Rump Kernel prerequisites — condition variables, TSC nanosecond clock, IRQ...
authorTulio A M Mendes <[email protected]>
Mon, 16 Feb 2026 01:13:15 +0000 (22:13 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 16 Feb 2026 01:13:15 +0000 (22:13 -0300)
commite5cb12acaa1c24602c02fd1fffb14637ec969fa8
tree393e9ff601f86c3e35441422cc2382821f2b39e4
parentcf204443c15487936b43da28f25986492dcf05e3
feat: Rump Kernel prerequisites — condition variables, TSC nanosecond clock, IRQ chaining

Condition Variables (kcond_t):
- kcond_init/wait/signal/broadcast in sync.c
- kcond_wait atomically releases mutex, blocks, re-acquires on wakeup
- Supports timeout (ms) via PROCESS_SLEEPING + wake_at_tick
- Required by rumpuser for driver sleep/wake patterns

TSC-based Nanosecond Clock:
- TSC calibrated during LAPIC timer PIT measurement window
- clock_gettime_ns() returns nanoseconds since boot via rdtsc
- Falls back to tick-based 10ms granularity if TSC unavailable
- CLOCK_MONOTONIC syscall now uses nanosecond precision
- Linked against libgcc.a for 64-bit division on i386

Shared IRQ Handling (IRQ Chaining):
- Static pool of 32 irq_chain_node entries for shared vectors
- register_interrupt_handler auto-chains when vector already has handler
- unregister_interrupt_handler removes handler from chain
- isr_handler dispatches to all chained handlers for shared IRQs
- Transparent: single-handler fast path preserved (legacy slot)
- Required for PCI IRQ sharing and Rump Kernel driver integration
Makefile
include/arch/x86/idt.h
include/interrupts.h
include/sync.h
include/timer.h
src/arch/x86/idt.c
src/arch/x86/lapic.c
src/drivers/timer.c
src/kernel/sync.c
src/kernel/syscall.c