From: Gerd Hoffmann <kraxel@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin O'Connor <kevin@koconnor.net>,
seabios@seabios.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] serial console, output
Date: Mon, 04 Jul 2016 14:46:24 +0200 [thread overview]
Message-ID: <1467636384.15123.177.camel@redhat.com> (raw)
In-Reply-To: <7c1baeab-b8b0-93d1-a9a2-054dfd92ece0@redhat.com>
On Mo, 2016-07-04 at 11:11 +0200, Paolo Bonzini wrote:
>
> On 04/07/2016 10:16, Gerd Hoffmann wrote:
> >
> > + sercon_putchar('\x1b');
> > + sercon_putchar('c');
> > + /* clear screen */
> > + sercon_putchar('\x1b');
> > + sercon_putchar('[');
> > + sercon_putchar('2');
> > + sercon_putchar('J');
> > +}
> > +
> > +static void sercon_set_color(u8 fg, u8 bg, u8 bold)
> > +{
> > + sercon_putchar('\x1b');
> > + sercon_putchar('[');
> > + sercon_putchar('0');
> > + if (fg != 7) {
> > + sercon_putchar(';');
> > + sercon_putchar('3');
> > + sercon_putchar(GET_LOW(sercon_cmap[fg & 7]));
> > + }
> > + if (bg != 0) {
> > + sercon_putchar(';');
> > + sercon_putchar('4');
> > + sercon_putchar(GET_LOW(sercon_cmap[bg & 7]));
> > + }
> > + if (bold) {
> > + sercon_putchar(';');
> > + sercon_putchar('1');
> > + }
> > + sercon_putchar('m');
>
> Add a sercon_putstr perhaps?
We run in real mode, so passing around pointers isn't that easy.
Given this would make sense for constant strings only (like the 4-byte
clear-screen sequence) and not so much for variable stuff we might put
all strings in the global segment.
Would this ...
void sercon_putchar(char *ptr)
{
char c = GET_GLOBAL(ptr[0]);
[ ... ]
... work?
> > Maybe we can reuse the output buffer which we have anyway. Logic needs
> > reworked a bit. We can't just clear characters after printing them out
> > if we want be able to read them later, so we need a separate
> > pending-updates bit. Also should be bigger I guess, maybe 80 chars so
> > it can cover a complete line.
>
> 80x25 is just 2K... Perhaps it's simpler to just allocate the whole
> video buffer from the UMB or EBDA when serial console is in use?
4k, we need both character and attribute. But, yes, if we can allocate
that somewhere in real mode address space without running into memory
pressure this might be the best option.
cheers,
Gerd
next prev parent reply other threads:[~2016-07-04 12:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-01 10:54 [Qemu-devel] [RFC PATCH 0/2] seabios: add serial console support Gerd Hoffmann
2016-07-01 10:54 ` [Qemu-devel] [RFC PATCH 1/2] serial console, output Gerd Hoffmann
2016-07-01 15:47 ` [Qemu-devel] [SeaBIOS] " Kevin O'Connor
2016-07-04 8:16 ` Gerd Hoffmann
2016-07-04 9:11 ` [Qemu-devel] " Paolo Bonzini
2016-07-04 12:46 ` Gerd Hoffmann [this message]
2016-07-04 12:48 ` Paolo Bonzini
2016-07-04 15:26 ` Kevin O'Connor
2016-07-04 15:45 ` Paolo Bonzini
2016-07-04 20:10 ` Gerd Hoffmann
2016-07-04 16:00 ` Kevin O'Connor
2016-07-04 16:03 ` Paolo Bonzini
2016-07-04 17:28 ` Kevin O'Connor
2016-07-04 20:18 ` Gerd Hoffmann
2016-07-04 20:23 ` Gerd Hoffmann
2016-07-01 10:54 ` [Qemu-devel] [RFC PATCH 2/2] serial console, input Gerd Hoffmann
2016-07-01 17:07 ` [Qemu-devel] [SeaBIOS] " Kevin O'Connor
2016-07-01 18:07 ` Kevin O'Connor
2016-07-04 9:16 ` Gerd Hoffmann
2016-07-04 15:34 ` Kevin O'Connor
2016-07-04 20:03 ` Gerd Hoffmann
2016-07-01 15:47 ` [Qemu-devel] [RFC PATCH 0/2] seabios: add serial console support Gerd Hoffmann
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=1467636384.15123.177.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=kevin@koconnor.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.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).