Discussion:
[edk2] [PATCH] ShellPkg\Application\Shell: Clean start row information after the console has been Reset or SetMode.
Qiu Shumin
2015-06-08 11:40:54 UTC
Permalink
OriginalStartRow and CurrentStartRow should be initialized after new mode is set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
Signed-off-by: Eric Jin <***@intel.com>
---
ShellPkg/Application/Shell/ConsoleLogger.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c
index 75469d9..06f9686 100644
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ b/ShellPkg/Application/Shell/ConsoleLogger.c
@@ -2,7 +2,7 @@
Provides interface to shell console logger.

(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -410,6 +410,10 @@ ConsoleLoggerReset (
//
if (!EFI_ERROR (Status)) {
ConsoleLoggerResetBuffers(ConsoleInfo);
+ if (ExtendedVerification == TRUE) {
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ }
}

return Status;
@@ -963,10 +967,13 @@ ConsoleLoggerSetMode (
// Check that the buffers are still correct for logging
//
if (!EFI_ERROR (Status)) {
- ConsoleInfo->OurConOut.Mode = gST->ConOut->Mode;
+ ConsoleInfo->OurConOut.Mode = ConsoleInfo->OldConOut->Mode;
ConsoleLoggerResetBuffers(ConsoleInfo);
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut);
}
-
+
return Status;
}
--
1.9.5.msysgit.1



------------------------------------------------------------------------------
Carsey, Jaben
2015-06-08 15:01:43 UTC
Permalink
-----Original Message-----
From: Qiu, Shumin
Sent: Monday, June 08, 2015 4:41 AM
Cc: Jin, Eric; Carsey, Jaben
Subject: [PATCH] ShellPkg\Application\Shell: Clean start row information
after the console has been Reset or SetMode.
Importance: High
OriginalStartRow and CurrentStartRow should be initialized after new mode is set.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ShellPkg/Application/Shell/ConsoleLogger.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c
b/ShellPkg/Application/Shell/ConsoleLogger.c
index 75469d9..06f9686 100644
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ b/ShellPkg/Application/Shell/ConsoleLogger.c
@@ -2,7 +2,7 @@
Provides interface to shell console logger.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights
+ reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be
//
if (!EFI_ERROR (Status)) {
ConsoleLoggerResetBuffers(ConsoleInfo);
+ if (ExtendedVerification == TRUE) {
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ }
}
return Status;
@@ -963,10 +967,13 @@ ConsoleLoggerSetMode (
// Check that the buffers are still correct for logging
//
if (!EFI_ERROR (Status)) {
- ConsoleInfo->OurConOut.Mode = gST->ConOut->Mode;
+ ConsoleInfo->OurConOut.Mode = ConsoleInfo->OldConOut->Mode;
ConsoleLoggerResetBuffers(ConsoleInfo);
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut);
}
-
+
return Status;
}
--
1.9.5.msysgit.1
------------------------------------------------------------------------------
Laszlo Ersek
2015-06-08 21:24:07 UTC
Permalink
Post by Qiu Shumin
OriginalStartRow and CurrentStartRow should be initialized after new mode is set.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ShellPkg/Application/Shell/ConsoleLogger.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c
index 75469d9..06f9686 100644
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ b/ShellPkg/Application/Shell/ConsoleLogger.c
@@ -2,7 +2,7 @@
Provides interface to shell console logger.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -410,6 +410,10 @@ ConsoleLoggerReset (
//
if (!EFI_ERROR (Status)) {
ConsoleLoggerResetBuffers(ConsoleInfo);
+ if (ExtendedVerification == TRUE) {
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ }
}
return Status;
@@ -963,10 +967,13 @@ ConsoleLoggerSetMode (
// Check that the buffers are still correct for logging
//
if (!EFI_ERROR (Status)) {
- ConsoleInfo->OurConOut.Mode = gST->ConOut->Mode;
+ ConsoleInfo->OurConOut.Mode = ConsoleInfo->OldConOut->Mode;
ConsoleLoggerResetBuffers(ConsoleInfo);
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut);
}
-
+
return Status;
}
I'm intrigued if this will make the random ASSERT()s go away that I
recurrently see when scrolling up (Shift + PageUp) in the UEFI shell.
Unfortunately, I have no reliable reproducer.

Thanks
Laszlo

------------------------------------------------------------------------------
Carsey, Jaben
2015-06-08 21:52:37 UTC
Permalink
-----Original Message-----
Sent: Monday, June 08, 2015 2:24 PM
To: Qiu, Shumin
Subject: Re: [edk2] [PATCH] ShellPkg\Application\Shell: Clean start row
information after the console has been Reset or SetMode.
Importance: High
Post by Qiu Shumin
OriginalStartRow and CurrentStartRow should be initialized after new mode
is set.
Post by Qiu Shumin
Contributed-under: TianoCore Contribution Agreement 1.0
---
ShellPkg/Application/Shell/ConsoleLogger.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c
b/ShellPkg/Application/Shell/ConsoleLogger.c
Post by Qiu Shumin
index 75469d9..06f9686 100644
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ b/ShellPkg/Application/Shell/ConsoleLogger.c
@@ -2,7 +2,7 @@
Provides interface to shell console logger.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
Post by Qiu Shumin
which accompanies this distribution. The full text of the license may be
found at
Post by Qiu Shumin
@@ -410,6 +410,10 @@ ConsoleLoggerReset (
//
if (!EFI_ERROR (Status)) {
ConsoleLoggerResetBuffers(ConsoleInfo);
+ if (ExtendedVerification == TRUE) {
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ }
}
return Status;
@@ -963,10 +967,13 @@ ConsoleLoggerSetMode (
// Check that the buffers are still correct for logging
//
if (!EFI_ERROR (Status)) {
- ConsoleInfo->OurConOut.Mode = gST->ConOut->Mode;
+ ConsoleInfo->OurConOut.Mode = ConsoleInfo->OldConOut->Mode;
ConsoleLoggerResetBuffers(ConsoleInfo);
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut);
}
-
+
return Status;
}
I'm intrigued if this will make the random ASSERT()s go away that I
recurrently see when scrolling up (Shift + PageUp) in the UEFI shell.
Unfortunately, I have no reliable reproducer.
Bad memory here. Is Shift+PageUp different from PageUp (no shift)?


-Jaben
Thanks
Laszlo
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Laszlo Ersek
2015-06-08 22:17:53 UTC
Permalink
Post by Carsey, Jaben
-----Original Message-----
Sent: Monday, June 08, 2015 2:24 PM
To: Qiu, Shumin
Subject: Re: [edk2] [PATCH] ShellPkg\Application\Shell: Clean start row
information after the console has been Reset or SetMode.
Importance: High
Post by Qiu Shumin
OriginalStartRow and CurrentStartRow should be initialized after new mode
is set.
Post by Qiu Shumin
Contributed-under: TianoCore Contribution Agreement 1.0
---
ShellPkg/Application/Shell/ConsoleLogger.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c
b/ShellPkg/Application/Shell/ConsoleLogger.c
Post by Qiu Shumin
index 75469d9..06f9686 100644
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ b/ShellPkg/Application/Shell/ConsoleLogger.c
@@ -2,7 +2,7 @@
Provides interface to shell console logger.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
Post by Qiu Shumin
which accompanies this distribution. The full text of the license may be
found at
Post by Qiu Shumin
@@ -410,6 +410,10 @@ ConsoleLoggerReset (
//
if (!EFI_ERROR (Status)) {
ConsoleLoggerResetBuffers(ConsoleInfo);
+ if (ExtendedVerification == TRUE) {
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ }
}
return Status;
@@ -963,10 +967,13 @@ ConsoleLoggerSetMode (
// Check that the buffers are still correct for logging
//
if (!EFI_ERROR (Status)) {
- ConsoleInfo->OurConOut.Mode = gST->ConOut->Mode;
+ ConsoleInfo->OurConOut.Mode = ConsoleInfo->OldConOut->Mode;
ConsoleLoggerResetBuffers(ConsoleInfo);
+ ConsoleInfo->OriginalStartRow = 0;
+ ConsoleInfo->CurrentStartRow = 0;
+ ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut);
}
-
+
return Status;
}
I'm intrigued if this will make the random ASSERT()s go away that I
recurrently see when scrolling up (Shift + PageUp) in the UEFI shell.
Unfortunately, I have no reliable reproducer.
Bad memory here. Is Shift+PageUp different from PageUp (no shift)?
Probably not: Shift+PageUp is likely just a habit of mine, from xterm.
It happens to work in the UEFI shell too, so I never learned to press
just PageUp in the UEFI shell.

Thanks
Laszlo


------------------------------------------------------------------------------
Loading...