uEFI

UEFI LoadImage hangs

和自甴很熟 提交于 2019-12-25 07:48:32
问题 I am looking at using Bootservices function LoadImage to load a UEFI application image from memory. Function parameters are: typedef EFI_STATUS LoadImage ( IN BOOLEAN BootPolicy, IN EFI_HANDLE ParentImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize, OUT EFI_HANDLE *ImageHandle ); I have sourcebuffer in memory and populated with the PE/COFF image to load. I pass that in under SourceBuffer and set DevicePath to the following: MEMMAP_DEVICE

What is UEFI's boot sequence?

删除回忆录丶 提交于 2019-12-24 19:34:00
问题 I tried to find answer to this question in Internet, but got no luck. Also, while analyzing source codes of "edk2" folder (TianoCore), I couldn't find the answer. P.S. I understand, that Intel provides a lot of documentation, but it is difficult to find generalized information about boot flow in thousands of documentation's pages. That's why I'm asking for help from the community! 回答1: As UEFI Specification (see 3 Boot Manager for more information) states: The boot sequence for UEFI consists

UEFI Resolve full path

痴心易碎 提交于 2019-12-24 08:59:29
问题 I'm working on a bootloader of sorts using GNU-EFI. So far I've been able to read the Boot#### NVRAM variable, so I have a semi-populated FilePathList[] , which looks like this (printed with DevicePathToStr ): HD(Part2, SigCD0400E6-54F3-49F4-81F2-65B21E8278A8)/\EFI\Microsoft\Boot\bootmgfw.efi When passed to LoadImage it fails with EFI_NOT_FOUND . As I understand it (UEFI Doc Section 3.1.2), I need to add the full path before what I already have. I've found out that the correct path is PciRoot

How to compile uefi application using gnu-efi?

别说谁变了你拦得住时间么 提交于 2019-12-24 03:28:05
问题 I tried to compile uefi code using gnu-efi . But I don't understand how to compile my uefi application code. I get gnu-efi 3.0.2, decompress and type make && make install . I write hello world code: #include <efi.h> #include <efilib.h> EFI_STATUS efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { InitializeLib(ImageHandle, SystemTable); Print(L"Hello, world!\n"); return EFI_SUCCESS; } My OS is Ubuntu 15.04. 回答1: Include the gnu-efi files #include <efi.h> #include <efilib.h> it

3. UEFI 编程环境搭建和使用EmulatorPkg 模拟器调试

寵の児 提交于 2019-12-24 00:54:26
一、Windows下环境的搭建 1.安装windows下nasm汇编支持 2.安装python(安装PATH方式) 3.安装vs2017 操作执行: 在根目录执行edksetup.bat,确认PATH是否正确 在BaseTool里面,编译工具,使用nmake 然后buildEmulatorPkg ,最后跑模拟器调试(在buildEmulatorPkg 的ReadMe查看) 二、linux下环境搭建 1.更新软件源,sudo apt-get update 2.安装gcc4.8 sudo apt-get install gcc-4.8 g++-4.8 如果已经安装gcc,可以使用下面命令切换 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50 sudo update-alternatives --config gcc 3.安装nasm sudo apt-get install nasm 4.安装build sudo apt-get install build-essential uuid-dev 5.安装python sudo apt-get install

戴尔台式机安装win 7系统

♀尐吖头ヾ 提交于 2019-12-23 12:36:05
使用相应品牌电脑进入BIOS的快捷键,进入BIOS设置 1、BIOS引导】: 传统的电脑通常都是使用BIOS引导,开机BIOS初始化,然后BIOS自检,再引导操作系统→进入系统,显示桌面。 (选择Setup是进入BIOS) 2、光盘启动: 在BIOS引导的情况下,通常使用安装光盘维护、安装操作性系统,只要找到CD-ROM(或者DVD,主板菜单不一样)使用上下键,选中此项,按回车键(Enter)予以确认,再按F10键,重启电脑,就能认光驱里面的安装光盘了。 3、u盘启动: 在BIOS引导下,u盘PE系统的操作和光驱引导设置方法类似,只要找到USB选项(有的主板是显示u盘的型号),设置为第一启动项即可,重启电脑就会读u盘PE系统了。 4、【UEFI引导】: UEFI引导的流程是开机初始化UEFI,然后,直接引导操作系统,进入系统。和传统的BIOS引导相比,UEFI引导少了一道BIOS自检的过程,所以开机就会更快一些,这也成为了电脑的新宠。 5、进入设置主界面,继续点击Boot(引导)菜单,Boot mode(引导模式)右边的就是当前的引导模式,这里默认的是UEFI引导。 6、选中该项回车,打开设置项之后,这里有两个选项:UEFI 和 Legacy(使用上下键选中),引导模式选择Legacy。 7、点击OK,确认修改为Legacy引导模式。 8、提示询问是否现在重启电脑?点击 yes

Reading/Writing EFI variables on Linux in kernel mode

ぐ巨炮叔叔 提交于 2019-12-21 20:26:42
问题 I am working on Linux UEFI .I want to access the efi variables through my driver code. Currently I'm looking linux/efi.h API like efi.get_variable(). but I'm not getting how to call those APIs with from my driver code. struct efi efi1; efi_init(); efi_char16_t *name = (efi_char16_t *)"Boot001"; efi_guid_t *vendor = (efi_guid_t *)"8be4df61-93ca-11d2-aa0d-00e098032b8c"; u32 *attr = (u32 *)0x7; unsigned long data_size = 1024; void *data = NULL; printk("\n Showing efi info \n"); stat = efi1.get

Reading/Writing EFI variables on Linux in kernel mode

空扰寡人 提交于 2019-12-21 20:26:09
问题 I am working on Linux UEFI .I want to access the efi variables through my driver code. Currently I'm looking linux/efi.h API like efi.get_variable(). but I'm not getting how to call those APIs with from my driver code. struct efi efi1; efi_init(); efi_char16_t *name = (efi_char16_t *)"Boot001"; efi_guid_t *vendor = (efi_guid_t *)"8be4df61-93ca-11d2-aa0d-00e098032b8c"; u32 *attr = (u32 *)0x7; unsigned long data_size = 1024; void *data = NULL; printk("\n Showing efi info \n"); stat = efi1.get

Running an EFI application automatically on boot

梦想的初衷 提交于 2019-12-21 05:08:20
问题 I can build and manually execute an EFI application in a UEFI environment. But, I'd like to have my application executed automatically at boot time. Is there a way to tell the bootloader to do this or do I need to turn my application in to a driver to have it automatically executed? Is there maybe some entry in an FDF, DEC, DSC, or INF file I'm missing? 回答1: You can add a startup.nsh script file to your UEFI Shell boot drive that calls you application. The following link should serve as a

打造兼容BIOS和UEFI的启动盘

荒凉一梦 提交于 2019-12-19 09:33:04
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 参考资料: https://www.callmewing.com/2018/05/07/%E6%89%93%E9%80%A0%E5%85%BC%E5%AE%B9BIOS%E5%92%8CUEFI%E7%9A%84%E5%90%AF%E5%8A%A8%E7%9B%98/ https://my.oschina.net/abcfy2/blog/491140 http://www.slivermetal.org/2016/09/18/how-to-create-an-hybrid-uefi-gpt-bios-gptmbr-boot-usb-disk/ 来源: oschina 链接: https://my.oschina.net/mengyoufengyu/blog/3144771