Re: [edk2] EDK2 build using Visual Studio

2017-06-08 Thread GN Keshava
Hi Liming,

Sorry, I mixed up the things :(

If I try VS2015x86 , I'm getting this error:

Build environment: Windows-post2008Server-6.2.9200
Build start time: 15:54:28, Jun.08 2017

build: : warning: Tool chain [VS2015x86] is not defined


build...
 : error 4000: Not available
[VS2015x86] not defined. No toolchain available for build!


- Failed -
Build end time: 15:54:28, Jun.08 2017
Build total time: 00:00:00

Am I missing anything here?

Thanks.
Regards,
Keshava

On Mon, 5 Jun 2017 at 20:16 Andrew Fish <af...@apple.com> wrote:

>
> > On Jun 5, 2017, at 7:04 AM, Gao, Liming <liming@intel.com> wrote:
> >
> > _fltused  symbol is generated by compiler. You can just define this
> symbol in one C file to satisfy the linker like below:
> >
> > int _fltused = 1;
> >
>
> Keshava,
>
> Looks like _fltused is emitted by the MSVC to tell the C runtime it needs
> to link in floating point libraries. EFI edk2 code does not support
> floating point, so you may run into porting issues from tool chain to
> toolchain if you use floating point.
>
> Thanks,
>
> Andrew Fish
>
>
> > Thanks
> > Liming
> > From: GN Keshava [mailto:keshava...@gmail.com]
> > Sent: Monday, June 5, 2017 9:04 PM
> > To: Gao, Liming <liming@intel.com>; edk2-devel@lists.01.org
> > Cc: Carsey, Jaben <jaben.car...@intel.com>
> > Subject: Re: [edk2] EDK2 build using Visual Studio
> >
> > Hi Liming,
> >
> > Thanks for the reply.
> > I had tried this, but was getting errors that I didn't get on VS2008,
> mainly, error LNK2001 unresolved external symbol __fltused
> >
> > I didnt get this error on VS2008, but the same workspace is giving this
> error on VS2015. :(
> >
> > Thanks.
> > With regards,
> > Keshava
> >
> >
> > On Mon, 5 Jun 2017 at 18:13 Gao, Liming <liming@intel.com liming@intel.com>> wrote:
> > Keshava:
> >  You can build platform with -t VS2015 or -t VS2015x86 to enable VS2015
> tool chain.
> >
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org edk2-devel-boun...@lists.01.org>] On Behalf Of GN Keshava
> >> Sent: Monday, June 5, 2017 4:23 PM
> >> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> >> Cc: Carsey, Jaben <jaben.car...@intel.com<mailto:jaben.car...@intel.com
> >>
> >> Subject: [edk2] EDK2 build using Visual Studio
> >>
> >> Hi,
> >>
> >> I was able to build EDK2 using VS2008. Did anyone used VS2015 and built
> the
> >> EDK2?
> >> If yes, I want to know how I can do it.
> >>
> >> Thanks.
> >> With 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
> > 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


Re: [edk2] Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex

2017-06-06 Thread GN Keshava
Thanks a lot for the detailed answer, Jaben.

Regards,
Keshava

On Wed, Jun 7, 2017, 2:36 AM Carsey, Jaben <jaben.car...@intel.com> wrote:

> 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...@gmail.com]
> *Sent:* Tuesday, June 06, 2017 9:32 AM
>
>
> *To:* Carsey, Jaben <jaben.car...@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.car...@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-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, June 06, 2017 9:12 AM
> > To: Carsey, Jaben <jaben.car...@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.car...@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-boun...@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 c

Re: [edk2] Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex

2017-06-06 Thread GN Keshava
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.car...@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-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, June 06, 2017 9:12 AM
> > To: Carsey, Jaben <jaben.car...@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.car...@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-boun...@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
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex

2017-06-06 Thread GN Keshava
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.car...@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-boun...@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


[edk2] Issue in ConvertHandleIndexToHandle and ConvertHandleToHandleIndex

2017-06-06 Thread GN Keshava
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


Re: [edk2] EDK2 build using Visual Studio

2017-06-05 Thread GN Keshava
Hi Liming,

Thanks for the reply.
I had tried this, but was getting errors that I didn't get on VS2008,
mainly, error LNK2001 unresolved external symbol __fltused

I didnt get this error on VS2008, but the same workspace is giving this
error on VS2015. :(

Thanks.
With regards,
Keshava


On Mon, 5 Jun 2017 at 18:13 Gao, Liming <liming@intel.com> wrote:

> Keshava:
>   You can build platform with -t VS2015 or -t VS2015x86 to enable VS2015
> tool chain.
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> GN Keshava
> > Sent: Monday, June 5, 2017 4:23 PM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben <jaben.car...@intel.com>
> > Subject: [edk2] EDK2 build using Visual Studio
> >
> > Hi,
> >
> > I was able to build EDK2 using VS2008. Did anyone used VS2015 and built
> the
> > EDK2?
> > If yes, I want to know how I can do it.
> >
> > Thanks.
> > With 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


[edk2] EDK2 build using Visual Studio

2017-06-05 Thread GN Keshava
Hi,

I was able to build EDK2 using VS2008. Did anyone used VS2015 and built the
EDK2?
If yes, I want to know how I can do it.

Thanks.
With regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Unmount and mount a mass storage from shell

2017-05-31 Thread GN Keshava
Thanks Jaben,

I will test this...

Thanks a lot for the help...

Regards,
Keshava

On Wed, May 31, 2017, 9:23 PM Carsey, Jaben <jaben.car...@intel.com> wrote:

> Keshava,
>
> After you remove and replug it, I think you need to do "connect -r" to
> recursively reconnect drivers, then do the "map -r" to generate a new
> mapping.
>
> Reconnecting drivers is standard user behavior after plug in a USB
> device.  It is not expected to happen automatically.
>
> -Jaben
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, May 30, 2017 8:35 PM
> > To: Carsey, Jaben <jaben.car...@intel.com>; edk2-devel@lists.01.org
> > Subject: Re: [edk2] Unmount and mount a mass storage from shell
> > Importance: High
> >
> > Hi Jaben,
> >
> > Thanks a lot for your input.
> >
> > As I have mentioned in previous mail, I'm facing an issue now, that, If I
> > reconnect my client device, the mass storage is not able to mount again
> > automatically.
> > Here is few more details. Expecting some help on this :
> >
> > I connect the the client device to UEFI host. I get the mass storage
> > successfully. (device is listed as Mass storage in devices command)
> > The client device also has serial CDC functionality (It is Linux CDC
> > gadget, which will enumerate as both Mass storage (FAT32) and CDC serial
> > com port).
> > To use serial port, I have developed a custom serial driver. I use VID
> PID
> > of the device in this custom driver to bind the driver to the device. I
> > load this driver, and I get serial port (It is listed in sermode command)
> > Now I refresh the mapping using map -r. Still I get the mass storage of
> > device, and I'm able to access it correctly.
> > Now I disconnect the client from host (UEFI) by unplugging the device.
> > When I connect the device again, I'm not able to get Mass storage if i
> run
> > map -r. But serial port will start to work fine again.
> >
> > If I run devices command, it is not shown as mass storage. but as linux
> > gadget.
> > Now if I use disconnect command, and followed by connect command to this
> > device with mass storage driver, I'm able to mount the mass storage and
> use
> > it.
> > The issue is present if I load my serial driver, which uses device's VID
> > PID. If I unload this driver and do the unplug-plug, I'm able to get mass
> > storage automatically..
> >
> > What could be the issue? Is there any way to solve this?
> >
> > (sorry for long post, it's difficult to explain otherwise)
> >
> > Thanks again.
> > Regards,
> > Keshava
> >
> > On Tue, 30 May 2017 at 20:56 Carsey, Jaben <jaben.car...@intel.com>
> > wrote:
> >
> > > I think that you will always need to inform the UEFI Shell of the
> change.
> > > It is not designed to automatically do detection of
> > added/removed/changed
> > > devices.
> > >
> > >
> > >
> > > I think that your solution to use the code from mount makes the most
> > sense.
> > >
> > >
> > >
> > > -Jaben
> > >
> > >
> > >
> > > *From:* GN Keshava [mailto:keshava...@gmail.com]
> > > *Sent:* Thursday, May 25, 2017 11:02 PM
> > > *To:* Carsey, Jaben <jaben.car...@intel.com>; edk2-devel@lists.01.org
> > > *Subject:* Re: [edk2] Unmount and mount a mass storage from shell
> > > *Importance:* High
> > >
> > >
> > >
> > > Hi Jaben, Thanks a lot for input. My necessity for unmount-mount is
> that,
> > > the USB client is a Linux storage gadget, which needs to be remounted
> to
> > > get the updated/new files created by Linux. Anyhow, now I'm doing this
> > > programmatically by copying mount command code from older shell. :)
> > >
> > >
> > >
> > > One more issue is that, after Linux updates some file (on client side,
> > > Linux will mount the same partition, save some file, and then umount
> the
> > > partition. Then if i remount the partition on Host side, when host is
> > > windows, i will get updated files) I will manually remove and connect
> the
> > > cable (MS device), UEFI is not able to detect the MS itself. (This
> issue
> > > observed, regardless of remount. This issue is not there on windows 10
> > > host).
> > >
> > > Can you give some pointers on this?
> > >
> > >
> > >
>

Re: [edk2] Unmount and mount a mass storage from shell

2017-05-30 Thread GN Keshava
Hi Jaben,

Thanks a lot for your input.

As I have mentioned in previous mail, I'm facing an issue now, that, If I
reconnect my client device, the mass storage is not able to mount again
automatically.
Here is few more details. Expecting some help on this :

I connect the the client device to UEFI host. I get the mass storage
successfully. (device is listed as Mass storage in devices command)
The client device also has serial CDC functionality (It is Linux CDC
gadget, which will enumerate as both Mass storage (FAT32) and CDC serial
com port).
To use serial port, I have developed a custom serial driver. I use VID PID
of the device in this custom driver to bind the driver to the device. I
load this driver, and I get serial port (It is listed in sermode command)
Now I refresh the mapping using map -r. Still I get the mass storage of
device, and I'm able to access it correctly.
Now I disconnect the client from host (UEFI) by unplugging the device.
When I connect the device again, I'm not able to get Mass storage if i run
map -r. But serial port will start to work fine again.

If I run devices command, it is not shown as mass storage. but as linux
gadget.
Now if I use disconnect command, and followed by connect command to this
device with mass storage driver, I'm able to mount the mass storage and use
it.
The issue is present if I load my serial driver, which uses device's VID
PID. If I unload this driver and do the unplug-plug, I'm able to get mass
storage automatically..

What could be the issue? Is there any way to solve this?

(sorry for long post, it's difficult to explain otherwise)

Thanks again.
Regards,
Keshava

On Tue, 30 May 2017 at 20:56 Carsey, Jaben <jaben.car...@intel.com> wrote:

> I think that you will always need to inform the UEFI Shell of the change.
> It is not designed to automatically do detection of added/removed/changed
> devices.
>
>
>
> I think that your solution to use the code from mount makes the most sense.
>
>
>
> -Jaben
>
>
>
> *From:* GN Keshava [mailto:keshava...@gmail.com]
> *Sent:* Thursday, May 25, 2017 11:02 PM
> *To:* Carsey, Jaben <jaben.car...@intel.com>; edk2-devel@lists.01.org
> *Subject:* Re: [edk2] Unmount and mount a mass storage from shell
> *Importance:* High
>
>
>
> Hi Jaben, Thanks a lot for input. My necessity for unmount-mount is that,
> the USB client is a Linux storage gadget, which needs to be remounted to
> get the updated/new files created by Linux. Anyhow, now I'm doing this
> programmatically by copying mount command code from older shell. :)
>
>
>
> One more issue is that, after Linux updates some file (on client side,
> Linux will mount the same partition, save some file, and then umount the
> partition. Then if i remount the partition on Host side, when host is
> windows, i will get updated files) I will manually remove and connect the
> cable (MS device), UEFI is not able to detect the MS itself. (This issue
> observed, regardless of remount. This issue is not there on windows 10
> host).
>
> Can you give some pointers on this?
>
>
>
> Thanks a lot, Jaben.
>
>
>
> Regards,
>
> Keshava
>
>
>
> On Thu, 25 May 2017 at 21:26 Carsey, Jaben <jaben.car...@intel.com> wrote:
>
> You can "disconnect" the driver
> You can do "map -d" to delete a mapping
>
> I am unsure what your goals are for mount/unmount
>
> -Jaben
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Wednesday, May 24, 2017 10:59 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] Unmount and mount a mass storage from shell
> > Importance: High
> >
> > How can I unmount and mount a mass storage fs from UEFI shell?
> >
> > In older EFI shells, I can do with "mount" command. But it just does
> > "mapping" in newer shell. It doesn't actually remounting the device.
> >
> > Please help.
> >
> > thanks
> > ___
> > 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


Re: [edk2] Unmount and mount a mass storage from shell

2017-05-26 Thread GN Keshava
Hi Jaben, Thanks a lot for input. My necessity for unmount-mount is that,
the USB client is a Linux storage gadget, which needs to be remounted to
get the updated/new files created by Linux. Anyhow, now I'm doing this
programmatically by copying mount command code from older shell. :)

One more issue is that, after Linux updates some file (on client side,
Linux will mount the same partition, save some file, and then umount the
partition. Then if i remount the partition on Host side, when host is
windows, i will get updated files) I will manually remove and connect the
cable (MS device), UEFI is not able to detect the MS itself. (This issue
observed, regardless of remount. This issue is not there on windows 10
host).
Can you give some pointers on this?

Thanks a lot, Jaben.

Regards,
Keshava

On Thu, 25 May 2017 at 21:26 Carsey, Jaben <jaben.car...@intel.com> wrote:

> You can "disconnect" the driver
> You can do "map -d" to delete a mapping
>
> I am unsure what your goals are for mount/unmount
>
> -Jaben
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Wednesday, May 24, 2017 10:59 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] Unmount and mount a mass storage from shell
> > Importance: High
> >
> > How can I unmount and mount a mass storage fs from UEFI shell?
> >
> > In older EFI shells, I can do with "mount" command. But it just does
> > "mapping" in newer shell. It doesn't actually remounting the device.
> >
> > Please help.
> >
> > thanks
> > ___
> > 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


[edk2] Unmount and mount a mass storage from shell

2017-05-25 Thread GN Keshava
How can I unmount and mount a mass storage fs from UEFI shell?

In older EFI shells, I can do with "mount" command. But it just does
"mapping" in newer shell. It doesn't actually remounting the device.

Please help.

thanks
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] UEFI shell vs UEFI BIOS version compatibility

2017-05-23 Thread GN Keshava
Hi Ramesh,

Thanks for the reply.

But I'm facing issue when i load a driver using load command. I tried with
the latest driver binary.

Also, this issue is not observed on Intel Gigabit motherboard with UEFI
bios version 2.4.
But issue is observed on PC with UEFI 2.3.1

When I load driver.efi, screen just goes blank.

Thanks again.
Regards,
Keshava

On Tue, 23 May 2017 at 17:55 Ramesh R. <rame...@ami.com> wrote:

> Hi,
>
>   Old Shell was installing EFI_SHELL_INTERFACE and new shell is installing
> the EFI_SHELL_PARAMETERS_PROTOCOL on the shell application.
>
> Thanks,
> Ramesh
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of GN
> Keshava
> Sent: 23 May 2017 17:01
> To: edk2-devel@lists.01.org
> Subject: [edk2] UEFI shell vs UEFI BIOS version compatibility
>
> Hi all,
>
> I was using older version of UEFI shell (older EFI shell inside
> EdkShellBinPkg). It was working fine with my testing PCs (Intel core i5
> (Dell Optiplex 7020) (UEFI ver 2.31) as well as Intel Gigabit motherboard
> (UEFI ver 2.4)). I'm able to load any driver efi and use it.
>
> Now I'm trying newer UEFI shell (UEFI Interactive shell v 2.2, the newer
> one in ShellBinPkg).
> I'm trying to load my driver (and default Fat.efi driver downloaded from
> github as well) It is working fine with Intel Gigabit motherboard (UEFI ver
> 2.4). I'm able to load the driver and use it.
> But if I try to load the same efi driver on newer UEFI shell v2.2 on Intel
> core i5 (Dell Optiplex 7020) (UEFI ver 2.31), display is just turning
> black, and I'm not able to use the shell any further. (But I'm able to load
> my custom shell application!)
>
> What could be the issue? Any help is much appreciated.
>
> Thanks.
> With 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


[edk2] Strange issue in USB mass storage device

2017-05-22 Thread GN Keshava
Hi all,

I'm testing a USB mass storage device (A linux CDC gadget, which has serial
and mass storage with FAT32 filesystem) which works fine with Windows.

I'm booting to UEFI shell using another mass storage device (a thumb drive).
My device under test (A linux CDC gadget, which has serial and mass
storage) detects as file system (fsx: ) only if its device path is lesser
than the thumb drive. Thumb drive detects always.
Example:
case 1:
Thumb drive: PCI.../.../USB(*2,0*)/HD(MBR...
Device under test: PCI.../.../USB(*6,2*)

Result: Device under test doesn't mount. But it's just shown as Removable
block device. Even if I use mount command, its not mounted. I cant access
files.

case 2:
Thumb drive: PCI.../.../USB(*6,0*)/HD(MBR...
Device under test: PCI.../.../USB(*2,2*)

Result: Device under test mounts properly as fs2: . I can access files.

Also, it can be noted that thumb drive is shown as "HD(MBR...)" whereas my
DUT does not show this part.

Any pointers would be much appreciated.

Thanks and regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Serial port flush in UEFI

2017-01-09 Thread GN Keshava
Hi,

>From my UEFI application, I want to flush serial port (both TX and RX)
similar to PurgeComm function in Windows

.

Can somebody suggest a way to do this on UEFI?

Thanks!
Regards,
Keshava G N
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] LocateHandle for gEfiShellProtocolGuid is failing in my application

2016-12-22 Thread GN Keshava
Hi Jaben,

*>> Is there a reason that you are not using ShellLib to facilitate your
app functionality?  That library makes lots of things a lot easier.*

I want to use EFI_SHELL_PROTOCOL->GetMapFromDevicePath in my app. Is there
any way to use it using ShellLib ?


*>> Why do you use LocateHandle and not LocateProtocol?*

Got LocateHandle in my reference. I would like to know more about
difference and usage of these in different scenario.


*>> Are you running the UEFI Shell and then your application?*

Yes. I'm running my application from UEFI shell as :

*fs1:\> MyApp.exe Arg1 Arg2*

Thanks for the help..

Regards,
Keshava


On Thu, 22 Dec 2016 at 00:06 Carsey, Jaben <jaben.car...@intel.com> wrote:

> Hi Keshava,
>
> few questions:
> Is there a reason that you are not using ShellLib to facilitate your app
> functionality?  That library makes lots of things a lot easier.
> Why do you use LocateHandle and not LocateProtocol?
> Are you sure about that return code?  Usually most-sig-bit is set for
> error returns.
>
> Does the following snippet of code find a valid instance?
>
> Status = gBS->LocateProtocol(
>   ,
>   NULL,
>   (VOID **)
>  );
> if (EFI_ERROR(Status)) {
>   gEfiShellProtocol = NULL;
> }
>
> Are you running the UEFI Shell and then your application?
>
>
> -Jaben
>
>
>
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, December 20, 2016 11:32 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] LocateHandle for gEfiShellProtocolGuid is failing in my
> > application
> > Importance: High
> >
> > Hi,
> >
> > I'm developing a shell application. A call to LocateHandle for
> > gEfiShellProtocolGuid is failing with Status 0x0E.
> >
> > Below is my code. Please let me know what I'm doing wrong.
> >
> > Status = gBS->LocateHandle(ByProtocol, , NULL,
> > , Buffer); // Get BufferSize
> > if (EFI_ERROR(Status))
> > Print(L"LocateHandle Status 0x%x\n",Status);
> >
> > Status = gBS->AllocatePool(EfiBootServicesData, BufferSize,
> > (void**));
> > if (EFI_ERROR(Status))
> > Print(L"AllocatePool Status 0x%x\n",Status);
> >
> > Status = gBS->LocateHandle(ByProtocol, , NULL,
> > , Buffer);
> > if (EFI_ERROR(Status))
> > Print(L"LocateHandle Status 0x%x\n",Status);
> >
> > All calls failing with Status being 0x0E. Please help me to solve this.
> Is
> > there any special requirement for using this protocol?
> >
> > 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


Re: [edk2] LocateHandle for gEfiShellProtocolGuid is failing in my application

2016-12-21 Thread GN Keshava
Thanks a lot, Andrew and Jaben.
I will check these and get back...

Thanks again. :)

Regards,
Keshava

On ಗುರು, ಡಿಸೆಂ 22, 2016 12:43 ಪೂರ್ವಾಹ್ನ Andrew Fish <af...@apple.com> wrote:

> On Dec 20, 2016, at 11:32 PM, GN Keshava <keshava...@gmail.com> wrote:
>
> Hi,
>
> I'm developing a shell application. A call to LocateHandle for
> gEfiShellProtocolGuid is failing with Status 0x0E.
>
> Below is my code. Please let me know what I'm doing wrong.
>
>
> Assuming this is your entire code fragment you are passing 2 uninitialized
> values
>
> If you want to probe the size you need to:
> BufferSize = 0;
>
> Status = gBS->LocateHandle(ByProtocol, , NULL,
> , Buffer); // Get BufferSize
> if (EFI_ERROR(Status))
>
>
> Per the spec you would expect to get Status = EFI_BUFFER_TOO_SMALL if you
> need to grow the size. You should only allocate the buffer and retry if you
> get EFI_BUFFER_TOO_SMALL.
>
> You don't handle the case of  EFI_NOT_FOUND.
>
> FYI the error codes are defined in the UEFI Spec and exist here in the
> code:
> https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Base.h
>
>
> ///
> /// The buffer was not large enough to hold the requested data.
> /// The required buffer size is returned in the appropriate
> /// parameter when this error occurs.
> ///
> #define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5)
>
>
> ...
>
> ///
> /// The item was not found.
> ///
> #define RETURN_NOT_FOUND ENCODE_ERROR (14)
>
>
> #define ENCODE_ERROR(StatusCode) ((RETURN_STATUS)(MAX_BIT | (StatusCode)))
>
>
> MAX_BIT is going to be defined as BIT63 or BIT31 depending on the CPU
> architecture you are using.
>
>
> Print(L"LocateHandle Status 0x%x\n",Status);
>
> Status = gBS->AllocatePool(EfiBootServicesData, BufferSize,
> (void**));
> if (EFI_ERROR(Status))
> Print(L"AllocatePool Status 0x%x\n",Status);
>
>
> I mentioned in the other mail that you can use %r to get a string for the
> error.
>
> Thanks,
>
> Andrew Fish
>
>
> Status = gBS->LocateHandle(ByProtocol, , NULL,
> , Buffer);
> if (EFI_ERROR(Status))
> Print(L"LocateHandle Status 0x%x\n",Status);
>
> All calls failing with Status being 0x0E. Please help me to solve this. Is
> there any special requirement for using this protocol?
>
> Thanks.
> Regards,
> Keshava
>
> ___
>
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] LocateHandle for gEfiShellProtocolGuid is failing in my application

2016-12-20 Thread GN Keshava
Hi,

I'm developing a shell application. A call to LocateHandle for
gEfiShellProtocolGuid is failing with Status 0x0E.

Below is my code. Please let me know what I'm doing wrong.

Status = gBS->LocateHandle(ByProtocol, , NULL,
, Buffer); // Get BufferSize
if (EFI_ERROR(Status))
Print(L"LocateHandle Status 0x%x\n",Status);

Status = gBS->AllocatePool(EfiBootServicesData, BufferSize,
(void**));
if (EFI_ERROR(Status))
Print(L"AllocatePool Status 0x%x\n",Status);

Status = gBS->LocateHandle(ByProtocol, , NULL,
, Buffer);
if (EFI_ERROR(Status))
Print(L"LocateHandle Status 0x%x\n",Status);

All calls failing with Status being 0x0E. Please help me to solve this. Is
there any special requirement for using this protocol?

Thanks.
Regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] VFAT mounting inconsistency in UEFI

2016-11-24 Thread GN Keshava
Hi,

I'm connecting my Linux device to UEFI-running PC using USB Mass storage.
Linux is enumerated as Mass storage on host (UEFI).

Sometimes, the mass storage is not detecting/mounting on UEFI.
Linux has partitioned it as VFAT. It is always being mounted on
Windows/Linux.

Has anybody tested this?

Thanks.
With regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] map -r command

2016-11-21 Thread GN Keshava
Hi,

Whether "map -r" command remounts the partitions? (does it unmount and
mount again the partitions?)

Thanks.
Regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] COM port usage in UEFI

2016-10-25 Thread GN Keshava
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
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Format a volume in UEFI (or delete all files)

2016-10-13 Thread GN Keshava
Got it. Thanks for the help, Laszlo.

Regards,
Keshava

On Thu, 13 Oct 2016 at 14:03 Laszlo Ersek <ler...@redhat.com> wrote:

> On 10/13/16 03:29, GN Keshava wrote:
> > Thanks Laszlo.
> >
> > Is it possible to run RM (or any shell command) from my C application
> > code? Something like "System()" in Linux? Whether we can use LoadImage
> > for this purpose?
>
> Can't say for sure; I'd opt for a separate implementation.
>
> Thanks
> Laszlo
>
> > On Wed 12 Oct, 2016 11:10 pm Laszlo Ersek, <ler...@redhat.com
> > <mailto:ler...@redhat.com>> wrote:
> >
> > On 10/12/16 19:34, GN Keshava wrote:
> > > Thanks Laszlo, I'll check it out.
> > >
> > > I think I need to combine the LS implementation and RM
> implementation,
> > > isn't it? So there is no "format this volume" function or command
> > > exists, right?
> >
> > I'm unaware of any "format" command. And, I think it's enough if you
> > look at RM (LS should be unnecessary); RM already contains the
> > recursion.
> >
> > Laszlo
> >
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Format a volume in UEFI (or delete all files)

2016-10-12 Thread GN Keshava
Thanks Laszlo.

Is it possible to run RM (or any shell command) from my C application code?
Something like "System()" in Linux? Whether we can use LoadImage for this
purpose?

Thanks again.
Regards,
Keshava

On Wed 12 Oct, 2016 11:10 pm Laszlo Ersek, <ler...@redhat.com> wrote:

> On 10/12/16 19:34, GN Keshava wrote:
> > Thanks Laszlo, I'll check it out.
> >
> > I think I need to combine the LS implementation and RM implementation,
> > isn't it? So there is no "format this volume" function or command
> > exists, right?
>
> I'm unaware of any "format" command. And, I think it's enough if you
> look at RM (LS should be unnecessary); RM already contains the recursion.
>
> Laszlo
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Format a volume in UEFI (or delete all files)

2016-10-12 Thread GN Keshava
Thanks Laszlo, I'll check it out.

I think I need to combine the LS implementation and RM implementation,
isn't it? So there is no "format this volume" function or command exists,
right?

Thanks again!
Regards,
Keshava

On Wed 12 Oct, 2016 8:01 pm Laszlo Ersek, <ler...@redhat.com> wrote:

> On 10/12/16 12:48, GN Keshava wrote:
> > Hi all,
> >
> > I need to format fs1: (or delete all files and folders in root directory)
> > from my UEFI application.
> >
> > I'm able to use file system APIs such as Open, Write or Delete too. But
> > Delete API needs File (file path) as argument, but what I want is delete
> > all files (irrespective of file name).
> >
> > What could be the best method? Is there any API to directly delete all
> > files? If not, How to go through (Open) all files and delete each?
> >
> > How I can get each file and folder names in a directory programmatically
> ?
>
> Implement recursive directory traversal.
>
> (Minimally) the CP, LS, and TOUCH commands support the "-r" option, for
> recursive operation. I guess you could consult their implementations, if
> you don't want to implement the traversal from scratch.
>
>   ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
>   ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
>   ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
>
> Actually... the RM command supports recursive file & directory removal
> without additional options. The UEFI shell spec 2.2 (Jan 26, 2016) says
> under RM:
>
> This command deletes one or more files or directories. If the
> target is a directory, it will delete the directory, including all
> its subdirectories. [...]
>
> So I guess you could copy & customize the code from
>
>   ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
>
> The CascadeDelete() function looks relevant: "Delete a node and all
> nodes under it (including sub directories)".
>
> Thanks
> Laszlo
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Format a volume in UEFI (or delete all files)

2016-10-12 Thread GN Keshava
Hi all,

I need to format fs1: (or delete all files and folders in root directory)
from my UEFI application.

I'm able to use file system APIs such as Open, Write or Delete too. But
Delete API needs File (file path) as argument, but what I want is delete
all files (irrespective of file name).

What could be the best method? Is there any API to directly delete all
files? If not, How to go through (Open) all files and delete each?

How I can get each file and folder names in a directory programmatically ?

Thanks.
With regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] How to open a file by it's full path in UEFI

2016-09-29 Thread GN Keshava
Hi Laurie,

I'm trying this code, but it hangs in OpenFileByName function. It does not
return. Any idea on this issue?

Thanks.
With regards,
Keshava GN

On Tue, 27 Sep 2016 at 22:14 Jarlstrom, Laurie <laurie.jarlst...@intel.com>
wrote:

> Keshava,
> Attached Sample code  is an example that will open a file name passed
> through the command line using the Shell.
>
>
> thanks,
> Laurie
>
> laurie.jarlst...@intel.com
>
> Intel SSG/STO/EBP
> (503) 712-9395
>
>
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of GN
> Keshava
> Sent: Tuesday, September 27, 2016 4:52 AM
> To: Laszlo Ersek
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] How to open a file by it's full path in UEFI
>
> Thank you Laszlo.
>
> I'll check it out. :)
>
> Thanks again.
> Regards,
> Keshava
>
> On Tue, 27 Sep 2016 at 16:47 Laszlo Ersek <ler...@redhat.com> wrote:
>
> > On 09/27/16 12:46, GN Keshava wrote:
> > > Hi Laszlo,
> > >
> > > Thank you for the answer. It was helpful.
> > >
> > > Considering option #1, can you give some more details (a small
> > > example or any reference link would be helpful), how I can use Shell
> > > APIs in my C file (which will compile to my .efi app)?
> >
> > Hmmm, I don't have hands-on experience with this, but you might want
> > to try the ShellOpenFileByName() function, from
> > "ShellPkg/Include/Library/ShellLib.h".
> >
> > You can find examples for UEFI applications that use the Shell library
> > with:
> >
> >   git grep -w ShellLib -- '*inf'
> >
> > or just grep the tree for ShellOpenFileByName().
> >
> > See also "AppPkg/ReadMe.txt".
> >
> > > Considering option #2, How I can find device path programatically
> > > from my C file?
> >
> > The EFI_SHELL_PROTOCOL.GetDevicePathFromMap() member function seems
> > relevant -- it is specified in the UEFI Shell spec --, but I would
> > definitely try ShellOpenFileByName() first.
> >
> > Thanks
> > Laszlo
> >
> > > Thanks again for the help. :)
> > > With regards,
> > > Keshava
> > >
> > > On Tue, 27 Sep 2016 at 15:19 Laszlo Ersek <ler...@redhat.com
> > > <mailto:ler...@redhat.com>> wrote:
> > >
> > > On 09/27/16 11:25, GN Keshava wrote:
> > > > Hi Laszlo,
> > > >
> > > > Thanks for the reply. I meant I have complete file path. I
> > > believe
> > the
> > > > "device path" is different. Is it possible to obtain DevicePath
> > > using my
> > > > full file path?
> > >
> > > The pathname you seem to have (as "complete") is specific to a
> given
> > > simple FS, so system-wide it cannot be considered complete
> > > (there
> > can be
> > > multiple filesystems).
> > >
> > > In your original email I missed that you started with "FS1:".
> > Andrew's
> > > answer covers that case.
> > >
> > > In summary, you can do three things:
> > > - have a pathname that starts with FSx: (which is a shell-specific
> > > mapping), and use Andrew's recommendation,
> > > - have a complete UEFI device path, and then use what I
> recommended,
> > > - have no information for selecting the filesystem (from the many
> > > possible), and use your current iteration.
> > >
> > > Options #1 and #2 actually correspond to each other, considering
> > > "expressive power" / information content (as long as you are in the
> > > shell); please see the MAP shell command.
> > >
> > > Thanks
> > > Laszlo
> > >
> > > > On Tue, 27 Sep 2016 at 14:46 Laszlo Ersek <ler...@redhat.com
> > > <mailto:ler...@redhat.com>
> > > > <mailto:ler...@redhat.com <mailto:ler...@redhat.com>>> wrote:
> > > >
> > > > On 09/27/16 11:03, GN Keshava wrote:
> > > > > Hi all,
> > > > >
> > > > >
> > > > > I'm trying to open a file from my UEFI application. The
> path
> > of
> > > > file is
> > > > >
> > > > > fs1:/myfolder/myfile.txt
> > > > >
> > > > > The code :
> > > > >
&

Re: [edk2] Use fprintf in UEFI

2016-09-29 Thread GN Keshava
Thank you for detailed answer. Laszlo.

Regards,
Keshava

On Thu, 29 Sep 2016 at 13:01 Laszlo Ersek <ler...@redhat.com> wrote:

> CC Jaben
>
> On 09/29/16 08:01, GN Keshava wrote:
> > Hi,
> >
> > There is fprintf function in Stdio library. But how to use it? The first
> > argument is "FILE" type. But I have "EFI_FILE_PROTOCOL* File" which I got
> > from "EFIOpenFile" function. How to map to "FILE" type?
> >
> > Sorry if this is silly. A newbie here. Didn't get much idea in internet
> > search. :)
>
> (1) You're trying to mix edk2 APIs with standard C library APIs. Don't
> do that.
>
> I think what you are missing is the fact that using edk2, you can write
> a UEFI application *either* against edk2 APIs (protocols and libraries),
> *or* against standard C APIs (using the stdlib implementation of edk2).
> In some cases it is okay to call edk2 APIs directly, from stdlib
> applications, but in general I'd advise against that.
>
> I told you to read "AppPkg/ReadMe.txt"; that file explains what is
> necessary for what "flavor" of UEFI application. It even mentions two
> example programs, "Main" and "Hello", which don't do anything but
> highlight the differences.
>
> For another (quite self-contained) example,
> "AppPkg/Applications/OrderedCollectionTest" is an application that I
> wrote myself; it uses fopen() and fprintf(). This is a unit tester for
> an MdePkg library that I also wrote, so it actually exemplifies how you
> can use both stdlib and an edk2 library, as long as they don't step on
> each other's toes.
>
> (2) You can write formatted output to files using only edk2 APIs as
> well, but for that, you first have to format the text into memory
> buffers with PrintLib functions, then write the buffers to files with
> the ShellLib APIs or with direct protocol calls.
>
> (3) The standard C lib implementation in edk2 is only available for use
> by UEFI applications (no other module types; that is, no drivers).
> What's more, those applications have to be started from the shell (you
> can't boot them directly from the boot manager, for example). This is
> also documented in AppPkg/ReadMe.txt.
>
> Thanks
> Laszlo
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Use fprintf in UEFI

2016-09-29 Thread GN Keshava
Hi,

There is fprintf function in Stdio library. But how to use it? The first
argument is "FILE" type. But I have "EFI_FILE_PROTOCOL* File" which I got
from "EFIOpenFile" function. How to map to "FILE" type?

Sorry if this is silly. A newbie here. Didn't get much idea in internet
search. :)

Thanks.
Regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] How to open a file by it's full path in UEFI

2016-09-27 Thread GN Keshava
Thanks, Andrew, Laurie, Laszlo, Jaben, for quick help!! :)

Regards,
Keshava

On Tue 27 Sep, 2016 10:18 pm Andrew Fish, <af...@apple.com> wrote:

> I was kind of surprised that an example like this did not exist in:
> https://github.com/tianocore/edk2/tree/master/ShellPkg/Application
>
> Thanks,
>
> Andrew Fish
>
> > On Sep 27, 2016, at 9:44 AM, Jarlstrom, Laurie <
> laurie.jarlst...@intel.com> wrote:
> >
> > Keshava,
> > Attached Sample code  is an example that will open a file name passed
> through the command line using the Shell.
> >
> >
> > thanks,
> > Laurie
> >
> > laurie.jarlst...@intel.com
> >
> > Intel SSG/STO/EBP
> > (503) 712-9395
> >
> >
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> GN Keshava
> > Sent: Tuesday, September 27, 2016 4:52 AM
> > To: Laszlo Ersek
> > Cc: edk2-devel@lists.01.org
> > Subject: Re: [edk2] How to open a file by it's full path in UEFI
> >
> > Thank you Laszlo.
> >
> > I'll check it out. :)
> >
> > Thanks again.
> > Regards,
> > Keshava
> >
> > On Tue, 27 Sep 2016 at 16:47 Laszlo Ersek <ler...@redhat.com> wrote:
> >
> >> On 09/27/16 12:46, GN Keshava wrote:
> >>> Hi Laszlo,
> >>>
> >>> Thank you for the answer. It was helpful.
> >>>
> >>> Considering option #1, can you give some more details (a small
> >>> example or any reference link would be helpful), how I can use Shell
> >>> APIs in my C file (which will compile to my .efi app)?
> >>
> >> Hmmm, I don't have hands-on experience with this, but you might want
> >> to try the ShellOpenFileByName() function, from
> >> "ShellPkg/Include/Library/ShellLib.h".
> >>
> >> You can find examples for UEFI applications that use the Shell library
> >> with:
> >>
> >>  git grep -w ShellLib -- '*inf'
> >>
> >> or just grep the tree for ShellOpenFileByName().
> >>
> >> See also "AppPkg/ReadMe.txt".
> >>
> >>> Considering option #2, How I can find device path programatically
> >>> from my C file?
> >>
> >> The EFI_SHELL_PROTOCOL.GetDevicePathFromMap() member function seems
> >> relevant -- it is specified in the UEFI Shell spec --, but I would
> >> definitely try ShellOpenFileByName() first.
> >>
> >> Thanks
> >> Laszlo
> >>
> >>> Thanks again for the help. :)
> >>> With regards,
> >>> Keshava
> >>>
> >>> On Tue, 27 Sep 2016 at 15:19 Laszlo Ersek <ler...@redhat.com
> >>> <mailto:ler...@redhat.com>> wrote:
> >>>
> >>>On 09/27/16 11:25, GN Keshava wrote:
> >>>> Hi Laszlo,
> >>>>
> >>>> Thanks for the reply. I meant I have complete file path. I
> >>> believe
> >> the
> >>>> "device path" is different. Is it possible to obtain DevicePath
> >>>using my
> >>>> full file path?
> >>>
> >>>The pathname you seem to have (as "complete") is specific to a given
> >>>simple FS, so system-wide it cannot be considered complete
> >>> (there
> >> can be
> >>>multiple filesystems).
> >>>
> >>>In your original email I missed that you started with "FS1:".
> >> Andrew's
> >>>answer covers that case.
> >>>
> >>>In summary, you can do three things:
> >>>- have a pathname that starts with FSx: (which is a shell-specific
> >>>mapping), and use Andrew's recommendation,
> >>>- have a complete UEFI device path, and then use what I recommended,
> >>>- have no information for selecting the filesystem (from the many
> >>>possible), and use your current iteration.
> >>>
> >>>Options #1 and #2 actually correspond to each other, considering
> >>>"expressive power" / information content (as long as you are in the
> >>>shell); please see the MAP shell command.
> >>>
> >>>Thanks
> >>>Laszlo
> >>>
> >>>> On Tue, 27 Sep 2016 at 14:46 Laszlo Ersek <ler...@redhat.com
> >>><mailto:ler...@redhat.com>
> >>>> <mailto:ler...@redhat.com <mailto:ler...@redhat.com>&

Re: [edk2] How to open a file by it's full path in UEFI

2016-09-27 Thread GN Keshava
Thank you Laszlo.

I'll check it out. :)

Thanks again.
Regards,
Keshava

On Tue, 27 Sep 2016 at 16:47 Laszlo Ersek <ler...@redhat.com> wrote:

> On 09/27/16 12:46, GN Keshava wrote:
> > Hi Laszlo,
> >
> > Thank you for the answer. It was helpful.
> >
> > Considering option #1, can you give some more details (a small example
> > or any reference link would be helpful), how I can use Shell APIs in my
> > C file (which will compile to my .efi app)?
>
> Hmmm, I don't have hands-on experience with this, but you might want to
> try the ShellOpenFileByName() function, from
> "ShellPkg/Include/Library/ShellLib.h".
>
> You can find examples for UEFI applications that use the Shell library
> with:
>
>   git grep -w ShellLib -- '*inf'
>
> or just grep the tree for ShellOpenFileByName().
>
> See also "AppPkg/ReadMe.txt".
>
> > Considering option #2, How I can find device path programatically from
> > my C file?
>
> The EFI_SHELL_PROTOCOL.GetDevicePathFromMap() member function seems
> relevant -- it is specified in the UEFI Shell spec --, but I would
> definitely try ShellOpenFileByName() first.
>
> Thanks
> Laszlo
>
> > Thanks again for the help. :)
> > With regards,
> > Keshava
> >
> > On Tue, 27 Sep 2016 at 15:19 Laszlo Ersek <ler...@redhat.com
> > <mailto:ler...@redhat.com>> wrote:
> >
> > On 09/27/16 11:25, GN Keshava wrote:
> > > Hi Laszlo,
> > >
> > > Thanks for the reply. I meant I have complete file path. I believe
> the
> > > "device path" is different. Is it possible to obtain DevicePath
> > using my
> > > full file path?
> >
> > The pathname you seem to have (as "complete") is specific to a given
> > simple FS, so system-wide it cannot be considered complete (there
> can be
> > multiple filesystems).
> >
> > In your original email I missed that you started with "FS1:".
> Andrew's
> > answer covers that case.
> >
> > In summary, you can do three things:
> > - have a pathname that starts with FSx: (which is a shell-specific
> > mapping), and use Andrew's recommendation,
> > - have a complete UEFI device path, and then use what I recommended,
> > - have no information for selecting the filesystem (from the many
> > possible), and use your current iteration.
> >
> > Options #1 and #2 actually correspond to each other, considering
> > "expressive power" / information content (as long as you are in the
> > shell); please see the MAP shell command.
> >
> > Thanks
> > Laszlo
> >
> > > On Tue, 27 Sep 2016 at 14:46 Laszlo Ersek <ler...@redhat.com
> > <mailto:ler...@redhat.com>
> > > <mailto:ler...@redhat.com <mailto:ler...@redhat.com>>> wrote:
> > >
> > > On 09/27/16 11:03, GN Keshava wrote:
> > > > Hi all,
> > > >
> > > >
> > > > I'm trying to open a file from my UEFI application. The path
> of
> > > file is
> > > >
> > > > fs1:/myfolder/myfile.txt
> > > >
> > > > The code :
> > > >
> > > > efiStatus = bs->LocateHandleBuffer(ByProtocol,
> > > >,
> > > >NULL,
> > > >,
> > > >);
> > > >
> > > > for (index = 0; index < (int)handleCount; ++ index)
> > > > {
> > > > EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL;
> > > >
> > > > efiStatus = bs->HandleProtocol(
> > > > handles[index],
> > > > ,
> > > > (void**));
> > > >
> > > > EFI_FILE_PROTOCOL* root = NULL;
> > > > ...
> > > > efiStatus = fs->OpenVolume(fs, );
> > > >
> > > > EFI_FILE_PROTOCOL* token = NULL;
> > > >
> > > > efiStatus = root->Open(
> > > > root,
> > > > ,
> > > > L"myfolder\\myfile.txt",
> > >

Re: [edk2] How to open a file by it's full path in UEFI

2016-09-27 Thread GN Keshava
Hi Laszlo,

Thank you for the answer. It was helpful.

Considering option #1, can you give some more details (a small example or
any reference link would be helpful), how I can use Shell APIs in my C file
(which will compile to my .efi app)?
Considering option #2, How I can find device path programatically from my C
file?

Thanks again for the help. :)
With regards,
Keshava

On Tue, 27 Sep 2016 at 15:19 Laszlo Ersek <ler...@redhat.com> wrote:

> On 09/27/16 11:25, GN Keshava wrote:
> > Hi Laszlo,
> >
> > Thanks for the reply. I meant I have complete file path. I believe the
> > "device path" is different. Is it possible to obtain DevicePath using my
> > full file path?
>
> The pathname you seem to have (as "complete") is specific to a given
> simple FS, so system-wide it cannot be considered complete (there can be
> multiple filesystems).
>
> In your original email I missed that you started with "FS1:". Andrew's
> answer covers that case.
>
> In summary, you can do three things:
> - have a pathname that starts with FSx: (which is a shell-specific
> mapping), and use Andrew's recommendation,
> - have a complete UEFI device path, and then use what I recommended,
> - have no information for selecting the filesystem (from the many
> possible), and use your current iteration.
>
> Options #1 and #2 actually correspond to each other, considering
> "expressive power" / information content (as long as you are in the
> shell); please see the MAP shell command.
>
> Thanks
> Laszlo
>
> > On Tue, 27 Sep 2016 at 14:46 Laszlo Ersek <ler...@redhat.com
> > <mailto:ler...@redhat.com>> wrote:
> >
> > On 09/27/16 11:03, GN Keshava wrote:
> > > Hi all,
> > >
> > >
> > > I'm trying to open a file from my UEFI application. The path of
> > file is
> > >
> > > fs1:/myfolder/myfile.txt
> > >
> > > The code :
> > >
> > > efiStatus = bs->LocateHandleBuffer(ByProtocol,
> > >,
> > >NULL,
> > >,
> > >);
> > >
> > > for (index = 0; index < (int)handleCount; ++ index)
> > > {
> > > EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL;
> > >
> > > efiStatus = bs->HandleProtocol(
> > > handles[index],
> > > ,
> > > (void**));
> > >
> > > EFI_FILE_PROTOCOL* root = NULL;
> > > ...
> > > efiStatus = fs->OpenVolume(fs, );
> > >
> > > EFI_FILE_PROTOCOL* token = NULL;
> > >
> > > efiStatus = root->Open(
> > > root,
> > > ,
> > > L"myfolder\\myfile.txt",
> > > EFI_FILE_MODE_READ,
> > > EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM);
> > > }
> > >
> > > But using this method, I can only go through all the file system
> > handles
> > > and open each volume and try opening my file.
> > >
> > > But I want to give full path to my file and open it in it's volume.
> > >
> > > How can I acheive this?
> > > Thanks.
> >
> > If you have a complete device path, you can use
> gBS->LocateDevicePath()
> > with gEfiSimpleFileSystemProtocolGuid, to locate the handle with the
> > most specific device path (--> the longest device path prefix) with
> the
> > simple FS protocol installed on it. Then you can check if the
> remaining
> > device path (returned by the service) consist of nothing but one File
> > Path Media Device Path node. If so, you can open the simple FS
> protocol
> > on the handle found, then use that to open the file by pathname.
> >
> > Laszlo
> >
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] How to open a file by it's full path in UEFI

2016-09-27 Thread GN Keshava
Hi Andrew,

Thanks for the reply.

Can you tell more about (or some links) about the Shell APIs that you have
mentioned? Is it possible to access these from my C code? (not script, its
C code for my .efi app).

Also, can you give more idea about how I can map my volume name to device
path in my C file?

Thanks.
With regards,
Keshava

On Tue, 27 Sep 2016 at 14:37 Andrew Fish <af...@apple.com> wrote:

> On Sep 27, 2016, at 2:03 AM, GN Keshava <keshava...@gmail.com> wrote:
>
> Hi all,
>
>
> I'm trying to open a file from my UEFI application. The path of file is
>
> fs1:/myfolder/myfile.txt
>
>
> Keshava,
>
> The volume names are EFI Shell concepts, not UEFI Firmware concepts.
> Basically the Shell uses "fs1:" to match one of the Simple File System
> Handles. There is also an EFI Device Path on the handle with the Simple
> File System Handle and that is what maps to "fs1".
>
> So if you want to use these shell volume names you need to use Shell APIs.
>
> Thanks,
>
> Andrew Fish
>
>
> The code :
>
> efiStatus = bs->LocateHandleBuffer(ByProtocol,
>   ,
>   NULL,
>   ,
>   );
>
> for (index = 0; index < (int)handleCount; ++ index)
> {
>EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL;
>
>efiStatus = bs->HandleProtocol(
>handles[index],
>,
>(void**));
>
>EFI_FILE_PROTOCOL* root = NULL;
>...
>efiStatus = fs->OpenVolume(fs, );
>
>EFI_FILE_PROTOCOL* token = NULL;
>
>efiStatus = root->Open(
>root,
>,
>L"myfolder\\myfile.txt",
>EFI_FILE_MODE_READ,
>EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM);
> }
>
> But using this method, I can only go through all the file system handles
> and open each volume and try opening my file.
>
> But I want to give full path to my file and open it in it's volume.
>
> How can I acheive this?
> Thanks.
> With regards,
> Keshava GN
>
> ___
> 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


Re: [edk2] How to open a file by it's full path in UEFI

2016-09-27 Thread GN Keshava
Hi Laszlo,

Thanks for the reply. I meant I have complete file path. I believe the
"device path" is different. Is it possible to obtain DevicePath using my
full file path?

Thanks.
Regards,
Keshava

On Tue, 27 Sep 2016 at 14:46 Laszlo Ersek <ler...@redhat.com> wrote:

