REM create a new directory for the source code(change to what you want)setWORKSPACE=e:\repo\uefi-simics
mkdir%WORKSPACE%REM e:cd%WORKSPACE%REM clone source codegit clone http://github.com/tianocore/edk2 --recursive
git clone https://github.com/tianocore/edk2-platforms --recursive
git clone https://github.com/tianocore/edk2-non-osi --recursive
git clone https://github.com/intel/FSP --recursive
cd%WORKSPACE%\edk2
git checkout edk2-stable202405 -b edk2-stable202405
REM set PACKAGES_PATH=%WORKSPACE%\edk2;REM set PACKAGES_PATH=%PACKAGES_PATH%;%WORKSPACE%\edk2-platformsREM set PACKAGES_PATH=%PACKAGES_PATH%;%WORKSPACE%\edk2-platforms/Platform/IntelREM set PACKAGES_PATH=%PACKAGES_PATH%;%WORKSPACE%\edk2-platforms/Silicon/IntelREM set PACKAGES_PATH=%PACKAGES_PATH%;%WORKSPACE%\edk2-platforms/Features/Intelcd%WORKSPACE%edk2\edksetup.bat VS2019
cd%WORKSPACE%\edk2-platforms\Platform\Intel
REM set PYTHON_HOME=C:\Python312python build_bios.py -p BoardX58Ich10X64
REM The generated UEFI BIOS located at %WORKSPACE%\Build\SimicsOpenBoardPkg\BoardX58Ich10\DEBUG_VS2015\FV\BOARDX58ICH10.fd
我們還需要產生一個 disk image 用來放一些 Efi shell 或是你想要的任何東西進去。
1
2
3
4
5
6
7
8
9
10
11
REM Go into command prompt with administrator privilegesREM and run `diskpart` for next commandsREM Change file path to yours, 1024 means size is 1024 MBcreate vdisk file=c:\Users\XXXX\simics-projects\my-simics-project-1\targets\qsp-x86\disk.vhd maximum=1024
select vdisk file=c:\Users\XXXX\simics-projects\my-simics-project-1\targets\qsp-x86\disk.vhd
attach vdisk
clean
create partition primary
assign
format quick fs=fat32
到這邊你應該可以從檔案總管發現有一個新的磁碟掛上來,大小為 1G,然後你可以開始在裡面放東西
1
detach vdisk
如果都放好了就把它 detach 掉。
產生我們自己的 simics script
到了這個步驟,我們已經有了 UEFI image,還有一個想要用來開機的 disk image,接下來我們可以來準備該怎麼告訴 simics 要怎麼使用這兩個東西了。
若你已經安裝好 simics 而且產生了 project,預設應該會建立在 c:\Users\XXXX\simics-projects\ 這個位置下面會有你自己建立的 project name 的目錄,舉例為 my-simics-project-1
# Point to your UEFI image
$bios_image = "e:\\repo\\uefi-simics\\Build\\SimicsOpenBoardPkg\\BoardX58Ich10\\DEBUG_VS2015\\FV\\BOARDX58ICH10.fd"
# Point to your disk image
$disk0_image="c:\\Users\\XXXX\\simics-projects\\my-simics-project-1\\targets\\qsp-x86\\disk.vhd"
$show_con0=TRUE
# directory name `simics-qsp-x86-6.0.80` might changed in different version of simics
run-command-file "E:\\Simics\\simics-qsp-x86-6.0.80\\targets\\qsp-x86\\qsp-hdd-boot.simics"
run