Skip to content

Detect whether the FIFOs are really enabled - #88

Merged
phip1611 merged 2 commits into
rust-osdev:mainfrom
phip1611:fifo-detection
Oct 11, 2026
Merged

phip1611 merged 2 commits into
rust-osdev:mainfrom
phip1611:fifo-detection

Conversation

@phip1611

@phip1611 phip1611 commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

send_bytes() trusted the config and wrote a whole FIFO's worth of data per THRE. On devices without working FIFO, e.g., a 16450, all but one byte got lost. Like Linux, check IIR bits 7:6 after configuring the FIFOs and fall back to one byte per THRE.

  • New Uart16550::fifo_enabled() reports the result; ISR::fifo_enabled() is a convenience getter for the FIFO bits.
  • The docs of ISR mention its other name, IIR, which datasheets and Linux also use.

🤖 Generated with Claude Code

@phip1611
phip1611 force-pushed the fifo-detection branch 2 times, most recently from 4d190b8 to 0069ab7 Compare October 11, 2026 07:08
@phip1611 phip1611 self-assigned this Oct 11, 2026
@phip1611
phip1611 marked this pull request as ready for review October 11, 2026 07:08
@phip1611
phip1611 force-pushed the fifo-detection branch 3 times, most recently from 1d28ba1 to 8b50c15 Compare October 11, 2026 07:13
Some 16550 UART datasheets call this register IIR, others ISR. Linux
uses IIR. Mention both names, and let a docs search for IIR find it.
@phip1611
phip1611 force-pushed the fifo-detection branch 2 times, most recently from c6ac616 to 097b6fd Compare October 11, 2026 07:30
send_bytes() trusted the config and wrote a whole FIFO's worth of data.
On devices without working FIFO, e.g., a 16450, all but one byte got
lost. Like Linux, check IIR bits 7:6 after configuring the FIFOs and
fall back to one byte per write operation.

The test backend now reports the FIFO state in the ISR, so tests can
cover devices without FIFO.
@phip1611
phip1611 added this pull request to the merge queue Oct 11, 2026
Merged via the queue into rust-osdev:main with commit 38b61ff Oct 11, 2026
18 checks passed
@phip1611
phip1611 deleted the fifo-detection branch October 11, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant