From a44e6361bc4e18986b7b3342a7bb2778db499eb4 Mon Sep 17 00:00:00 2001 From: okuji Date: Thu, 28 Nov 2002 07:40:37 +0000 Subject: [PATCH] 2002-11-28 Yoshinori K. Okuji * stage2/asm.S (console_cls): Write spaces to the entire screen instead of getting/setting the video mode, because this flickers the screen and is quite annoying, if using a LCD. --- ChangeLog | 6 ++++++ stage2/asm.S | 30 ++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84ccb1d88..649dc9a7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-11-28 Yoshinori K. Okuji + + * stage2/asm.S (console_cls): Write spaces to the entire screen + instead of getting/setting the video mode, because this flickers + the screen and is quite annoying, if using a LCD. + 2002-11-15 Yoshinori K. Okuji * docs/grub.texi (QNX): New subsection. Reported by diff --git a/stage2/asm.S b/stage2/asm.S index 6a04e4640..9087e299b 100644 --- a/stage2/asm.S +++ b/stage2/asm.S @@ -2128,13 +2128,12 @@ ENTRY(console_gotoxy) /* * void console_cls (void) - * BIOS call "INT 10H Function 0Fh" to get current video mode - * Call with %ah = 0x0f - * Returns %al = (video mode) + * BIOS call "INT 10H Function 09h" to write character and attribute + * Call with %ah = 0x09 + * %al = (character) * %bh = (page number) - * BIOS call "INT 10H Function 00h" to set the video mode (clears screen) - * Call with %ah = 0x00 - * %al = (video mode) + * %bl = (attribute) + * %cx = (number of times) */ @@ -2145,10 +2144,21 @@ ENTRY(console_cls) call EXT_C(prot_to_real) .code16 - movb $0xf, %ah - int $0x10 /* Get Current Video mode */ - xorb %ah, %ah - int $0x10 /* Set Video mode (clears screen) */ + /* move the cursor to the beginning */ + movb $0x02, %ah + xorb %bh, %bh + xorw %dx, %dx + int $0x10 + + /* write spaces to the entire screen */ + movw $0x0920, %ax + movw $0x07, %bx + movw $(80 * 25), %cx + int $0x10 + + /* move back the cursor */ + movb $0x02, %ah + int $0x10 DATA32 call EXT_C(real_to_prot) .code32