Re: [edk2] How to include a .FFS file directly into an .FV

2014-06-11 Thread Lin, Jie
Maybe. But I have not tried it from fdf yet. /Auber

From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Thursday, June 12, 2014 1:29 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV

You can't do it from .fdf? Tim

From: Lin, Jie [mailto:jie@intel.com]
Sent: Wednesday, June 11, 2014 10:23 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV

Tim,
You need a tool to add FFS into FV. Intel Tiano team has 
developed a tool called FMMT that could meet your need.

Cheers!
Auber

From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Thursday, June 12, 2014 5:50 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV

Andrew. Yes. I'm trying to put an already-formed FFS file, complete with 
header, file type, etc. I could use SECTION or I could create an INF, but I'd 
rather do neither and just use the FFS. Hmmm...

Tim

From: Andrew Fish [mailto:af...@apple.com]
Sent: Wednesday, June 11, 2014 2:44 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV


On Jun 11, 2014, at 2:16 PM, Tim Lewis 
mailto:tim.le...@insyde.com>> wrote:

I have the .FFS, complete with dependency expression sections and UI sections, 
etc. And now I want to include that into my FV in my FDF

FILE RAW doesn't do it (the filetype is always RAW). How do I do it? There is a 
NON_FFS_FILE in the spec, but I can't see it in the grammar.


I've used `FILE FREEFORM` but I think that may just push your problem to the 
SECTION.

Thanks,

Andrew Fish

Tim
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] How to include a .FFS file directly into an .FV

2014-06-11 Thread Tim Lewis
You can't do it from .fdf? Tim

From: Lin, Jie [mailto:jie@intel.com]
Sent: Wednesday, June 11, 2014 10:23 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV

Tim,
You need a tool to add FFS into FV. Intel Tiano team has 
developed a tool called FMMT that could meet your need.

Cheers!
Auber

From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Thursday, June 12, 2014 5:50 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV

Andrew. Yes. I'm trying to put an already-formed FFS file, complete with 
header, file type, etc. I could use SECTION or I could create an INF, but I'd 
rather do neither and just use the FFS. Hmmm...

Tim

From: Andrew Fish [mailto:af...@apple.com]
Sent: Wednesday, June 11, 2014 2:44 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV


On Jun 11, 2014, at 2:16 PM, Tim Lewis 
mailto:tim.le...@insyde.com>> wrote:

I have the .FFS, complete with dependency expression sections and UI sections, 
etc. And now I want to include that into my FV in my FDF

FILE RAW doesn't do it (the filetype is always RAW). How do I do it? There is a 
NON_FFS_FILE in the spec, but I can't see it in the grammar.


I've used `FILE FREEFORM` but I think that may just push your problem to the 
SECTION.

Thanks,

Andrew Fish

Tim
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] How to include a .FFS file directly into an .FV

2014-06-11 Thread Lin, Jie
Tim,
You need a tool to add FFS into FV. Intel Tiano team has 
developed a tool called FMMT that could meet your need.

Cheers!
Auber

From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Thursday, June 12, 2014 5:50 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV

Andrew. Yes. I'm trying to put an already-formed FFS file, complete with 
header, file type, etc. I could use SECTION or I could create an INF, but I'd 
rather do neither and just use the FFS. Hmmm...

Tim

From: Andrew Fish [mailto:af...@apple.com]
Sent: Wednesday, June 11, 2014 2:44 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV


On Jun 11, 2014, at 2:16 PM, Tim Lewis 
mailto:tim.le...@insyde.com>> wrote:

I have the .FFS, complete with dependency expression sections and UI sections, 
etc. And now I want to include that into my FV in my FDF

FILE RAW doesn't do it (the filetype is always RAW). How do I do it? There is a 
NON_FFS_FILE in the spec, but I can't see it in the grammar.


I've used `FILE FREEFORM` but I think that may just push your problem to the 
SECTION.

Thanks,

Andrew Fish

Tim
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] How to include a .FFS file directly into an .FV

2014-06-11 Thread Tim Lewis
Andrew. Yes. I'm trying to put an already-formed FFS file, complete with 
header, file type, etc. I could use SECTION or I could create an INF, but I'd 
rather do neither and just use the FFS. Hmmm...

Tim

From: Andrew Fish [mailto:af...@apple.com]
Sent: Wednesday, June 11, 2014 2:44 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to include a .FFS file directly into an .FV


On Jun 11, 2014, at 2:16 PM, Tim Lewis 
mailto:tim.le...@insyde.com>> wrote:


I have the .FFS, complete with dependency expression sections and UI sections, 
etc. And now I want to include that into my FV in my FDF

FILE RAW doesn't do it (the filetype is always RAW). How do I do it? There is a 
NON_FFS_FILE in the spec, but I can't see it in the grammar.


I've used `FILE FREEFORM` but I think that may just push your problem to the 
SECTION.

Thanks,

Andrew Fish


Tim
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] How to include a .FFS file directly into an .FV

2014-06-11 Thread Andrew Fish

On Jun 11, 2014, at 2:16 PM, Tim Lewis  wrote:

> I have the .FFS, complete with dependency expression sections and UI 
> sections, etc. And now I want to include that into my FV in my FDF
>  
> FILE RAW doesn’t do it (the filetype is always RAW). How do I do it? There is 
> a NON_FFS_FILE in the spec, but I can’t see it in the grammar.
>  

I’ve used `FILE FREEFORM` but I think that may just push your problem to the 
SECTION.

Thanks,

Andrew Fish

> Tim
> --
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems___
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


[edk2] How to include a .FFS file directly into an .FV

2014-06-11 Thread Tim Lewis
I have the .FFS, complete with dependency expression sections and UI sections, 
etc. And now I want to include that into my FV in my FDF

FILE RAW doesn't do it (the filetype is always RAW). How do I do it? There is a 
NON_FFS_FILE in the spec, but I can't see it in the grammar.

Tim
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] Load ASM code in memory

2014-06-11 Thread Andrew Fish

On Jun 11, 2014, at 2:02 AM, Thomas Letan  wrote:

> Hello everyone.
> 
> I am currently working on UEFI and more precisely on SMM with UEFI.
> To handle correctly #SMI, I have to load some piece of code in RAM. In
> order to do some tests, I wrote my assembly code, compile it with nasm,
> get the binary content thanks to objdump and save it in a char[]
> variable. Not very clean way to do it, IMHO.
> 

All EFI applications and drivers are relocatable PE/COFF images that get  
“loaded into memory” and relocated from their linked address to the load 
address. 
So compiling the code as a PE/COFF executable is the way to do it. The *.EFI 
images from the build output are PE/COFF images. 

What do you need to do that  is different? 

EFI supports loading/relocating PE/COFF images into memory via 
gBS->LoadImage()/gBS->StartImage(). 

You can write an EFI Application/Driver in assembly if you want in the edk2 
build system. Not sure why you would. The entry point would be the C function 
name _ModuleEntryPoint (some compilers add an extra _ in the front of C names). 

> Is there an “EDKII way” to do it? For what I saw, the C files of EDKII
> do not contain a single line of asm, which are written in a separate file.
> 

As there is no C standard for inline assembly. So doing that makes code non 
portable. Not to mention the assembly is not portable between different CPU 
architectures. 

In the EDKII you can use the BaseLib to access CPU registers: 
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Library/BaseLib.h
Thus you generally don’t need assembly. You generally only need assembly code 
for x86 mode changes, interrupt/exception handling, and SMM init/handling. 

Thanks,

Andrew Fish


> Thank you for your time
> Thomas
> 
> --
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems___
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] Load ASM code in memory

2014-06-11 Thread Brian J. Johnson
On 06/11/2014 11:31 AM, Bill Paul wrote:
> Of all the gin joints in all the towns in all the world, Thomas Letan had to
> walk into mine at 02:02:13 on Wednesday 11 June 2014 and say:
>
>> Hello everyone.
>>
>> I am currently working on UEFI and more precisely on SMM with UEFI.
>> To handle correctly #SMI, I have to load some piece of code in RAM. In
>> order to do some tests, I wrote my assembly code, compile it with nasm,
>> get the binary content thanks to objdump and save it in a char[]
>> variable. Not very clean way to do it, IMHO.
>>
>> Is there an “EDKII way” to do it? For what I saw, the C files of EDKII
>> do not contain a single line of asm, which are written in a separate file.
>>
>> Thank you for your time
>> Thomas
>
> I don't think there is an "EDKII way" to do what you're doing. The problem is
> that the EDKII is meant to be built using a number of different C compiler
> implementations, and embedded assembly usage is not part of the ANSI C
> specification so there's no portable syntax for it. GNU C does it one way,
> Microsoft C does it another, the Wind River Diab C compiler does it yet
> another (as I have had to learn), the SunPRO C compiler probably also does it
> yet another, and so on. I think the Intel C compiler (icc) actually imitates
> the GCC syntax, but that's a rare exception.
>
> This is also why there are two versions of each Intel assembly code file in
> the EDKII: there's one written in AT&T syntax for the GNU assembler and
> another written in Intel syntax for the Microsoft assembler.
>
> The code that goes into the EDKII itself has to be written like this so that
> everybody can use it. But if you're writing this code for a custom project
> that is proprietary (and hence will have its distribution tightly controlled
> and you're not going to contribute it for inclusion in EDKII) and your project
> mandates a specific set of compiler tools, then I suppose there's nothing to
> stop you from using your chosen compiler's embedded assembly syntax to include
> the code in your C files.

All true.

There are some examples in the tree of copying assembled code around to 
other locations, such as the code which sets up the 64-bit IDT in 
MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c.  See 
MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.{S,asm}.  That may be 
what you're looking for?
-- 

 Brian



   "Twenty years from now you will be more disappointed by the things
that you didn't do than by the ones you did do.  So throw off the
bowlines.  Sail away from the safe harbor. Catch the trade winds
in your sails.  Explore.  Dream.  Discover."
-- Mark Twain

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] Load ASM code in memory

2014-06-11 Thread Bill Paul
Of all the gin joints in all the towns in all the world, Thomas Letan had to 
walk into mine at 02:02:13 on Wednesday 11 June 2014 and say:

> Hello everyone.
> 
> I am currently working on UEFI and more precisely on SMM with UEFI.
> To handle correctly #SMI, I have to load some piece of code in RAM. In
> order to do some tests, I wrote my assembly code, compile it with nasm,
> get the binary content thanks to objdump and save it in a char[]
> variable. Not very clean way to do it, IMHO.
> 
> Is there an “EDKII way” to do it? For what I saw, the C files of EDKII
> do not contain a single line of asm, which are written in a separate file.
> 
> Thank you for your time
> Thomas

I don't think there is an "EDKII way" to do what you're doing. The problem is 
that the EDKII is meant to be built using a number of different C compiler 
implementations, and embedded assembly usage is not part of the ANSI C 
specification so there's no portable syntax for it. GNU C does it one way, 
Microsoft C does it another, the Wind River Diab C compiler does it yet 
another (as I have had to learn), the SunPRO C compiler probably also does it 
yet another, and so on. I think the Intel C compiler (icc) actually imitates 
the GCC syntax, but that's a rare exception.

This is also why there are two versions of each Intel assembly code file in 
the EDKII: there's one written in AT&T syntax for the GNU assembler and 
another written in Intel syntax for the Microsoft assembler.

The code that goes into the EDKII itself has to be written like this so that 
everybody can use it. But if you're writing this code for a custom project 
that is proprietary (and hence will have its distribution tightly controlled 
and you're not going to contribute it for inclusion in EDKII) and your project 
mandates a specific set of compiler tools, then I suppose there's nothing to 
stop you from using your chosen compiler's embedded assembly syntax to include 
the code in your C files.

-Bill

-- 
=
-Bill Paul(510) 749-2329 | Senior Member of Technical Staff,
 wp...@windriver.com | Master of Unix-Fu - Wind River Systems
=
   "I put a dollar in a change machine. Nothing changed." - George Carlin
=

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] OpenProtocol by UEFI application with removal notification

2014-06-11 Thread Laszlo Ersek
On 06/11/14 06:50, Andrew fish wrote:
> I posted a while back on the list how to do this. Search for
> safeopenprotocol.
> 
> You can use the driver binding protocol to make it safe, but you need
> to wrap the protocol access in a library for the application.

>> On Jun 10, 2014, at 8:31 PM, Evgeny Yakovlev  wrote:

>> Is it possible for UEFI application to open a protocol and receive
>> some kind of a notification is about to be disconnected? I know
>> that drivers can use BY_DRIVER and receve driver binding Stop(),
>> but what about applications?
>> 
>> What i am trying to do is work with removable media and detect when
>> UsbIo protocol i got in an application is about to be removed.

It was unusually hard for me to find Andrew's library. It had not been
easy for others either, as indicated by

http://thread.gmane.org/gmane.comp.bios.tianocore.devel/3850/focus=3861

The patch is attached to:

http://thread.gmane.org/gmane.comp.bios.tianocore.devel/1989

  From: Andrew Fish 
  Date: Mon, 11 Feb 2013 11:33:27 -0800
  Message-id: 
  Subject: Re: [edk2] Device Type?

The patch in the GMANE archive (see link above) has a bunch of zeroes
appended (full size: 94222), but it otherwise matches the "safe.patch"
file that I have in my mailbox (full size: 60138).

Laszlo

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


[edk2] Load ASM code in memory

2014-06-11 Thread Thomas Letan
Hello everyone.

I am currently working on UEFI and more precisely on SMM with UEFI.
To handle correctly #SMI, I have to load some piece of code in RAM. In
order to do some tests, I wrote my assembly code, compile it with nasm,
get the binary content thanks to objdump and save it in a char[]
variable. Not very clean way to do it, IMHO.

Is there an “EDKII way” to do it? For what I saw, the C files of EDKII
do not contain a single line of asm, which are written in a separate file.

Thank you for your time
Thomas



signature.asc
Description: OpenPGP digital signature
--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel