-

   rss_rss_hh_full

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 1

:


[ ] UEFI BIOS Visual Studio. 1 ,

, 19 2017 . 17:00 +
DarkTiger 17:00

UEFI BIOS Visual Studio. 1 ,


, UEFI edk2 Visual Studio, , . git clone ... , , . 64- Windows 7 c Visual Studio 2008-2016. , edk2-Visual Studio , .

UEFI , . , , VS , Eclipse.

, ( , ), HII (, BIOS Setup), , Boot Manager, ().


.

, . - , - , . , , .


1) . Evaluation Boards, Intel BlueBox JTAG $3000. 32- OVMF qemu UEFI Firmware. , .

2) Visual Studio, .. breakpoints, watch, step execution . 8-10 .

3) Windows- -. , UEFI Shell, Windows.

4) , /++.

,


1) DXE ( UEFI Shell) . , , Intel-. , . , , , , coreboot.

2) UEFI , Dell, MSI , . , . , , , , ?, .

3) Visual Studio. gcc cygwin, icc, , .
, , , .


, . :/FW. FW , , . -, , , .

, git , cmd ( Far Commander, ) :
git clone https://github.com/ProgrammingInUEFI/FW
, , github, zip- :/FW.

, , . , - :



, VS2010


c:\FW\edk2\Conf\target.txt
TOOL_CHAIN_TAG = VS2010x86
VS2010x86 Visual Studio. Visual Studio 2010 , VS , c:\FW\edk2\Conf\tools_def.txt
, edk2 . ( , () CodeRush ). , MSVS , 2017.

Visual Studio


Visual Studio, Solution NT32.sln C:\FW\VS\NT32. , solution NT32, . . , . , , .

,
Tools->Options c:\FW\VS, VS , , :



, :


Solution NT32 Visual C++ ( Solution NT32, Add->New Project, Makefile Project), MyFirstUEFIProject ( ). Finish.



Solution NT32, Project->Properties .

NMake


Configurarion Properties ->NMake, Build Command Line



Edit :

set NASM_PREFIX=C:\FW\NASM\
call c:\FW\edk2\edksetup.bat --nt32
build

, . , bat- makefile.

NASM_PREFIX , edk2, , nasm.exe. , .

edk2 ( VS ). nt32 , (package) Nt32Pkg, C:\FW\edk2\Nt32Pkg. , , .

(build.exe C:\FW\edk2\BaseTools\Bin\Win32, , edksetup.bat)

, Build Command Line:



Rebuild Command Line Edit

set NASM_PREFIX=C:\FW\NASM\
call c:\FW\edk2\edksetup.bat --nt32 
build clean
build

build clean , . .

Clean Command Line, , :

set NASM_PREFIX=C:\FW\NASM\
call  c:\FW\edk2\edksetup.bat --nt32 
build clean

, , 99% Rebuild, , github.
, :



NMake.

Debugging


, Debugging :
Command:

C:\FW\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\SecMain.exe

Working Directory:

C:\FW\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\

:
SecMain.exe , , bootloader-a, .
, .

, :



.


Build Solution, , , 10-15 , . , :
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
- , , . :
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
VS2010 , VS2010 SP1. SP1, .

, NT32 . TOOL_CHAIN_TAG , tools_def.txt. , Visual Studio , , , .

UEFI Shell


, , . F5 ( ) :



, UEFI Shell. , , .

1. , 10 . fs0 (UEFI Shell ) ls b, b Enter , , .
, Working Directory Visual Studio C:\FW\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\. , ( ) Far Commander ( Total Commander), UEFI Shell.

2. UEFI Shell hel, Tab Helloworld.efi. , , , Enter, - ! UEFI Hello World!. ( ) .

3. exit :


, . Reset , MSVC.


, , . , . , HelloWorld, , , UEFI Driver Wizard, UEFI ( ) , 90% . , , UEFI Driver Wizard, -, .

, Visual Studio
C:\FW\edk2\MdeModulePkg\Application\HelloWorld\HelloWorld.c

, :

Print (L"I did it in UEFI!\r\n");

, , edk2 , . breakpoint , Visual Studio.
F5, fs0, HelloWorld :



. UEFI Shell, , .

? , .
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/338264/

:  

: [1] []
 

:
: 

: ( )

:

  URL