Skip to content

Day30 Learning Log

📌 What I learned

  • traced write() to pl011_start_tx()
  • traced RX interrupt to pl011_irq()
  • understood xmit buffer (TX)
  • understood flip buffer (RX)
  • learned TTY layered architecture

📌 Key insights

1. write() is buffered

write() only pushes data into xmit buffer
actual transmission is handled asynchronously


2. RX uses interrupt + flip buffer

data path:

UART → IRQ → flip buffer → tty core → read()

3. flip buffer is real memory

  • not a pointer
  • used for IRQ-safe buffering
  • supports batching

4. TTY subsystem is not a simple char device

Compared to my previous driver:

  • more layers
  • more abstraction
  • more flexibility

5. driver responsibility is limited

driver only:

  • handles hardware
  • pushes data to TTY

TTY handles:

  • buffering
  • behavior
  • user interaction

📌 Difficulties

  • understanding flip buffer concept
  • mapping abstract flow to real code
  • distinguishing tty core vs driver role

📌 Takeaway

TTY subsystem decouples hardware, driver, and user space
making serial communication flexible and scalable