From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UPG7l-0004SV-M5 for mharc-grub-devel@gnu.org; Mon, 08 Apr 2013 13:44:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPG7d-0004KY-EG for grub-devel@gnu.org; Mon, 08 Apr 2013 13:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPG7Y-0001p6-DV for grub-devel@gnu.org; Mon, 08 Apr 2013 13:44:49 -0400 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:62364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPG7Y-0001ot-3Q for grub-devel@gnu.org; Mon, 08 Apr 2013 13:44:44 -0400 Received: by mail-ea0-f172.google.com with SMTP id z7so2506422eaf.31 for ; Mon, 08 Apr 2013 10:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=xITqCKH6SDBqkpEtloHauedbgVZ5/4YUuYzrUWcp6T4=; b=jULu8onKCjemZXKGFg+aJMVOcWulhVAfONbGmyY4i711U+F74IzyG9+Ed9+MjZHHMO elw8KGJxNDtXl4FUmxQpZPUqfMDnQxHK401SjPSeRNAtnqcIoZ5uIFnluwvaUY0SYfBb vkXI7vT7qXEcatZ1tejl9i4iOZrDLU7QyPOxZ4Isr5qZXYyITLIRrz/OtfBssWHULb9H j9Q6FEE0dnTvy4wvgAtRD4p0VeTQhqHz6OYiicA33KVCm2w10O1xG1vMmCf5U6pucPS2 STEN4KSBt0EsIJAgeyY7XLj6GZ67fkkabtihIbCWT4jMtChbKxXXXfhFFu4/9o3t8oOq ItEg== X-Received: by 10.15.99.201 with SMTP id bl49mr37449802eeb.43.1365443083247; Mon, 08 Apr 2013 10:44:43 -0700 (PDT) Received: from debian.x201.phnet (245-188.1-85.cust.bluewin.ch. [85.1.188.245]) by mx.google.com with ESMTPS id n2sm33372150eeo.10.2013.04.08.10.44.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 10:44:42 -0700 (PDT) Message-ID: <51630209.3010504@gmail.com> Date: Mon, 08 Apr 2013 19:44:41 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] fix last column in BIOS console References: <1361463623-25266-1-git-send-email-arvidjaar@gmail.com> <5162FBA7.70208@gmail.com> In-Reply-To: <5162FBA7.70208@gmail.com> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7FA28C6D357F4E6A9A73474D" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2013 17:44:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7FA28C6D357F4E6A9A73474D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08.04.2013 19:17, Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > On 21.02.2013 17:20, Andrey Borzenkov wrote: >=20 >> BIOS console wrapped line at 79 characters. It became the issue >> after recent changes when extra column for scrolling indications was >> removed. The effect was that up/down arrows were printed in the first >> column of the next line. >> >> May be it would be easier to simply use INT10 AH=3D13. Available >> documentation indicates that it is available since 1986, so I guess >> any system that exists today should implement it. >> >=20 > I need to look how we ended up with the current code. It doesn't match > its comment which details an algorithm working for any screen dimension= s > while current code assumes a fixed width. Another corner question is a > possibility of usage of vga_text and keep console to the bare minimum. > Does anyone have information about BIOSes redirecting their output? > The age of the function is no argument about their availability. Loads > of functions are not implemented or broken in modern BIOSes. More or > less the only guarantee of function working on all BIOSes is if BIOS > uses them in a normal bootpath. >=20 The code was the same since it was (re)written in 2002 for GRUB Legacy. Your code and original make the same assumptions, so the patch is good. Could you make a membership request on savannah so you can commit patches yourself once they're approved? >> Signed-off-by: Andrey Borzenkov >> >> --- >> grub-core/term/i386/pc/console.c | 21 ++++++++------------- >> 1 file changed, 8 insertions(+), 13 deletions(-) >> >> diff --git a/grub-core/term/i386/pc/console.c b/grub-core/term/i386/pc= /console.c >> index 2aa1943..358611a 100644 >> --- a/grub-core/term/i386/pc/console.c >> +++ b/grub-core/term/i386/pc/console.c >> @@ -86,13 +86,9 @@ grub_console_gotoxy (struct grub_term_output *term = __attribute__ ((unused)), >> * Put the character C on the console. Because GRUB wants to write a >> * character with an attribute, this implementation is a bit tricky. >> * If C is a control character (CR, LF, BEL, BS), use INT 10, AH =3D = 0Eh >> - * (TELETYPE OUTPUT). Otherwise, save the original position, put a sp= ace, >> - * save the current position, restore the original position, write th= e >> - * character and the attribute, and restore the current position. >> - * >> - * The reason why this is so complicated is that there is no easy way= to >> - * get the height of the screen, and the TELETYPE OUTPUT BIOS call do= esn't >> - * support setting a background attribute. >> + * (TELETYPE OUTPUT). Otherwise, use INT 10, AH =3D 9 to write charac= ter >> + * with attributes and advance cursor. If we are on the last column, >> + * let BIOS to wrap line correctly. >> */ >> static void >> grub_console_putchar_real (grub_uint8_t c) >> @@ -112,19 +108,18 @@ grub_console_putchar_real (grub_uint8_t c) >> /* get the current position */ >> pos =3D grub_console_getxy (NULL); >> =20 >> + /* write the character with the attribute */ >> + int10_9 (c, 1); >> + >> /* check the column with the width */ >> if ((pos & 0xff00) >=3D (79 << 8)) >> { >> grub_console_putchar_real (0x0d); >> grub_console_putchar_real (0x0a); >> - /* get the current position */ >> - pos =3D grub_console_getxy (NULL); >> } >> + else >> + grub_console_gotoxy (NULL, ((pos & 0xff00) >> 8) + 1, (pos & 0xff= )); >> =20 >> - /* write the character with the attribute */ >> - int10_9 (c, 1); >> - >> - grub_console_gotoxy (NULL, ((pos & 0xff00) >> 8) + 1, (pos & 0xff))= ; >> } >> =20 >> static void >=20 >=20 >=20 --------------enig7FA28C6D357F4E6A9A73474D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAlFjAgkACgkQNak7dOguQgnCQwD+IRybT+S90nlyEKQEI9A64L49 t1WI6OlFHkzETBuAa3ABALpoXXrh2IZ7hXFljO94Xj8niZ4NdTM+8wHcAshNMrFK =Unp6 -----END PGP SIGNATURE----- --------------enig7FA28C6D357F4E6A9A73474D--