> On 09/27/16 11:03, GN Keshava wrote:
> > Hi all,
> >
> >
> > I'm trying to open a file from my UEFI application. The path of file is
> >
> > fs1:/myfolder/myfile.txt
> >
> > The code :
> >
> > efiStatus = bs->LocateHandleBuffer(ByProtocol,
> >,
> >NULL,
> >,
> >);
> >
> > for (index = 0; index < (int)handleCount; ++ index)
> > {
> > EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL;
> >
> > efiStatus = bs->HandleProtocol(
> > handles[index],
> > ,
> > (void**));
> >
> > EFI_FILE_PROTOCOL* root = NULL;
> > ...
> > efiStatus = fs->OpenVolume(fs, );
> >
> > EFI_FILE_PROTOCOL* token = NULL;
> >
> > efiStatus = root->Open(
> > root,
> > ,
> > L"myfolder\\myfile.txt",
> > EFI_FILE_MODE_READ,
> > EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM);
> > }
> >
> > But using this method, I can only go through all the file system handles
> > and open each volume and try opening my file.
> >
> > But I want to give full path to my file and open it in it's volume.
> >
> > How can I acheive this?
> > Thanks.
>
> If you have a complete device path, you can use gBS->LocateDevicePath()
> with gEfiSimpleFileSystemProtocolGuid, to locate the handle with the
> most specific device path (--> the longest device path prefix) with the
> simple FS protocol installed on it. Then you can check if the remaining
> device path (returned by the service) consist of nothing but one File
> Path Media Device Path node. If so, you can open the simple FS protocol
> on the handle found, then use that to open the file by pathname.
>
> Laszlo
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] How to open a file by it's full path in UEFI

2016-09-27 Thread GN Keshava
Hi all,


I'm trying to open a file from my UEFI application. The path of file is

fs1:/myfolder/myfile.txt

The code :

efiStatus = bs->LocateHandleBuffer(ByProtocol,
   ,
   NULL,
   ,
   );

for (index = 0; index < (int)handleCount; ++ index)
{
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL;

efiStatus = bs->HandleProtocol(
handles[index],
,
(void**));

EFI_FILE_PROTOCOL* root = NULL;
...
efiStatus = fs->OpenVolume(fs, );

EFI_FILE_PROTOCOL* token = NULL;

efiStatus = root->Open(
root,
,
L"myfolder\\myfile.txt",
EFI_FILE_MODE_READ,
EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM);
}

But using this method, I can only go through all the file system handles
and open each volume and try opening my file.

But I want to give full path to my file and open it in it's volume.

How can I acheive this?
Thanks.
With regards,
Keshava GN
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] UEFI Sample application for read/write serial IO

2016-09-01 Thread GN Keshava
Thanks, Michael and Andrew...

On Thu, 1 Sep 2016 at 20:56 Andrew Fish <af...@apple.com> wrote:

>
> > On Sep 1, 2016, at 4:48 AM, GN Keshava <keshava...@gmail.com> wrote:
> >
> > Thanks Michael,
> >
> > By sample I mean is there any code which uses Serial IO Protocol to
> > read/write to UART in edk2 package? or any open source code should be
> fine.
> >
> > This is just to get an idea how I can use the protocol.
> >
>
> All you need to do is read 11.8 in the UEFI Specification Serial I/O
> Protocol. Chapter 11 is for Protocols - Console Support.
>
> Thanks,
>
> Andrew Fish
>
>
> > Thanks
> > Keshava
> >
> > On Thu, 1 Sep 2016 at 17:09 Michael Zimmermann <sigmaepsilo...@gmail.com
> >
> > wrote:
> >
> >> I can't give you sample code but if you're familiar with using UEFI
> >> protocols it's actually very easy. You just have to use
> >> the gEfiSerialIoProtocolGuid protocol which can be found in:
> >> MdePkg/Include/Protocol/SerialIo.h
> >>
> >> Thanks
> >> Michael
> >>
> >> On Thu, Sep 1, 2016 at 1:22 PM, GN Keshava <keshava...@gmail.com>
> wrote:
> >>
> >>> Hi all,
> >>>
> >>> I want to write UEFI application which reads/writes to serial IO.
> >>> Is there a sample UEFI application code available which demonstrates
> >>> Serial
> >>> IO read/write?
> >>>
> >>> Thanks.
> >>> With 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
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] UEFI Sample application for read/write serial IO

2016-09-01 Thread GN Keshava
Thanks Michael,

By sample I mean is there any code which uses Serial IO Protocol to
read/write to UART in edk2 package? or any open source code should be fine.

This is just to get an idea how I can use the protocol.

Thanks
Keshava

On Thu, 1 Sep 2016 at 17:09 Michael Zimmermann <sigmaepsilo...@gmail.com>
wrote:

> I can't give you sample code but if you're familiar with using UEFI
> protocols it's actually very easy. You just have to use
> the gEfiSerialIoProtocolGuid protocol which can be found in:
> MdePkg/Include/Protocol/SerialIo.h
>
> Thanks
> Michael
>
> On Thu, Sep 1, 2016 at 1:22 PM, GN Keshava <keshava...@gmail.com> wrote:
>
>> Hi all,
>>
>> I want to write UEFI application which reads/writes to serial IO.
>> Is there a sample UEFI application code available which demonstrates
>> Serial
>> IO read/write?
>>
>> Thanks.
>> With 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


[edk2] UEFI Sample application for read/write serial IO

2016-09-01 Thread GN Keshava
Hi all,

I want to write UEFI application which reads/writes to serial IO.
Is there a sample UEFI application code available which demonstrates Serial
IO read/write?

Thanks.
With regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] USB 3.1 Support in UEFI

2016-08-15 Thread GN Keshava
Hello Feng,

Thank you for the reply.

I understood, USB type C displayport alternate mode needs mux switch, and
hence should be supported by silicon vendor.

Whether DisplayPort is supported ? (not usb type c, i just need to use
DisplayPort (instead of vga display, i want to use displayport and
supported monitor and cable)).

Thanks again,
Keshava

On Mon, 15 Aug 2016 at 07:29 Tian, Feng <feng.t...@intel.com> wrote:

> Yes, UEFI bios supports those usb3.0 host controllers which follow XHCI
> spec(
> http://www.intel.com/content/www/us/en/io/universal-serial-bus/extensible-host-controler-interface-usb-xhci.html),
> and usb3.0 device.
>
> As for usb 3.1, it's a little complicated. What I can say is we got
> feedback it works at the configuration of usb3.0/3.1 devices plus XHCI 1.1
> compliance controllers.
>
> Last, for USB Type-C and DisplayPort Alternate Mode on USB Type-C, it's
> totally transparent for UEFI USB host controller driver and usb device
> driver. It should be supported by platform/silicon driver to switch the MUX.
>
> Thanks
> Feng
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of GN
> Keshava
> Sent: Saturday, August 13, 2016 4:40 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] USB 3.1 Support in UEFI
>
> Hi all,
>
> I heard that UEFI supports USB3.0. Please confirm.
> Also let me know if *USB3.1 is supported in UEFI?*
>
> Als, It would be helpful if anybody please let me know DisplayPort or USB
> type C is supported in UEFI.
>
> Thanks,
> With 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


[edk2] USB 3.1 Support in UEFI

2016-08-13 Thread GN Keshava
Hi all,

I heard that UEFI supports USB3.0. Please confirm.
Also let me know if *USB3.1 is supported in UEFI?*

Als, It would be helpful if anybody please let me know
DisplayPort or USB type C is supported in UEFI.

Thanks,
With regards,
Keshava
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] UEFI driver for USB CDC ACM Serial device

2016-07-07 Thread GN Keshava
Thank you so much, Feng.
Regards,
Keshava

On Fri, 8 Jul 2016 at 07:14 Tian, Feng <feng.t...@intel.com> wrote:

