From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UPFhU-0000vP-Nx for mharc-grub-devel@gnu.org; Mon, 08 Apr 2013 13:17:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPFhM-0000kN-2G for grub-devel@gnu.org; Mon, 08 Apr 2013 13:17:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPFhG-0006uD-Ut for grub-devel@gnu.org; Mon, 08 Apr 2013 13:17:39 -0400 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:37653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPFhG-0006ti-K4 for grub-devel@gnu.org; Mon, 08 Apr 2013 13:17:34 -0400 Received: by mail-ea0-f169.google.com with SMTP id n15so2496845ead.0 for ; Mon, 08 Apr 2013 10:17:33 -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=pAEvwkzVSZIknI1uVFEMvKYVZGXtcMlzqBD2IsiJYp0=; b=fPJJf4CqPRvBdByyDnW3CnRgGiwsSyfH0pWamT1N+xcEV1ylzKjku9+PNPB3Ep1E+a KDTecM8fBXH+2KQMLE4jJSn0xCPhRhFnNq3J5+yxhnztAYSWADKjg6qZlln0ci7q5SIP VA9Uf84Ac92BS4/dsCxVe71KdsvjUzRKcTQSRL0RpazOSurxl+524CIeUTo9JvVwf1cv 53QQlF6myRIul09GTrrfYZKCz1eUrTewCbkehzWcfvvMz5dBaThaF/l+zGn78HqQryAH pc+DNQtxxiJwelWWzBkpLtTbO5kjCyB/usz3648wzEWNQoKq20F7q2gjim83GsNL6vrn YEPA== X-Received: by 10.14.1.130 with SMTP id 2mr50651866eed.15.1365441453726; Mon, 08 Apr 2013 10:17:33 -0700 (PDT) Received: from debian.x201.phnet (117-235.197-178.cust.bluewin.ch. [178.197.235.117]) by mx.google.com with ESMTPS id cb50sm11516307eeb.14.2013.04.08.10.17.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 10:17:33 -0700 (PDT) Message-ID: <5162FBA7.70208@gmail.com> Date: Mon, 08 Apr 2013 19:17:27 +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> In-Reply-To: <1361463623-25266-1-git-send-email-arvidjaar@gmail.com> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigD56727CDA7CB558DFAE50ADF" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::229 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:17:47 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD56727CDA7CB558DFAE50ADF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21.02.2013 17:20, Andrey Borzenkov wrote: > 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. >=20 > 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 dimensions 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. > Signed-off-by: Andrey Borzenkov >=20 > --- > grub-core/term/i386/pc/console.c | 21 ++++++++------------- > 1 file changed, 8 insertions(+), 13 deletions(-) >=20 > 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 0= Eh > - * (TELETYPE OUTPUT). Otherwise, save the original position, put a spa= ce, > - * save the current position, restore the original position, write the= > - * 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 doe= sn't > - * support setting a background attribute. > + * (TELETYPE OUTPUT). Otherwise, use INT 10, AH =3D 9 to write charact= er > + * 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 --------------enigD56727CDA7CB558DFAE50ADF 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/ iF4EAREKAAYFAlFi+6cACgkQNak7dOguQglqUQD/bkKOsKS5tTmlvgIAB08HKM9P R+LkBOT/eicdi6wyPVEBAMHyTfTKtqYrbMhVj1X/x8wshQjeZlpwIbZu8ulTrqwV =P7VA -----END PGP SIGNATURE----- --------------enigD56727CDA7CB558DFAE50ADF--