qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hinko Kocevar <hinkocevar@gmail.com>
To: qemu-devel@nongnu.org
Subject: simple serial device emulation
Date: Fri, 10 Sep 2021 21:35:35 +0200	[thread overview]
Message-ID: <CACOP0z-muPwpLjimweiACOoSiAeULS_aP16+_9goOZv12gTxug@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

I have an emulated MMIO area holding couple of registers that deal with
serial UART. Very simple access to the Tx and Rx registers from the
userspace point of view involves polling for a bit in one register and then
writing another; when there is room for another character. When the guest
app does write to a MMIO Tx register, as expected, io_writex() is invoked
and my handler is invoked. At the moment it does not do much. I'm thinking
now that the character needs to be fed to the serial device instance or
something.

Where should I look for suitable examples in the qemu code? I reckon that
other machines exist that do the similar. I found lots of serial_mm_init()
and sysbus_mmio_map() uses around serial port instances but I'm not sure
how to couple my "serial ops" to the "bus" or SerialMM (if that is the way
to go).

Thanks!
//hinko

-- 
.. the more I see the less I believe.., AE AoR

[-- Attachment #2: Type: text/html, Size: 1116 bytes --]

             reply	other threads:[~2021-09-10 19:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 19:35 Hinko Kocevar [this message]
2021-09-10 21:49 ` simple serial device emulation Philippe Mathieu-Daudé
2021-09-11 15:23   ` Peter Maydell
2021-09-11 16:08     ` Hinko Kocevar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACOP0z-muPwpLjimweiACOoSiAeULS_aP16+_9goOZv12gTxug@mail.gmail.com \
    --to=hinkocevar@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).