public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
@ 2017-06-06 10:20 GN Keshava
  2017-06-06 15:45 ` Carsey, Jaben
  0 siblings, 1 reply; 6+ messages in thread
From: GN Keshava @ 2017-06-06 10:20 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Hi,

Thanks all for your kind help.

I'm doing few operations using serial port. So, I've done a small serial
driver by referring FTDI code, and I'm accessing this using serialIO from
my application. and it was working fine with older EFI shell.

Now I'm using the latest UEFI shell.
Now It's working fine for first time. Then if i do any removal and connect
of serial port, there is a mismatch in "Handle index" value between the one
i get in my application, and the one i get in "sermode" command.

I'm using the same code as sermode code, but still, for the same Handle
value, the handleIndex value is deferring.

Whether ConvertHandleIndexToHandle and ConvertHandleToHandleIndex functions
are giving issue? What could be the reason?

Thanks again.
Regards,
Keshava


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
  2017-06-06 10:20 Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex GN Keshava
@ 2017-06-06 15:45 ` Carsey, Jaben
  2017-06-06 16:12   ` GN Keshava
  0 siblings, 1 reply; 6+ messages in thread
From: Carsey, Jaben @ 2017-06-06 15:45 UTC (permalink / raw)
  To: GN Keshava, edk2-devel@lists.01.org

That library may require the module to be linked into the shell.  Remember that the sermode command is actually in the same binary as the shell and the shell and the command are sharing information through libraries.

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> GN Keshava
> Sent: Tuesday, June 06, 2017 3:20 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Issue in ConvertHandleIndexToHandle and
> ConvertHandleToHandleIndex
> Importance: High
> 
> Hi,
> 
> Thanks all for your kind help.
> 
> I'm doing few operations using serial port. So, I've done a small serial
> driver by referring FTDI code, and I'm accessing this using serialIO from
> my application. and it was working fine with older EFI shell.
> 
> Now I'm using the latest UEFI shell.
> Now It's working fine for first time. Then if i do any removal and connect
> of serial port, there is a mismatch in "Handle index" value between the one
> i get in my application, and the one i get in "sermode" command.
> 
> I'm using the same code as sermode code, but still, for the same Handle
> value, the handleIndex value is deferring.
> 
> Whether ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
> functions
> are giving issue? What could be the reason?
> 
> Thanks again.
> Regards,
> Keshava
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
  2017-06-06 15:45 ` Carsey, Jaben
@ 2017-06-06 16:12   ` GN Keshava
  2017-06-06 16:15     ` Carsey, Jaben
  0 siblings, 1 reply; 6+ messages in thread
From: GN Keshava @ 2017-06-06 16:12 UTC (permalink / raw)
  To: Carsey, Jaben, edk2-devel@lists.01.org

Hi Jaben,

Thanks for the reply.


I understand that the sermode command is in shell, and it's sharing
information through libraries.


Can you tell me more about the library requirement of module to be linked
into shell? How i can do this?


Thanks again.

Regards,

Keshava

On Tue, Jun 6, 2017, 9:15 PM Carsey, Jaben <jaben.carsey@intel.com> wrote:

> That library may require the module to be linked into the shell.  Remember
> that the sermode command is actually in the same binary as the shell and
> the shell and the command are sharing information through libraries.
>
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, June 06, 2017 3:20 AM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] Issue in ConvertHandleIndexToHandle and
> > ConvertHandleToHandleIndex
> > Importance: High
> >
> > Hi,
> >
> > Thanks all for your kind help.
> >
> > I'm doing few operations using serial port. So, I've done a small serial
> > driver by referring FTDI code, and I'm accessing this using serialIO from
> > my application. and it was working fine with older EFI shell.
> >
> > Now I'm using the latest UEFI shell.
> > Now It's working fine for first time. Then if i do any removal and
> connect
> > of serial port, there is a mismatch in "Handle index" value between the
> one
> > i get in my application, and the one i get in "sermode" command.
> >
> > I'm using the same code as sermode code, but still, for the same Handle
> > value, the handleIndex value is deferring.
> >
> > Whether ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
> > functions
> > are giving issue? What could be the reason?
> >
> > Thanks again.
> > Regards,
> > Keshava
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
  2017-06-06 16:12   ` GN Keshava
@ 2017-06-06 16:15     ` Carsey, Jaben
  2017-06-06 16:32       ` GN Keshava
  0 siblings, 1 reply; 6+ messages in thread
From: Carsey, Jaben @ 2017-06-06 16:15 UTC (permalink / raw)
  To: GN Keshava, edk2-devel@lists.01.org

In general, you should really try to avoid it.  it means you have to build and distribute a complete shell instead of a single application.  There are some shell commands that simply cannot function without information not available via the shell protocol.  If you find you need information, then maybe we should consider that missing information to be added to the shell protocol.

-Jaben

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> GN Keshava
> Sent: Tuesday, June 06, 2017 9:12 AM
> To: Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] Issue in ConvertHandleIndexToHandle and
> ConvertHandleToHandleIndex
> Importance: High
> 
> Hi Jaben,
> 
> Thanks for the reply.
> 
> 
> I understand that the sermode command is in shell, and it's sharing
> information through libraries.
> 
> 
> Can you tell me more about the library requirement of module to be linked
> into shell? How i can do this?
> 
> 
> Thanks again.
> 
> Regards,
> 
> Keshava
> 
> On Tue, Jun 6, 2017, 9:15 PM Carsey, Jaben <jaben.carsey@intel.com>
> wrote:
> 
> > That library may require the module to be linked into the shell.  Remember
> > that the sermode command is actually in the same binary as the shell and
> > the shell and the command are sharing information through libraries.
> >
> > > -----Original Message-----
> > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > > GN Keshava
> > > Sent: Tuesday, June 06, 2017 3:20 AM
> > > To: edk2-devel@lists.01.org
> > > Subject: [edk2] Issue in ConvertHandleIndexToHandle and
> > > ConvertHandleToHandleIndex
> > > Importance: High
> > >
> > > Hi,
> > >
> > > Thanks all for your kind help.
> > >
> > > I'm doing few operations using serial port. So, I've done a small serial
> > > driver by referring FTDI code, and I'm accessing this using serialIO from
> > > my application. and it was working fine with older EFI shell.
> > >
> > > Now I'm using the latest UEFI shell.
> > > Now It's working fine for first time. Then if i do any removal and
> > connect
> > > of serial port, there is a mismatch in "Handle index" value between the
> > one
> > > i get in my application, and the one i get in "sermode" command.
> > >
> > > I'm using the same code as sermode code, but still, for the same Handle
> > > value, the handleIndex value is deferring.
> > >
> > > Whether ConvertHandleIndexToHandle and
> ConvertHandleToHandleIndex
> > > functions
> > > are giving issue? What could be the reason?
> > >
> > > Thanks again.
> > > 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] 6+ messages in thread

* Re: Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
  2017-06-06 16:15     ` Carsey, Jaben
@ 2017-06-06 16:32       ` GN Keshava
  2017-06-06 21:06         ` Carsey, Jaben
  0 siblings, 1 reply; 6+ messages in thread
From: GN Keshava @ 2017-06-06 16:32 UTC (permalink / raw)
  To: Carsey, Jaben, edk2-devel@lists.01.org

Thanks Jaben.

I expected this answer. :) Definitely I can't do that as of now.

But do you think this would cause mismatch between the handle index that i
get in my application? The handle index I'm getting is differing, even if
the handle value is same.

And, could you suggest any other ways to fix this, other than embedding my
app into the shell?

Or do you suggest my temporary workaround , in which I'm embedding my own
sermode functionality inside my application ? The functionality​ is working
and I'm able to use com port. But it's annoying to have different
information in app than a shell command! :(

Thanks again.
Regards,
Keshava

On Tue, Jun 6, 2017, 9:45 PM Carsey, Jaben <jaben.carsey@intel.com> wrote:

> In general, you should really try to avoid it.  it means you have to build
> and distribute a complete shell instead of a single application.  There are
> some shell commands that simply cannot function without information not
> available via the shell protocol.  If you find you need information, then
> maybe we should consider that missing information to be added to the shell
> protocol.
>
> -Jaben
>
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, June 06, 2017 9:12 AM
> > To: Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org
> > Subject: Re: [edk2] Issue in ConvertHandleIndexToHandle and
> > ConvertHandleToHandleIndex
> > Importance: High
> >
> > Hi Jaben,
> >
> > Thanks for the reply.
> >
> >
> > I understand that the sermode command is in shell, and it's sharing
> > information through libraries.
> >
> >
> > Can you tell me more about the library requirement of module to be linked
> > into shell? How i can do this?
> >
> >
> > Thanks again.
> >
> > Regards,
> >
> > Keshava
> >
> > On Tue, Jun 6, 2017, 9:15 PM Carsey, Jaben <jaben.carsey@intel.com>
> > wrote:
> >
> > > That library may require the module to be linked into the shell.
> Remember
> > > that the sermode command is actually in the same binary as the shell
> and
> > > the shell and the command are sharing information through libraries.
> > >
> > > > -----Original Message-----
> > > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
> Of
> > > > GN Keshava
> > > > Sent: Tuesday, June 06, 2017 3:20 AM
> > > > To: edk2-devel@lists.01.org
> > > > Subject: [edk2] Issue in ConvertHandleIndexToHandle and
> > > > ConvertHandleToHandleIndex
> > > > Importance: High
> > > >
> > > > Hi,
> > > >
> > > > Thanks all for your kind help.
> > > >
> > > > I'm doing few operations using serial port. So, I've done a small
> serial
> > > > driver by referring FTDI code, and I'm accessing this using serialIO
> from
> > > > my application. and it was working fine with older EFI shell.
> > > >
> > > > Now I'm using the latest UEFI shell.
> > > > Now It's working fine for first time. Then if i do any removal and
> > > connect
> > > > of serial port, there is a mismatch in "Handle index" value between
> the
> > > one
> > > > i get in my application, and the one i get in "sermode" command.
> > > >
> > > > I'm using the same code as sermode code, but still, for the same
> Handle
> > > > value, the handleIndex value is deferring.
> > > >
> > > > Whether ConvertHandleIndexToHandle and
> > ConvertHandleToHandleIndex
> > > > functions
> > > > are giving issue? What could be the reason?
> > > >
> > > > Thanks again.
> > > > 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] 6+ messages in thread

