From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c00::236; helo=mail-pf0-x236.google.com; envelope-from=jiajunwen123@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 20F7C2205B916 for ; Tue, 23 Jan 2018 18:18:06 -0800 (PST) Received: by mail-pf0-x236.google.com with SMTP id e11so1882712pff.6 for ; Tue, 23 Jan 2018 18:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:cc:from:subject:date:importance :in-reply-to:references; bh=qpJhuJt5q6cvHj+vBvi5q7kIq1YJ3kixYu8jV+IzzQM=; b=F5Zq0aEmAVJJ3hgiGGHC9OF3GDwLuv34sTEuZuDBNIuGgXXy69OcbjKWJFcK+HWzWG VfUcfxjLHVGlK2EEOcvZ9icwPaa0pUxPmrKN3D8wuS/METvQPAYntsSdCODEsjct+pLU nHE4b8dYc9OpdBLwVk1MJVzNS5Ymxc1g10XJv9jIpRS2MNUIznRacDzs0gYY2bHo0PDw HO24A8qb/uf9hvfKefLIxxdTdbeq5XTbcHO4+PL1mHamT2gi5RcGuFNH55dgwomdhh1R rS3c6aAR6h0Rsv/u4q4D4lMOw5wqOldn0EooenLwEsWjo9U7zsxliua7NS+lIrfqr29+ vz0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:cc:from:subject:date :importance:in-reply-to:references; bh=qpJhuJt5q6cvHj+vBvi5q7kIq1YJ3kixYu8jV+IzzQM=; b=sXndRK4T45x3cEIp/DAhexbkE7nH3+g1r7WmNmmCLUUbnq483kqfKJ2CZ1ilIcuLqN XIAPrR4GYzdh0/fAJGAZN+ymrPnv5XsiUTplB8ba1EPNZ71kFZXWL51p4VCEhNxgvAD3 Tg8PpS7gNbI9Z/1anhBvjLusTtw2LMD/deKrITKdFPSdE1YsI2dUl2G3v1P/GC7lHCjR gtaKrBhU9Kk2g2L86uvZvz6X642viWT2oiLzb8FjAupMaZ5BSozj2syFcVlpvdYbPXt5 EYcY5sm+vN0mUreXI3ia68kcnAqqdGiNKzI/xXlNOSz0PwappXlW4xFxOni09pm8xBEP gGLg== X-Gm-Message-State: AKwxytd5fvcJaqUcs8wuql6uQudoRlb5LVtjG5Zl0p/8NtDWHDlPV9Kl QKjyzJVpny/WHWB93os1+w== X-Google-Smtp-Source: AH8x227wqnTk3EYQVI6wEpdv1Fs1CwPt4ivNVv26JBK8Erx/uPQRy1DojmI7/OxU/1lyicIwyB6fDg== X-Received: by 10.99.103.198 with SMTP id b189mr9480408pgc.20.1516760614152; Tue, 23 Jan 2018 18:23:34 -0800 (PST) Received: from ?IPv6:::ffff:172.31.1.117? ([116.6.89.187]) by smtp.gmail.com with ESMTPSA id t8sm9240827pgn.93.2018.01.23.18.23.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 18:23:33 -0800 (PST) Message-ID: <5a67ee25.4895630a.91a34.55ac@mx.google.com> MIME-Version: 1.0 To: Andrew Fish , "Gao, Liming" Cc: Paulo Alcantara , "edk2-devel@lists.01.org" From: JUNWEN JIA Date: Wed, 24 Jan 2018 10:23:30 +0800 Importance: normal X-Priority: 3 In-Reply-To: References: <5a62e8aa.56b56b0a.84753.5dc4@mx.google.com> <13c16790-8e53-a88a-090e-2b6004f5e27b@paulo.ac> <4A89E2EF3DFEDB4C8BFDE51014F606A14E1A776C@SHSMSX104.ccr.corp.intel.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: =?UTF-8?B?562U5aSNOiBFREsgSUkgZGVidWcgcXVlc3Rpb24=?= X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 02:18:07 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi: Thanks for your replies. I referred to some examples in baselib, for examp= le,WriteMsr64.asm, WriteMsr64.nasm,=20 WriteMsr64.c and create Reboot.asm, Reboot.nasm, Reboot.c file in MdePkg->= Library->BaseLib-> Ia32. I also made some=20 corresponding Changes in BaseLib.inf and other files. And I did avoid to u= se X64 arch. So my cmos.c source file in AppPkg is like=20 this: #include 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! =E5=8F=91=E9=80=81=E8=87=AA Windows 10 =E7=89=88=E9=82=AE=E4=BB=B6=E5=BA= =94=E7=94=A8 =E5=8F=91=E4=BB=B6=E4=BA=BA: Andrew Fish =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: Tuesday, January 23, 2018 12:16 AM =E6=94=B6=E4=BB=B6=E4=BA=BA: Gao, Liming =E6=8A=84=E9=80=81: Paulo Alcantara; JUNWEN JIA; edk2-devel@lists.01.org =E4=B8=BB=E9=A2=98: 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 assembl= y is not standard in C. > On Jan 22, 2018, at 7:18 AM, Gao, Liming wrote: >=20 > You need to write the separate assembly file. Edk2 prefres to use nasm a= ssembly for IA32 and X64 arch.=20 >=20 >> -----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 ; edk2-devel@lists.01.org >> Subject: Re: [edk2] EDK II debug question >>=20 >>> On 1/20/2018 4:58 AM, JUNWEN JIA wrote: >>>=20 >>> 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 >>> Void main() >>> { >>> _asm{} >>> } >>> I used X64 to compile this project, but it seems content like _asm{} i= s not supported. >>> Do I need to add extra files? And where should I add them? >>=20 >> AFAIK, inline assembly is not supported in X64 MSFT compiler. >>=20 >> 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