]>
Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: increase timer frequency to 100Hz (like Linux)
- Central TIMER_HZ=100 and TIMER_MS_PER_TICK=10 constants in timer.h
- Replace all hardcoded 50Hz / 20ms-per-tick assumptions:
syscall.c (nanosleep, clock_gettime), procfs.c (/proc/uptime),
net_ping.c (sleep/time calculations), sys_arch.c (sys_now),
sync.c (ksem_wait_timeout ms-to-ticks conversion)
- Use timer_init(TIMER_HZ) instead of hardcoded 50
- BSP-only timer tick via lapic_get_id() — APs return early to
eliminate sched_lock/vga_lock contention at higher tick rates
- vga_flush() skips spinlock + cursor update when nothing dirty
- Preempt every 2nd tick (effective 50Hz preemption) to avoid
excessive CR3 reloads in emulated environments (QEMU TLB flush
overhead). Sleep/timing resolution remains at full 100Hz via
process_wake_check on every tick.
Tests: 20/20 smoke (11s), 16/16 battery, cppcheck clean