]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: industry-standard TTY output pipeline (Linux/BSD parity)
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 05:48:55 +0000 (02:48 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 05:48:55 +0000 (02:48 -0300)
commit2cdd7af48ecf42bf16f871459a9295778c310a85
tree6efd3266560f1b2b40c11a83a0f8319c0df93881
parent5bc83fc4b5fe5ce0b2a463f79233de2ee1310c7a
feat: industry-standard TTY output pipeline (Linux/BSD parity)

Kernel:
- Open /dev/console as fd 0/1/2 for init process (mirrors Linux
  kernel_init: open + dup + dup pattern)
- Add console_put_char() that outputs to both UART and VGA
- TTY write path now routes through console_put_char() instead of
  uart_put_char() only — userspace output now appears on VGA too
- Implement OPOST/ONLCR output processing: \n → \r\n conversion
  (POSIX termios c_oflag, enabled by default)
- TCGETS/TCSETS ioctl now reads/writes c_oflag
- All TTY echo paths (canonical, raw, line editing) use tty_output_char()
  for consistent UART+VGA output with OPOST processing
- Increase syscall write copy buffer from 256 to 1024 bytes
- Declare vga_put_char() in vga_console.h

Userspace (ulibc):
- stdout is now line-buffered (_STDIO_LBUF): flushes on \n
- stderr is now unbuffered (_STDIO_UNBUF): writes immediately
- printf()/vprintf() now go through fwrite(stdout) instead of raw
  write(), unifying all stdio output through the FILE buffer
- putchar()/puts() also route through fwrite(stdout)
- fwrite() respects buffering modes: unbuffered bypasses buffer,
  line-buffered flushes on newline, full-buffered flushes when full
- Add setvbuf()/setbuf() with _IOFBF/_IOLBF/_IONBF modes
- Add isatty() implemented via TCGETS ioctl probe (POSIX standard)

Build: clean, cppcheck: clean, smoke: 19/19 pass
include/console.h
include/tty.h
include/vga_console.h
src/arch/x86/arch_platform.c
src/kernel/console.c
src/kernel/syscall.c
src/kernel/tty.c
user/ulibc/include/stdio.h
user/ulibc/include/unistd.h
user/ulibc/src/stdio.c
user/ulibc/src/unistd.c