]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
kprintf: migrate all uart_print() calls to kprintf() (Route A)
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 04:31:04 +0000 (01:31 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 04:31:04 +0000 (01:31 -0300)
commit3d74635da63d5a36b967333edf713a77b0fb9499
treefd8f4ab175f878fd66db5897c32edf6407185789
parent698aa0e0546190281e017ec1f3efab44dbf09a61
kprintf: migrate all uart_print() calls to kprintf() (Route A)

Replace 270 direct uart_print() calls across 42 files with kprintf(),
routing all kernel messages through the klog ring buffer and multi-backend
console infrastructure (UART + VGA).

Key changes:
- All kernel log/debug messages now go through kprintf() -> klog_append()
  -> console_write(), ensuring they appear in dmesg and on all enabled
  output devices.
- Consolidated multi-call patterns (uart_print+itoa_hex) into single
  kprintf() calls with format specifiers (%x, %u, %s, %d, %c).
- Removed manual itoa/itoa_hex + uart_print concatenation throughout.
- Cleaned up stale #include uart_console.h from files that no longer
  need it (main.c, socket.c, syscall.c, slab.c, timer.c).
- uart_print() now only remains in 2 places:
  * uart_console.c (the implementation)
  * console.c (the UART backend in console_write)
- uart_put_char() retained in tty.c for direct terminal I/O (not logging).
- arch_early_setup files keep uart_console.h for uart_init() call.

Build: clean, cppcheck: clean, smoke: 19/19 pass.
45 files changed:
src/arch/arm/arch_early_setup.c
src/arch/mips/arch_early_setup.c
src/arch/riscv/arch_early_setup.c
src/arch/x86/acpi.c
src/arch/x86/arch_early_setup.c
src/arch/x86/arch_platform.c
src/arch/x86/cpuid.c
src/arch/x86/elf.c
src/arch/x86/gdt.c
src/arch/x86/idt.c
src/arch/x86/ioapic.c
src/arch/x86/lapic.c
src/arch/x86/mtrr.c
src/arch/x86/percpu.c
src/arch/x86/pmm_boot.c
src/arch/x86/smp.c
src/arch/x86/sysenter_init.c
src/arch/x86/usermode.c
src/arch/x86/vmm.c
src/drivers/e1000.c
src/drivers/initrd.c
src/drivers/keyboard.c
src/drivers/pci.c
src/drivers/timer.c
src/drivers/vbe.c
src/hal/x86/ata_dma.c
src/hal/x86/ata_pio.c
src/hal/x86/cpu_features.c
src/hal/x86/pci.c
src/hal/x86/timer.c
src/kernel/cpu_features.c
src/kernel/fat16.c
src/kernel/init.c
src/kernel/kaslr.c
src/kernel/main.c
src/kernel/scheduler.c
src/kernel/socket.c
src/kernel/syscall.c
src/kernel/tty.c
src/kernel/vdso.c
src/mm/heap.c
src/mm/pmm.c
src/mm/slab.c
src/net/dns.c
src/net/e1000_netif.c