public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* EDK II debug question
@ 2018-01-20  6:58 JUNWEN JIA
  2018-01-22 13:19 ` Paulo Alcantara
  0 siblings, 1 reply; 5+ messages in thread
From: JUNWEN JIA @ 2018-01-20  6:58 UTC (permalink / raw)
  To: edk2-devel@lists.01.org


Hi:
    Could you please tell how to build assembly language using EDK2?
I tried to create a .c file in AppPkg, but it goes like this:
#include<BaseLib.h>
Void main()
{
_asm{}
}
I used X64 to compile this project, but it seems content like _asm{} is not supported.
Do I need to add extra files? And  where should I add them?


Best regards, Thanks!
发送自 Windows 10 版邮件应用


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

* Re: EDK II debug question
  2018-01-20  6:58 EDK II debug question JUNWEN JIA
@ 2018-01-22 13:19 ` Paulo Alcantara
  2018-01-22 15:18   ` Gao, Liming
  0 siblings, 1 reply; 5+ messages in thread
From: Paulo Alcantara @ 2018-01-22 13:19 UTC (permalink / raw)
  To: JUNWEN JIA, edk2-devel@lists.01.org

On 1/20/2018 4:58 AM, JUNWEN JIA wrote:
> 
> Hi:
>      Could you please tell how to build assembly language using EDK2?
> I tried to create a .c file in AppPkg, but it goes like this:
> #include<BaseLib.h>
> Void main()
> {
> _asm{}
> }
> I used X64 to compile this project, but it seems content like _asm{} is not supported.
> Do I need to add extra files? And  where should I add them?

AFAIK, inline assembly is not supported in X64 MSFT compiler.

Paulo


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

* Re: EDK II debug question
  2018-01-22 13:19 ` Paulo Alcantara
@ 2018-01-22 15:18   ` Gao, Liming
  2018-01-22 16:16     ` Andrew Fish
  0 siblings, 1 reply; 5+ messages in thread
From: Gao, Liming @ 2018-01-22 15:18 UTC (permalink / raw)
  To: Paulo Alcantara, JUNWEN JIA, edk2-devel@lists.01.org

You need to write the separate assembly file. Edk2 prefres to use nasm assembly for IA32 and X64 arch. 

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Paulo Alcantara
> Sent: Monday, January 22, 2018 9:20 PM
> To: JUNWEN JIA <jiajunwen123@gmail.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] EDK II debug question
> 
> On 1/20/2018 4:58 AM, JUNWEN JIA wrote:
> >
> > Hi:
> >      Could you please tell how to build assembly language using EDK2?
> > I tried to create a .c file in AppPkg, but it goes like this:
> > #include<BaseLib.h>
> > Void main()
> > {
> > _asm{}
> > }
> > I used X64 to compile this project, but it seems content like _asm{} is not supported.
> > Do I need to add extra files? And  where should I add them?
> 
> AFAIK, inline assembly is not supported in X64 MSFT compiler.
> 
> Paulo
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: EDK II debug question
  2018-01-22 15:18   ` Gao, Liming
@ 2018-01-22 16:16     ` Andrew Fish
  2018-01-24  2:23       ` 答复: " JUNWEN JIA
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Fish @ 2018-01-22 16:16 UTC (permalink / raw)
  To: Gao, Liming; +Cc: Paulo Alcantara, JUNWEN JIA, edk2-devel@lists.01.org

Also the BaseLib has a lot of C APIs that abstract  a lot of common things you use online assembly for.  Not to mention that how to do inline assembly is not standard in C.
> On Jan 22, 2018, at 7:18 AM, Gao, Liming <liming.gao@intel.com> wrote:
> 
> You need to write the separate assembly file. Edk2 prefres to use nasm assembly for IA32 and X64 arch. 
> 
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Paulo Alcantara
>> Sent: Monday, January 22, 2018 9:20 PM
>> To: JUNWEN JIA <jiajunwen123@gmail.com>; edk2-devel@lists.01.org
>> Subject: Re: [edk2] EDK II debug question
>> 
>>> On 1/20/2018 4:58 AM, JUNWEN JIA wrote:
>>> 
>>> Hi:
>>>     Could you please tell how to build assembly language using EDK2?
>>> I tried to create a .c file in AppPkg, but it goes like this:
>>> #include<BaseLib.h>
>>> Void main()
>>> {
>>> _asm{}
>>> }
>>> I used X64 to compile this project, but it seems content like _asm{} is not supported.
>>> Do I need to add extra files? And  where should I add them?
>> 
>> AFAIK, inline assembly is not supported in X64 MSFT compiler.
>> 
>> Paulo
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* 答复: EDK II debug question
  2018-01-22 16:16     ` Andrew Fish
@ 2018-01-24  2:23       ` JUNWEN JIA
  0 siblings, 0 replies; 5+ messages in thread
From: JUNWEN JIA @ 2018-01-24  2:23 UTC (permalink / raw)
  To: Andrew Fish, Gao, Liming; +Cc: Paulo Alcantara, edk2-devel@lists.01.org

Hi:
Thanks for your replies. I referred to some examples in baselib, for example,WriteMsr64.asm, WriteMsr64.nasm, 
WriteMsr64.c and create Reboot.asm, Reboot.nasm, Reboot.c file in MdePkg->Library->BaseLib-> Ia32. I also made some 
corresponding Changes in BaseLib.inf and other files. And I did avoid to use X64 arch. So my cmos.c source file in AppPkg is like 
this:
#include<Library/BaseLib.h>
Void main()
{
Reboot();
}
But the compiled result is Reboot.lib(Reboot.obj):error LNK2001:
####\DEBUG\cmos.dll:fatal error LINK1120:1

The picture is the compiled result, and I wonder if I missed to create or modify some files?

Thanks for helping !
Best Regards!
发送自 Windows 10 版邮件应用

发件人: Andrew Fish
发送时间: Tuesday, January 23, 2018 12:16 AM
收件人: Gao, Liming
抄送: Paulo Alcantara; JUNWEN JIA; edk2-devel@lists.01.org
主题: Re: [edk2] EDK II debug question

Also the BaseLib has a lot of C APIs that abstract  a lot of common things you use online assembly for.  Not to mention that how to do inline assembly is not standard in C.
> On Jan 22, 2018, at 7:18 AM, Gao, Liming <liming.gao@intel.com> wrote:
> 
> You need to write the separate assembly file. Edk2 prefres to use nasm assembly for IA32 and X64 arch. 
> 
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Paulo Alcantara
>> Sent: Monday, January 22, 2018 9:20 PM
>> To: JUNWEN JIA <jiajunwen123@gmail.com>; edk2-devel@lists.01.org
>> Subject: Re: [edk2] EDK II debug question
>> 
>>> On 1/20/2018 4:58 AM, JUNWEN JIA wrote:
>>> 
>>> Hi:
>>>     Could you please tell how to build assembly language using EDK2?
>>> I tried to create a .c file in AppPkg, but it goes like this:
>>> #include<BaseLib.h>
>>> Void main()
>>> {
>>> _asm{}
>>> }
>>> I used X64 to compile this project, but it seems content like _asm{} is not supported.
>>> Do I need to add extra files? And  where should I add them?
>> 
>> AFAIK, inline assembly is not supported in X64 MSFT compiler.
>> 
>> Paulo
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



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

end of thread, other threads:[~2018-01-24  2:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-20  6:58 EDK II debug question JUNWEN JIA
2018-01-22 13:19 ` Paulo Alcantara
2018-01-22 15:18   ` Gao, Liming
2018-01-22 16:16     ` Andrew Fish
2018-01-24  2:23       ` 答复: " JUNWEN JIA

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