qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Keith Packard" <keithp@keithp.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] Semihost SYS_READC implementation
Date: Tue, 22 Oct 2019 11:12:11 -0700	[thread overview]
Message-ID: <87sgnk3b0k.fsf@keithp.com> (raw)
In-Reply-To: <d7470bfa-ba4e-3287-326f-ee63c5d76407@redhat.com>

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

Paolo Bonzini <pbonzini@redhat.com> writes:

Thanks so much for looking at this patch.

> I'm a bit confused, why is it not using semihosting_get_chardev?  That
> would be
>
> 	-chardev stdio,id=semihost
> 	-semihosting-config on,chardev=semihost

Because I didn't realize the semihosting code already had a Chardev
option.  Thanks much for pointing it out. I've changed the code to use
the semihosting chardev instead of serial_hd(0). That change was quite
simple:

 void qemu_semihosting_console_init(void)
 {
-    if (semihosting_enabled()) {
-        qemu_chr_fe_init(&console.backend, serial_hd(0), &error_abort);
+    Chardev *chr = semihosting_get_chardev();
+
+    if  (chr) {
+        qemu_chr_fe_init(&console.backend, chr, &error_abort);
         qemu_chr_fe_set_handlers(&console.backend,
                                  console_can_read,
                                  console_read,

(I left the call to qemu_semihosting_console_init() late in the
initialization process so that the semihosting I/O ended up with the
stdio mux focus instead of the monitor)

Your example command line was really helpful in figuring out how to get
this to work. Here's the full command line I ended up using so that
semihost, serial and monitor are all muxed to stdio:

$ qemu-system-arm -chardev stdio,mux=on,id=stdio0 -serial chardev:stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline 

It might be nice if this could be shortened, but it certainly provides
the necessary options to make it all work.

I'll post an updated version of the patch in a while, after waiting to
see if there are any additional comments.

-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2019-10-22 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  3:13 [PATCH] Semihost SYS_READC implementation Keith Packard
2019-10-22  8:34 ` Paolo Bonzini
2019-10-22 18:12   ` Keith Packard [this message]
2019-10-23 15:51     ` Paolo Bonzini
2019-10-23 19:15       ` Keith Packard

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=87sgnk3b0k.fsf@keithp.com \
    --to=keithp@keithp.com \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --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).