Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Gerd Hoffmann
Hi, > > void sercon_putchar(char *ptr) > > { > > char c = GET_GLOBAL(ptr[0]); > > [ ... ] > > > > ... work? > > Yes. See output.c:puts_cs() as an example. It only works if it's a > constant string (as opposed to a string built on the stack). After cleaning up the code only three

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Gerd Hoffmann
Hi, > I found what I was looking for though - it was in the sgabios > design.txt file instead of the revision history: > So, if I read the above correctly, it was lilo that inspired the > "feature". Anyway, something to keep in mind. Oh. lilo. Interesting. I didn't expect

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Gerd Hoffmann
Hi, > > Unfortunately, the screen can be larger than 80x25. > > It can with SVGA BIOS, but Gerd here only supports mode 3, doesn't he? Current code yes, but that doesn't imply it'll stay that way forever. Supporting other sizes is just a matter of making sercon_1000() recognizing the mode

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Kevin O'Connor
On Mon, Jul 04, 2016 at 06:03:30PM +0200, Paolo Bonzini wrote: > On 04/07/2016 18:00, Kevin O'Connor wrote: > > Does anyone know where one can find the original svn commit history > > for sgabios? Seems the original google code repo is no longer > > present. > > There was no history as far as I

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Paolo Bonzini
On 04/07/2016 18:00, Kevin O'Connor wrote: > So, if I read the sgabios code correctly, it allocates a buffer of: > > struct { u8 x, y; char c; } logbuf[256]; > int logbuf_offset; > > Every character sent on the serial port is appended to "logbuf" in > order, wrapping if necessary:

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Kevin O'Connor
On Mon, Jul 04, 2016 at 11:26:48AM -0400, Kevin O'Connor wrote: > At one point I looked through the sgabios code and was able to > understand how it did caching. I'll take another look and see if I > can describe it. So, if I read the sgabios code correctly, it allocates a buffer of: struct {

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Paolo Bonzini
On 04/07/2016 17:26, Kevin O'Connor wrote: > > 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. > > Unfortunately, the screen can be larger than 80x25.

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-04 Thread Paolo Bonzini
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

Re: [SeaBIOS] [RFC PATCH 1/2] serial console, output

2016-07-01 Thread Kevin O'Connor
On Fri, Jul 01, 2016 at 12:54:30PM +0200, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann Thanks. See my comments below. [...] > --- a/src/misc.c > +++ b/src/misc.c > @@ -11,6 +11,7 @@ > #include "output.h" // debug_enter > #include "stacks.h" // call16_int > #include