> No other nearer drivers you can refer to except this one.
>
> Thanks
> Feng
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of GN
> Keshava
> Sent: Friday, July 8, 2016 1:51 AM
> To: Tian, Feng <feng.t...@intel.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] UEFI driver for USB CDC ACM Serial device
>
> Thanks Feng. Even I felt the same way. Just wanted to know if there is any
> other such,  more nearer driver available in UEFI for USB to serial or USB
> CDC driver source code? Please confirm... If not, I will go with ftdi
> driver.
>
> Thanks.
> With regards,
> Keshava
>
> On 7 ಜು., 2016 ಗು. 12:48 PM Tian, Feng <feng.t...@intel.com> wrote:
>
> > You could refer to OptionRomPkg\Bus\Usb\FtdiUsbSerialDxe, which is a
> > usb2serial driver. It will produce SerialIo based on UsbIo.
> >
> >
> >
> > Thanks
> >
> > Feng
> >
> >
> >
> > *From:* GN Keshava [mailto:keshava...@gmail.com]
> > *Sent:* Thursday, July 7, 2016 11:34 AM
> > *To:* Tian, Feng <feng.t...@intel.com>; edk2-devel@lists.01.org
> > *Subject:* Re: [edk2] UEFI driver for USB CDC ACM Serial device
> >
> >
> >
> > Hi Feng,
> >
> > Thank you for your time.
> >
> > Yes, the PC is connected to board using USB cable. The board is
> > running on Linux, and it is detected as CDC serial on PC.
> >
> > On Linux Host machine, the device works straightaway as ttyACM0:
> >
> > Would you suggest any reference driver in UEFI that I can refer for
> > developing a driver for my device? Any good starting point?
> >
> > Thanks.
> > With regards,
> > Keshava GN
> >
> >
> >
> > On 7 ಜು., 2016 ಗು. 7:41 AM Tian, Feng <feng.t...@intel.com> wrote:
> >
> > Your info is insufficient.
> >
> > How is the usb2serial cable used to connect PC and the custom board?
> > Usb port is connecting to PC and the opposite end, that is serial
> > port, is connecting to the board?
> >
> > From the dump of "devices" cmd, it looks like you are connecting them
> > like above way. And the board is identified as a USB CDC device.
> >
> > So from PC view, the board is just a usb device. You should be able to
> > see UsbIo protocol is installed for this board. You could locate this
> > UsbIo to see if it provides available endpoints for your serial output
> usage.
> >
> > Thanks
> > Feng
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > GN Keshava
> > Sent: Tuesday, July 5, 2016 8:42 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] UEFI driver for USB CDC ACM Serial device
> >
> > Hi all,
> >
> > I'm new to UEFI development.
> > So far, I have learnt about UEFI shell, build procedure and
> > application basics.
> >
> > My task is to communicate to a custom board from UEFI using uefi app
> > through a USB serial cable from the PC.
> >
> > Currently, the PC is booted to UEFI shell and connected the board
> > through serial cable and I type "devices" command, I see that the
> > board is listed as
> >
> > "344 : CDC Abstract Control Model (CDC)"
> > and
> > "345: CDC ACM Data"
> >
> > Please help me to understand how I can proceed? and what works I need
> > to do in order to detect my board as Serial port? Is there any driver
> > available for this? If I need to develop the driver, please help me on
> > what would be the starting point?
> >
> > Thanks.
> > With regards.
> > Keshava GN
> > ___
> > 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
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] UEFI driver for USB CDC ACM Serial device

2016-07-07 Thread GN Keshava
Thanks Feng. Even I felt the same way. Just wanted to know if there is any
other such,  more nearer driver available in UEFI for USB to serial or USB
CDC driver source code? Please confirm... If not, I will go with ftdi
driver.

Thanks.
With regards,
Keshava

On 7 ಜು., 2016 ಗು. 12:48 PM Tian, Feng <feng.t...@intel.com> wrote:

> You could refer to OptionRomPkg\Bus\Usb\FtdiUsbSerialDxe, which is a
> usb2serial driver. It will produce SerialIo based on UsbIo.
>
>
>
> Thanks
>
> Feng
>
>
>
> *From:* GN Keshava [mailto:keshava...@gmail.com]
> *Sent:* Thursday, July 7, 2016 11:34 AM
> *To:* Tian, Feng <feng.t...@intel.com>; edk2-devel@lists.01.org
> *Subject:* Re: [edk2] UEFI driver for USB CDC ACM Serial device
>
>
>
> Hi Feng,
>
> Thank you for your time.
>
> Yes, the PC is connected to board using USB cable. The board is running on
> Linux, and it is detected as CDC serial on PC.
>
> On Linux Host machine, the device works straightaway as ttyACM0:
>
> Would you suggest any reference driver in UEFI that I can refer for
> developing a driver for my device? Any good starting point?
>
> Thanks.
> With regards,
> Keshava GN
>
>
>
> On 7 ಜು., 2016 ಗು. 7:41 AM Tian, Feng <feng.t...@intel.com> wrote:
>
> Your info is insufficient.
>
> How is the usb2serial cable used to connect PC and the custom board? Usb
> port is connecting to PC and the opposite end, that is serial port, is
> connecting to the board?
>
> From the dump of "devices" cmd, it looks like you are connecting them like
> above way. And the board is identified as a USB CDC device.
>
> So from PC view, the board is just a usb device. You should be able to see
> UsbIo protocol is installed for this board. You could locate this UsbIo to
> see if it provides available endpoints for your serial output usage.
>
> Thanks
> Feng
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of GN
> Keshava
> Sent: Tuesday, July 5, 2016 8:42 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] UEFI driver for USB CDC ACM Serial device
>
> Hi all,
>
> I'm new to UEFI development.
> So far, I have learnt about UEFI shell, build procedure and application
> basics.
>
> My task is to communicate to a custom board from UEFI using uefi app
> through a USB serial cable from the PC.
>
> Currently, the PC is booted to UEFI shell and connected the board through
> serial cable and I type "devices" command, I see that the board is listed as
>
> "344 : CDC Abstract Control Model (CDC)"
> and
> "345: CDC ACM Data"
>
> Please help me to understand how I can proceed? and what works I need to
> do in order to detect my board as Serial port? Is there any driver
> available for this? If I need to develop the driver, please help me on what
> would be the starting point?
>
> Thanks.
> With regards.
> Keshava GN
> ___
> 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


Re: [edk2] UEFI driver for USB CDC ACM Serial device

2016-07-06 Thread GN Keshava
Hi Feng,

Thank you for your time.

Yes, the PC is connected to board using USB cable. The board is running on
Linux, and it is detected as CDC serial on PC.

On Linux Host machine, the device works straightaway as ttyACM0:

Would you suggest any reference driver in UEFI that I can refer for
developing a driver for my device? Any good starting point?

Thanks.
With regards,
Keshava GN

On 7 ಜು., 2016 ಗು. 7:41 AM Tian, Feng <feng.t...@intel.com> wrote:

> Your info is insufficient.
>
> How is the usb2serial cable used to connect PC and the custom board? Usb
> port is connecting to PC and the opposite end, that is serial port, is
> connecting to the board?
>
> From the dump of "devices" cmd, it looks like you are connecting them like
> above way. And the board is identified as a USB CDC device.
>
> So from PC view, the board is just a usb device. You should be able to see
> UsbIo protocol is installed for this board. You could locate this UsbIo to
> see if it provides available endpoints for your serial output usage.
>
> Thanks
> Feng
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of GN
> Keshava
> Sent: Tuesday, July 5, 2016 8:42 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] UEFI driver for USB CDC ACM Serial device
>
> Hi all,
>
> I'm new to UEFI development.
> So far, I have learnt about UEFI shell, build procedure and application
> basics.
>
> My task is to communicate to a custom board from UEFI using uefi app
> through a USB serial cable from the PC.
>
> Currently, the PC is booted to UEFI shell and connected the board through
> serial cable and I type "devices" command, I see that the board is listed as
>
> "344 : CDC Abstract Control Model (CDC)"
> and
> "345: CDC ACM Data"
>
> Please help me to understand how I can proceed? and what works I need to
> do in order to detect my board as Serial port? Is there any driver
> available for this? If I need to develop the driver, please help me on what
> would be the starting point?
>
> Thanks.
> With regards.
> Keshava GN
> ___
> 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


[edk2] UEFI driver for USB CDC ACM Serial device

2016-07-05 Thread GN Keshava
Hi all,

I'm new to UEFI development.
So far, I have learnt about UEFI shell, build procedure and application
basics.

My task is to communicate to a custom board from UEFI using uefi app
through a USB serial cable from the PC.

Currently, the PC is booted to UEFI shell and connected the board through
serial cable and I type "devices" command, I see that the board is listed as

"344 : CDC Abstract Control Model (CDC)"
and
"345: CDC ACM Data"

Please help me to understand how I can proceed? and what works I need to do
in order to detect my board as Serial port? Is there any driver available
for this? If I need to develop the driver, please help me on what would be
the starting point?

Thanks.
With regards.
Keshava GN
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel