qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Goldfish TTY enhancement
@ 2024-01-10 15:24 Jason Thorpe
  2024-01-10 16:01 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Thorpe @ 2024-01-10 15:24 UTC (permalink / raw)
  To: qemu-devel

Having recently written a driver for the Goldfish TTY for NetBSD, I found it a bit odd (and a little annoying) that the device has a PUT_CHAR register but not a GET_CHAR register, something particularly useful for early-console or in-kernel debugger use.  As it stands, to get a single character from the device, you have to first poke a DMA address into 1 (or 2) registers and then poke the command register.  Depending on the operating system environment, this might involve a lot of kernel machinery.  My current driver works around this, but makes an explicit assumption that a physical address is a valid DMA address, which is the true for the m68k virt platform, but is the sort of assumption one shouldn’t be making these days.

Would there be an objection to adding a single-register-read get-char operation to the Goldfish TTY?  The change I have in mind is to bump the version to 2 (so that driver software can identity the capability) and then allow reads of the PUT_CHAR register to return the first pending byte or -1 if the FIFO is empty.  Happy to create an additional register for the purpose if that’s preferred, but it seemed better to keep the footprint of the device the same.

If the consensus is that this is a worthwhile enhancement, I’ll post a patch.

Cheers.

-- thorpej



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-12 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-10 15:24 Goldfish TTY enhancement Jason Thorpe
2024-01-10 16:01 ` Philippe Mathieu-Daudé
2024-01-11 18:58   ` Jason Thorpe
2024-01-12 14:26     ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).