* Re: Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
  2017-06-06 16:32       ` GN Keshava
@ 2017-06-06 21:06         ` Carsey, Jaben
  0 siblings, 0 replies; 6+ messages in thread
From: Carsey, Jaben @ 2017-06-06 21:06 UTC (permalink / raw)
  To: GN Keshava, edk2-devel@lists.01.org

The problem is how the library assigns “handle indexes”… it just keeps a list of the ones it has given out and only supports those.

Your application is linked to the library and is keeping it’s own version of this list.  So when you request a handle index, it gives you one… but your version of the list has nothing to do with the shell’s version.

Sadly, the UEFI Shell spec doesn’t assume that shell applications will want access to the handle index concept that I can think of.

I think that your current solution is the best one.

-Jaben

From: GN Keshava [mailto:keshava.gn@gmail.com]
Sent: Tuesday, June 06, 2017 9:32 AM
To: Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex
Importance: High


Thanks Jaben.

I expected this answer. :) Definitely I can't do that as of now.

But do you think this would cause mismatch between the handle index that i get in my application? The handle index I'm getting is differing, even if the handle value is same.

And, could you suggest any other ways to fix this, other than embedding my app into the shell?

Or do you suggest my temporary workaround , in which I'm embedding my own sermode functionality inside my application ? The functionality​ is working and I'm able to use com port. But it's annoying to have different information in app than a shell command! :(

Thanks again.
Regards,
Keshava

On Tue, Jun 6, 2017, 9:45 PM Carsey, Jaben <jaben.carsey@intel.com<mailto:jaben.carsey@intel.com>> wrote:
In general, you should really try to avoid it.  it means you have to build and distribute a complete shell instead of a single application.  There are some shell commands that simply cannot function without information not available via the shell protocol.  If you find you need information, then maybe we should consider that missing information to be added to the shell protocol.

-Jaben

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org<mailto:edk2-devel-bounces@lists.01.org>] On Behalf Of
> GN Keshava
> Sent: Tuesday, June 06, 2017 9:12 AM
> To: Carsey, Jaben <jaben.carsey@intel.com<mailto:jaben.carsey@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Subject: Re: [edk2] Issue in ConvertHandleIndexToHandle and
> ConvertHandleToHandleIndex
> Importance: High
>
> Hi Jaben,
>
> Thanks for the reply.
>
>
> I understand that the sermode command is in shell, and it's sharing
> information through libraries.
>
>
> Can you tell me more about the library requirement of module to be linked
> into shell? How i can do this?
>
>
> Thanks again.
>
> Regards,
>
> Keshava
>
> On Tue, Jun 6, 2017, 9:15 PM Carsey, Jaben <jaben.carsey@intel.com<mailto:jaben.carsey@intel.com>>
> wrote:
>
> > That library may require the module to be linked into the shell.  Remember
> > that the sermode command is actually in the same binary as the shell and
> > the shell and the command are sharing information through libraries.
> >
> > > -----Original Message-----
> > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org<mailto:edk2-devel-bounces@lists.01.org>] On Behalf Of
> > > GN Keshava
> > > Sent: Tuesday, June 06, 2017 3:20 AM
> > > To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> > > Subject: [edk2] Issue in ConvertHandleIndexToHandle and
> > > ConvertHandleToHandleIndex
> > > Importance: High
> > >
> > > Hi,
> > >
> > > Thanks all for your kind help.
> > >
> > > I'm doing few operations using serial port. So, I've done a small serial
> > > driver by referring FTDI code, and I'm accessing this using serialIO from
> > > my application. and it was working fine with older EFI shell.
> > >
> > > Now I'm using the latest UEFI shell.
> > > Now It's working fine for first time. Then if i do any removal and
> > connect
> > > of serial port, there is a mismatch in "Handle index" value between the
> > one
> > > i get in my application, and the one i get in "sermode" command.
> > >
> > > I'm using the same code as sermode code, but still, for the same Handle
> > > value, the handleIndex value is deferring.
> > >
> > > Whether ConvertHandleIndexToHandle and
> ConvertHandleToHandleIndex
> > > functions
> > > are giving issue? What could be the reason?
> > >
> > > Thanks again.
> > > Regards,
> > > Keshava
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> > > https://lists.01.org/mailman/listinfo/edk2-devel
> >
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-06 21:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-06 10:20 Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex GN Keshava
2017-06-06 15:45 ` Carsey, Jaben
2017-06-06 16:12   ` GN Keshava
2017-06-06 16:15     ` Carsey, Jaben
2017-06-06 16:32       ` GN Keshava
2017-06-06 21:06         ` Carsey, Jaben

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox