[syslinux:elflink] ldlinux: Clear screen on ASCII 12 (form feed) in DISPLAY file

syslinux-bot for Matt Fleming matt.fleming at intel.com
Thu Jan 24 09:45:08 PST 2013


Commit-ID:  6911cf7e57a870f887042ccb4c580165d868d25c
Gitweb:     http://www.syslinux.org/commit/6911cf7e57a870f887042ccb4c580165d868d25c
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Thu, 24 Jan 2013 11:07:08 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Thu, 24 Jan 2013 11:09:27 +0000

ldlinux: Clear screen on ASCII 12 (form feed) in DISPLAY file

The ansi code won't handle \f the way we want, so we need to
explicitly clear the screen and reset the cursor position, like the
old 4.x code.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/elflink/ldlinux/msg.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/com32/elflink/ldlinux/msg.c b/com32/elflink/ldlinux/msg.c
index 2efcc79..4692716 100644
--- a/com32/elflink/ldlinux/msg.c
+++ b/com32/elflink/ldlinux/msg.c
@@ -89,6 +89,11 @@ static inline void msg_ctrl_o(void)
 	NextCharJump = msg_setbg;
 }
 
+static void msg_formfeed(void)
+{
+	printf("\033[2J\033[H");
+}
+
 static void msg_novga(void)
 {
 	syslinux_force_text_mode();
@@ -191,6 +196,9 @@ static void msg_putchar(uint8_t ch)
 		break;
 	case 0x0D:		/* Ignore <CR> */
 		break;
+	case 0x0C:		/* <FF> = clear screen */
+		msg_formfeed();
+		break;
 	case 0x19:		/* <EM> = return to text mode */
 		msg_novga();
 		break;


More information about the Syslinux-commits mailing list