Discussion:
[edk2] [PATCH 0/3] Some improvements on serial terminal
Heyi Guo
2015-07-07 16:24:52 UTC
Permalink
There were some issues when I ran SCT test against Serial IO Protocol
on qemu aarch64, and below patches were made after I went through the
code of TerminalDxe driver and the flow of console devices being
connected.

Please help review these patches and provide your comments.

Thanks.

Heyi Guo (3):
ArmVirtPkg: Make terminal type consistent
MdeModulePkg: TerminalDxe: Fix bug of NullRemaining flag
MdeModulePkg: Some improvements on TerminalDxe

ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
.../Universal/Console/TerminalDxe/Terminal.c | 29 ++++------------------
2 files changed, 7 insertions(+), 24 deletions(-)
--
2.1.4
Heyi Guo
2015-07-07 16:31:05 UTC
Permalink
There were some issues when I ran SCT test against Serial IO Protocol
on qemu aarch64, and below patches were made after I went through the
code of TerminalDxe driver and the flow of console devices being
connected.

Please help review these patches and provide your comments.

Thanks.

Heyi Guo (3):
ArmVirtPkg: Make terminal type consistent
MdeModulePkg: TerminalDxe: Fix bug of NullRemaining flag
MdeModulePkg: Some improvements on TerminalDxe

ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
.../Universal/Console/TerminalDxe/Terminal.c | 29 ++++------------------
2 files changed, 7 insertions(+), 24 deletions(-)
--
2.1.4
Heyi Guo
2015-07-07 16:32:23 UTC
Permalink
There were some issues when I ran SCT test against Serial IO Protocol
on qemu aarch64, and below patches were made after I went through the
code of TerminalDxe driver and the flow of console devices being
connected.

Please help review these patches and provide your comments.

Thanks.

Heyi Guo (3):
ArmVirtPkg: Make terminal type consistent
MdeModulePkg: TerminalDxe: Fix bug of NullRemaining flag
MdeModulePkg: Some improvements on TerminalDxe

ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
.../Universal/Console/TerminalDxe/Terminal.c | 29 ++++------------------
2 files changed, 7 insertions(+), 24 deletions(-)
--
2.1.4
Heyi Guo
2015-07-07 16:38:20 UTC
Permalink
Sorry, please ignore this mail. It seems there is something wrong with
my system to send several patches at a time... :(
Post by Heyi Guo
There were some issues when I ran SCT test against Serial IO Protocol
on qemu aarch64, and below patches were made after I went through the
code of TerminalDxe driver and the flow of console devices being
connected.
Please help review these patches and provide your comments.
Thanks.
ArmVirtPkg: Make terminal type consistent
MdeModulePkg: TerminalDxe: Fix bug of NullRemaining flag
MdeModulePkg: Some improvements on TerminalDxe
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
.../Universal/Console/TerminalDxe/Terminal.c | 29 ++++------------------
2 files changed, 7 insertions(+), 24 deletions(-)
Heyi Guo
2015-07-07 16:56:28 UTC
Permalink
There were some issues when I ran SCT test against Serial IO Protocol
on qemu aarch64, and below patches were made after I went through the
code of TerminalDxe driver and the flow of console devices being
connected.

Please help review these patches and provide your comments.

Thanks.

Heyi Guo (3):
ArmVirtPkg: Make terminal type consistent
MdeModulePkg: TerminalDxe: Fix bug of NullRemaining flag
MdeModulePkg: Some improvements on TerminalDxe

ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
.../Universal/Console/TerminalDxe/Terminal.c | 29 ++++------------------
2 files changed, 7 insertions(+), 24 deletions(-)
--
2.1.4
Heyi Guo
2015-07-07 16:56:29 UTC
Permalink
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.

I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.

Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <***@linaro.org>
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3

#
--
2.1.4
Laszlo Ersek
2015-07-07 18:47:14 UTC
Permalink
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.

The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.

(2) This patch should be rebased on Roy's recent patch set

[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769

In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with

-D TTY_TERMINAL -D INTEL_BDS

(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.

So, ultimately, I think you need three separate cases:

(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)

Again, this should be implemented on top of Roy's patch series.

Thanks
Laszlo
Roy Franz
2015-07-07 20:16:23 UTC
Permalink
Post by Laszlo Ersek
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.
The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.
(2) This patch should be rebased on Roy's recent patch set
[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769
In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with
-D TTY_TERMINAL -D INTEL_BDS
(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.
(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)
Again, this should be implemented on top of Roy's patch series.
Thanks
Laszlo
Hi Heyi,

Also, there is currently no support for text->guid conversion for
the tty terminal type, so you will need to use the
"VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)"
path element in place of "VenVt100()"

Roy
Laszlo Ersek
2015-07-07 20:28:48 UTC
Permalink
Post by Roy Franz
Post by Laszlo Ersek
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.
The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.
(2) This patch should be rebased on Roy's recent patch set
[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769
In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with
-D TTY_TERMINAL -D INTEL_BDS
(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.
(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)
Again, this should be implemented on top of Roy's patch series.
Thanks
Laszlo
Hi Heyi,
Also, there is currently no support for text->guid conversion for
the tty terminal type, so you will need to use the
"VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)"
path element in place of "VenVt100()"
Sorry, I don't understand; in which case is a VenMsg() textual
representation necessary?

All I had in mind was that

gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1

vs.

gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4

should be added several times, in accordance with the above conditions.
As far as I understand, the textual representation of any device path is
irrelevant here.

Thanks
Laszlo
Roy Franz
2015-07-07 20:37:14 UTC
Permalink
Post by Laszlo Ersek
Post by Roy Franz
Post by Laszlo Ersek
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.
The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.
(2) This patch should be rebased on Roy's recent patch set
[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769
In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with
-D TTY_TERMINAL -D INTEL_BDS
(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.
(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)
Again, this should be implemented on top of Roy's patch series.
Thanks
Laszlo
Hi Heyi,
Also, there is currently no support for text->guid conversion for
the tty terminal type, so you will need to use the
"VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)"
path element in place of "VenVt100()"
Sorry, I don't understand; in which case is a VenMsg() textual
representation necessary?
Well, the lines:
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"

are still in the DSC file, and as I understand the change, the
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType will only be used if
there _isn't_ a terminal type found in the device path. (For ARM BDS)
Post by Laszlo Ersek
All I had in mind was that
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
vs.
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
should be added several times, in accordance with the above conditions.
As far as I understand, the textual representation of any device path is
irrelevant here.
Yes, for the Intel BDS the text is irrelevant, and the change you
describe is needed as well. It's for the ARM BDS that I think
we still need the text device path change.
Post by Laszlo Ersek
Thanks
Laszlo
Laszlo Ersek
2015-07-07 20:57:00 UTC
Permalink
Post by Heyi Guo
Post by Laszlo Ersek
Post by Roy Franz
Post by Laszlo Ersek
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.
The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.
(2) This patch should be rebased on Roy's recent patch set
[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769
In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with
-D TTY_TERMINAL -D INTEL_BDS
(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.
(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)
Again, this should be implemented on top of Roy's patch series.
Thanks
Laszlo
Hi Heyi,
Also, there is currently no support for text->guid conversion for
the tty terminal type, so you will need to use the
"VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)"
path element in place of "VenVt100()"
Sorry, I don't understand; in which case is a VenMsg() textual
representation necessary?
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
are still in the DSC file, and as I understand the change, the
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType will only be used if
there _isn't_ a terminal type found in the device path. (For ARM BDS)
Post by Laszlo Ersek
All I had in mind was that
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
vs.
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
should be added several times, in accordance with the above conditions.
As far as I understand, the textual representation of any device path is
irrelevant here.
Yes, for the Intel BDS the text is irrelevant, and the change you
describe is needed as well. It's for the ARM BDS that I think
we still need the text device path change.
What for? For the (!INTEL_BDS && TTY_TERMINAL) case?

I didn't consider that case at all. I've been under the impression that
your TTY_TERMINAL series was meant for the INTEL_BDS case only.

If you are targeting the ARM BDS too with that terminal, then your patch
set should be extended too. (Again, AIUI.) Currently TTY_TERMINAL only
affects gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer, which is used
solely by ArmVirtPkg's Intel Platform BDS Lib instance. In my
understanding, Heyi's patch tries to set PcdDefaultTerminalType only
within preexistent branches (it doesn't introduce new branches).

Sorry, I'm a bit confused :)

Thanks
Laszlo
Roy Franz
2015-07-07 20:58:49 UTC
Permalink
Post by Laszlo Ersek
Post by Heyi Guo
Post by Laszlo Ersek
Post by Roy Franz
Post by Laszlo Ersek
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.
The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.
(2) This patch should be rebased on Roy's recent patch set
[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769
In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with
-D TTY_TERMINAL -D INTEL_BDS
(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.
(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)
Again, this should be implemented on top of Roy's patch series.
Thanks
Laszlo
Hi Heyi,
Also, there is currently no support for text->guid conversion for
the tty terminal type, so you will need to use the
"VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)"
path element in place of "VenVt100()"
Sorry, I don't understand; in which case is a VenMsg() textual
representation necessary?
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
are still in the DSC file, and as I understand the change, the
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType will only be used if
there _isn't_ a terminal type found in the device path. (For ARM BDS)
Post by Laszlo Ersek
All I had in mind was that
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
vs.
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
should be added several times, in accordance with the above conditions.
As far as I understand, the textual representation of any device path is
irrelevant here.
Yes, for the Intel BDS the text is irrelevant, and the change you
describe is needed as well. It's for the ARM BDS that I think
we still need the text device path change.
What for? For the (!INTEL_BDS && TTY_TERMINAL) case?
I didn't consider that case at all. I've been under the impression that
your TTY_TERMINAL series was meant for the INTEL_BDS case only.
If you are targeting the ARM BDS too with that terminal, then your patch
set should be extended too.
Yes, my patch should be extended to cover the ARM BDS case as well.
Backspace is broken there too :)

(Again, AIUI.) Currently TTY_TERMINAL only
Post by Laszlo Ersek
affects gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer, which is used
solely by ArmVirtPkg's Intel Platform BDS Lib instance. In my
understanding, Heyi's patch tries to set PcdDefaultTerminalType only
within preexistent branches (it doesn't introduce new branches).
Sorry, I'm a bit confused :)
Thanks
Laszlo
Heyi Guo
2015-07-08 08:30:30 UTC
Permalink
Hi Laszlo,

Thanks for your comments. I'll send another version when Roy's patches
are committed.
Post by Laszlo Ersek
comments below
Post by Heyi Guo
Change default terminal type to be VT100, to make it consistent with
default ConIn/ConOut device path.
I can't say this is a bug, as we can pass the whole console device
path to ConnectController, and TerminalDxe driver will pick up the
terminal in the remaining device path. However, in rare circumstances,
the console devices may be disconnected with the driver, and they will
be ignored by ConPlatformDxe until we pass the device path explicitly
just as BDS.
Changing default terminal type to be the same with console device
path could help serial terminal be reconnected with normal connect
controller operation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirtQemu.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0671469..0f104f3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -140,6 +140,8 @@
#
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"
+ ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
+ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
#
(1) When you mention that this brings the default terminal type in
accordance with the PCDs visible just above it: those PCDs are only used
by the ARM BDS. When ArmVirtQemu.dsc is built with -D INTEL_BDS, those
PCDs are not used.
The device path used for all of the consoles in case of -D INTEL_BDS is
hardcoded in the source. That device path happens to spceify VT100 too,
but the commit message doesn't reflect -D INTEL_BDS.
(2) This patch should be rebased on Roy's recent patch set
[PATCH V2 0/4] Add TtyTerm terminal type
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16769
In particular, *if* we're doing this, then PcdDefaultTerminalType should
be kept in sync with the devpath that is in effect with
-D TTY_TERMINAL -D INTEL_BDS
(please refer to patch #4 in Roy's series). Meaning, the
PcdDefaultTerminalType setting will have to depend on TTY_TERMINAL too.
(a) !INTEL_BDS --> VT100TYPE (value 1)
(b) INTEL_BDS && !TTY_TERMINAL --> VT100TYPE (value 1)
(c) INTEL_BDS && TTY_TERMINAL --> TTYTERMTYPE (value 4)
Again, this should be implemented on top of Roy's patch series.
Thanks
Laszlo
Heyi Guo
2015-07-07 16:56:30 UTC
Permalink
NullRemaining should be set to FALSE by fault and then be set to TRUE
conditionally.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <***@linaro.org>
---
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 966fb79..1897196 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -556,7 +556,7 @@ TerminalDriverBindingStart (
DefaultNode = NULL;
ConInSelected = FALSE;
ConOutSelected = FALSE;
- NullRemaining = TRUE;
+ NullRemaining = FALSE;
SimTxtInInstalled = FALSE;
SimTxtOutInstalled = FALSE;
FirstEnter = FALSE;
--
2.1.4
Ni, Ruiyu
2015-07-10 04:48:18 UTC
Permalink
-----Original Message-----
Sent: Wednesday, July 8, 2015 12:57 AM
Subject: [edk2] [PATCH 2/3] MdeModulePkg: TerminalDxe: Fix bug of
NullRemaining flag
NullRemaining should be set to FALSE by fault and then be set to TRUE
conditionally.
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 966fb79..1897196 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -556,7 +556,7 @@ TerminalDriverBindingStart (
DefaultNode = NULL;
ConInSelected = FALSE;
ConOutSelected = FALSE;
- NullRemaining = TRUE;
+ NullRemaining = FALSE;
SimTxtInInstalled = FALSE;
SimTxtOutInstalled = FALSE;
FirstEnter = FALSE;
--
2.1.4
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
Heyi Guo
2015-07-07 16:56:31 UTC
Permalink
1. Get default terminal type from PCD rather than using PCANSI
directly in BuildTeminalDevpath;
2. Only terminal type is needed to create an TerminalDev instance, so
remove the useless code of creating and freeing DefaultNode.
3. Some white space refining.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <***@linaro.org>
---
.../Universal/Console/TerminalDxe/Terminal.c | 27 ++++------------------
1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 1897196..3f50725 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -250,14 +250,13 @@ BuildTerminalDevpath (
EFI_STATUS Status;

TerminalDevicePath = NULL;
- TerminalType = PCANSITYPE;

//
// Use the RemainingDevicePath to determine the terminal type
//
Node = (VENDOR_DEVICE_PATH *) RemainingDevicePath;
if (Node == NULL) {
- TerminalType = PCANSITYPE;
+ TerminalType = PcdGet8 (PcdDefaultTerminalType);

} else if (CompareGuid (&Node->Guid, &gEfiPcAnsiGuid)) {

@@ -533,7 +532,6 @@ TerminalDriverBindingStart (
EFI_SERIAL_IO_PROTOCOL *SerialIo;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
VENDOR_DEVICE_PATH *Node;
- VENDOR_DEVICE_PATH *DefaultNode;
EFI_SERIAL_IO_MODE *Mode;
UINTN SerialInTimeOut;
TERMINAL_DEV *TerminalDevice;
@@ -553,9 +551,8 @@ TerminalDriverBindingStart (
UINTN ModeCount;

TerminalDevice = NULL;
- DefaultNode = NULL;
- ConInSelected = FALSE;
- ConOutSelected = FALSE;
+ ConInSelected = FALSE;
+ ConOutSelected = FALSE;
NullRemaining = FALSE;
SimTxtInInstalled = FALSE;
SimTxtOutInstalled = FALSE;
@@ -697,23 +694,14 @@ TerminalDriverBindingStart (
}

//
- // If RemainingDevicePath is NULL, then create default device path node
+ // If RemainingDevicePath is NULL, use default terminal type
//
if (RemainingDevicePath == NULL) {
- DefaultNode = AllocateZeroPool (sizeof (VENDOR_DEVICE_PATH));
- if (DefaultNode == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
-
TerminalType = PcdGet8 (PcdDefaultTerminalType);
//
// Must be between PCANSITYPE (0) and VTUTF8TYPE (3)
//
ASSERT (TerminalType <= VTUTF8TYPE);
-
- CopyMem (&DefaultNode->Guid, gTerminalType[TerminalType], sizeof (EFI_GUID));
- RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DefaultNode;
} else if (!IsDevicePathEnd (RemainingDevicePath)) {
//
// If RemainingDevicePath isn't the End of Device Path Node,
@@ -1151,9 +1139,6 @@ TerminalDriverBindingStart (
goto Error;
}
}
- if (DefaultNode != NULL) {
- FreePool (DefaultNode);
- }

return EFI_SUCCESS;

@@ -1222,10 +1207,6 @@ Error:
}
}

- if (DefaultNode != NULL) {
- FreePool (DefaultNode);
- }
-
This->Stop (This, Controller, 0, NULL);

return Status;
--
2.1.4
Ni, Ruiyu
2015-07-10 04:46:14 UTC
Permalink
-----Original Message-----
Sent: Wednesday, July 8, 2015 12:57 AM
Subject: [edk2] [PATCH 3/3] MdeModulePkg: Some improvements on
TerminalDxe
1. Get default terminal type from PCD rather than using PCANSI
directly in BuildTeminalDevpath;
2. Only terminal type is needed to create an TerminalDev instance, so
remove the useless code of creating and freeing DefaultNode.
3. Some white space refining.
Contributed-under: TianoCore Contribution Agreement 1.0
---
.../Universal/Console/TerminalDxe/Terminal.c | 27
++++------------------
1 file changed, 4 insertions(+), 23 deletions(-)
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 1897196..3f50725 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -250,14 +250,13 @@ BuildTerminalDevpath (
EFI_STATUS Status;
TerminalDevicePath = NULL;
- TerminalType = PCANSITYPE;
//
// Use the RemainingDevicePath to determine the terminal type
//
Node = (VENDOR_DEVICE_PATH *) RemainingDevicePath;
if (Node == NULL) {
- TerminalType = PCANSITYPE;
+ TerminalType = PcdGet8 (PcdDefaultTerminalType);
} else if (CompareGuid (&Node->Guid, &gEfiPcAnsiGuid)) {
@@ -533,7 +532,6 @@ TerminalDriverBindingStart (
EFI_SERIAL_IO_PROTOCOL *SerialIo;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
VENDOR_DEVICE_PATH *Node;
- VENDOR_DEVICE_PATH *DefaultNode;
EFI_SERIAL_IO_MODE *Mode;
UINTN SerialInTimeOut;
TERMINAL_DEV *TerminalDevice;
@@ -553,9 +551,8 @@ TerminalDriverBindingStart (
UINTN ModeCount;
TerminalDevice = NULL;
- DefaultNode = NULL;
- ConInSelected = FALSE;
- ConOutSelected = FALSE;
+ ConInSelected = FALSE;
+ ConOutSelected = FALSE;
NullRemaining = FALSE;
SimTxtInInstalled = FALSE;
SimTxtOutInstalled = FALSE;
@@ -697,23 +694,14 @@ TerminalDriverBindingStart (
}
//
- // If RemainingDevicePath is NULL, then create default device path node
+ // If RemainingDevicePath is NULL, use default terminal type
//
if (RemainingDevicePath == NULL) {
- DefaultNode = AllocateZeroPool (sizeof (VENDOR_DEVICE_PATH));
- if (DefaultNode == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
-
TerminalType = PcdGet8 (PcdDefaultTerminalType);
//
// Must be between PCANSITYPE (0) and VTUTF8TYPE (3)
//
ASSERT (TerminalType <= VTUTF8TYPE);
-
- CopyMem (&DefaultNode->Guid, gTerminalType[TerminalType], sizeof (EFI_GUID));
- RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL *)
DefaultNode;
} else if (!IsDevicePathEnd (RemainingDevicePath)) {
//
// If RemainingDevicePath isn't the End of Device Path Node,
@@ -1151,9 +1139,6 @@ TerminalDriverBindingStart (
goto Error;
}
}
- if (DefaultNode != NULL) {
- FreePool (DefaultNode);
- }
return EFI_SUCCESS;
}
}
- if (DefaultNode != NULL) {
- FreePool (DefaultNode);
- }
-
This->Stop (This, Controller, 0, NULL);
return Status;
--
2.1.4
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
Loading...