* COM port usage in UEFI
@ 2016-10-25 9:30 GN Keshava
2016-10-25 16:50 ` Andrew Fish
0 siblings, 1 reply; 3+ messages in thread
From: GN Keshava @ 2016-10-25 9:30 UTC (permalink / raw)
To: edk2-devel@lists.01.org
Hi all,
In my UEFI application, I'm using Serial protocol to access COM port. I'm
able to access COM port successfully.
But I'm confused on how we can get user input regarding which COM port the
user wants to access.
*Example, I have already a Windows application for the same, where user
selects the COM port number he wants to access, such as COM1: , COM30: etc.*
In UEFI, I'm using COM port Handle Index (which user gets/uses in
*sermod *command,
like , *myapp.efi 31F* , where 31F is com port handle index).
Is this best way possible in UEFI? Or is it better to use HANDLE itself? Or
is there any way to get input as COM port number same as Windows app?
Thanks!
Regards,
Keshava
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: COM port usage in UEFI
2016-10-25 9:30 COM port usage in UEFI GN Keshava
@ 2016-10-25 16:50 ` Andrew Fish
2016-10-25 16:57 ` Michael Zimmermann
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Fish @ 2016-10-25 16:50 UTC (permalink / raw)
To: GN Keshava; +Cc: edk2-devel@lists.01.org
> On Oct 25, 2016, at 2:30 AM, GN Keshava <keshava.gn@gmail.com> wrote:
>
> Hi all,
>
> In my UEFI application, I'm using Serial protocol to access COM port. I'm
> able to access COM port successfully.
>
> But I'm confused on how we can get user input regarding which COM port the
> user wants to access.
>
> *Example, I have already a Windows application for the same, where user
> selects the COM port number he wants to access, such as COM1: , COM30: etc.*
>
> In UEFI, I'm using COM port Handle Index (which user gets/uses in
> *sermod *command,
> like , *myapp.efi 31F* , where 31F is com port handle index).
>
> Is this best way possible in UEFI? Or is it better to use HANDLE itself? Or
> is there any way to get input as COM port number same as Windows app?
>
Keshava,
COM ports are kind of an early PC and DOS concept. I think the naming convention for COM1 - COM4 is based on I/O port and after that I'm not clear how it works, I guess that is made up by the OS?
The ISA base (PC) Serial Driver is here: https://github.com/tianocore/edk2/tree/master/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe <https://github.com/tianocore/edk2/tree/master/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe>
Looks like it produces a Component Name protocol that produces human readable strings for the port. That is probably the best thing to use in EFI. The other alternative is to use the device path on the handle, and attempt to decode that, but in doing that you are making assumptions about how the hardware works, so that could fail. For an ISA Bus there should be an ACPI Device Path node that has the HID and UID for the device.
Thanks,
Andrew Fish
> Thanks!
> Regards,
> Keshava
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: COM port usage in UEFI
2016-10-25 16:50 ` Andrew Fish
@ 2016-10-25 16:57 ` Michael Zimmermann
0 siblings, 0 replies; 3+ messages in thread
From: Michael Zimmermann @ 2016-10-25 16:57 UTC (permalink / raw)
To: Andrew Fish; +Cc: GN Keshava, edk2-devel@lists.01.org
COM ports may have had a naming scheme in past but in recent windows
versions you are allowed to assign any COM name to any device - even USB.
So he should really just obtain a handle to the correct protocol and try to
choose/configure the correct port if there is more than one.
Thanks
Michael
On Tue, Oct 25, 2016 at 6:50 PM, Andrew Fish <afish@apple.com> wrote:
>
> > On Oct 25, 2016, at 2:30 AM, GN Keshava <keshava.gn@gmail.com> wrote:
> >
> > Hi all,
> >
> > In my UEFI application, I'm using Serial protocol to access COM port. I'm
> > able to access COM port successfully.
> >
> > But I'm confused on how we can get user input regarding which COM port
> the
> > user wants to access.
> >
> > *Example, I have already a Windows application for the same, where user
> > selects the COM port number he wants to access, such as COM1: , COM30:
> etc.*
> >
> > In UEFI, I'm using COM port Handle Index (which user gets/uses in
> > *sermod *command,
> > like , *myapp.efi 31F* , where 31F is com port handle index).
> >
> > Is this best way possible in UEFI? Or is it better to use HANDLE itself?
> Or
> > is there any way to get input as COM port number same as Windows app?
> >
>
> Keshava,
>
> COM ports are kind of an early PC and DOS concept. I think the naming
> convention for COM1 - COM4 is based on I/O port and after that I'm not
> clear how it works, I guess that is made up by the OS?
>
> The ISA base (PC) Serial Driver is here: https://github.com/tianocore/
> edk2/tree/master/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe <
> https://github.com/tianocore/edk2/tree/master/IntelFrameworkModulePkg/Bus/
> Isa/IsaSerialDxe>
>
> Looks like it produces a Component Name protocol that produces human
> readable strings for the port. That is probably the best thing to use in
> EFI. The other alternative is to use the device path on the handle, and
> attempt to decode that, but in doing that you are making assumptions about
> how the hardware works, so that could fail. For an ISA Bus there should be
> an ACPI Device Path node that has the HID and UID for the device.
>
> Thanks,
>
> Andrew Fish
>
> > Thanks!
> > Regards,
> > Keshava
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-25 16:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-25 9:30 COM port usage in UEFI GN Keshava
2016-10-25 16:50 ` Andrew Fish
2016-10-25 16:57 ` Michael Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox