]> 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)
commitfa462cf871eaa6b30eea7044ffd9374b46c75d5b
tree330a7ab3d03b69af5187c81cbe020c7ecb5dac89
parent428f54cb3d5dcea90ab4d23087c434e5c2beb7bf
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