uEFI

UEFI boot: how does that actually work, then?

梦想的初衷 提交于 2019-12-16 21:00:01
本文转载于: https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/ 本文翻译于: http://www.tuicool.com/articles/NNf26jB PDF整理版下载: http://yun.baidu.com/share/link?shareid=3376946296&uk=2643853 It’s AdamW Essay Time again! If you’relooking for something short and snappy, look elsewhere. Kamil Paral kindly informs me I’m a chronicsufferer of Graphomania. Always nice to know what’s wrong with you. IMPORTANT NOTE TO INDUSTRY FOLKS: This blogpost is aimed at regular everyday folks; it’s intended to dispel a few commonmyths and help regular people understand UEFI a bit better. It

How i can set firmware environment variable in UEFI driver

ε祈祈猫儿з 提交于 2019-12-13 04:15:52
问题 In a Windows application, I have a GetFirmwareEnvironmentVariableA function to read a firmware environment variable. Is there any way to write something in this variable in uefi driver and read from it later in Windows? 回答1: The function to set an NVRAM variable is called SetVariable() and is available to UEFI drivers via EFI_RUNTIME_SERVICES table. To know more about it's interface and usage, read chapter 7.2 Variable Services of the UEFI 2.6 specification. 来源: https://stackoverflow.com

Access BIOS/UEFI menu setting via uefi shell

元气小坏坏 提交于 2019-12-13 04:14:15
问题 I´d like to read/alter some BIOS/UEFI menu settings via a uefi shell script. For example I´d like to change the 'CSM Support' setting (Enabled/Disabled). Is there any way to do so? 回答1: Inspect the uefi variables (not shell variables) before and after you change the 'CSM Support' setting, maybe this setting is stored in one of the uefi variables, you can then edit this variable from the shell or a simple shell app. 来源: https://stackoverflow.com/questions/52756635/access-bios-uefi-menu-setting

UEFI Add Boot Option programmatically

♀尐吖头ヾ 提交于 2019-12-12 16:53:46
问题 How can i write code which add boot option from UEFI driver programmatically? 1) I try to add "Boot0001" variable: ZeroMem(Data, 2048); StrCpy(Data, L"Boot0001"); DataSize = StrLen(Data) * 2; Status = gRT->SetVariable(L"Boot0001", &dGuid, Attr, DataSize, &Data); 2) I need add entry to "BootOrder" variable. But i can't understand how. Ideally, i want to add boot option boot from sample efi application. 回答1: To add something to UEFI boot list: Create BootXXXX variable, it's format looks like

How to open a file by it's full path in UEFI

自闭症网瘾萝莉.ら 提交于 2019-12-10 15:39:46
问题 I'm a beginner in UEFI. I'm trying to open a file from my UEFI application. The path of file is fs1:/myfolder/myfile.txt The code (With the help of this answer) : efiStatus = bs->LocateHandleBuffer(ByProtocol, &sfspGuid, NULL, &handleCount, &handles); for (index = 0; index < (int)handleCount; ++ index) { EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL; efiStatus = bs->HandleProtocol( handles[index], &sfspGuid, (void**)&fs); EFI_FILE_PROTOCOL* root = NULL; ... efiStatus = fs->OpenVolume(fs, &root);

磁盘存储和文件系统(二)

社会主义新天地 提交于 2019-12-10 01:48:53
磁盘存储和文件系统(二) 使用分区空间 磁盘分区 分区 55AA 代表一个16进制数,55是2个十六进制数,一个十六进制数占4个二进制数,2个十六进制数占8个二进制数,就是一个字节,AA又是一个字节,所以就是2个字节。 MBR分区结构 MBR分区结构 MBR结构 MBR中DPT结构 备份恢复分区表 备份分区表 dd if=/dev/sda of=/data/dpt bs=1 count=66 skip=446 查看备份文件 od /data/dpt od -c /data/dpt od -a /data/dpt od -t c /data/dpt od -t x /data/dpt xxd /data/dpt hexdump -C /data/dpt 模拟分区表被破坏 dd if=/dev/zero of=/dev/sda bs=1 count=2 seek=510 fdisk -l /dev/sda //看不到磁盘上的分区 lsblk //看到的是内存中的分区 注:分区表在内存中有一份,在磁盘上也有一份 恢复分区表 dd if=/data/dpt of=/dev/sda bs=1 count=2 skip=64 seek=510 硬盘分区表的备份与还原 备份分区表,将备份拷贝到另一台机器上 [root@Centos7 ~]# hostname -I 192.168.209.10

Different ways to to trigger a SMI for a processor

吃可爱长大的小学妹 提交于 2019-12-08 11:56:30
问题 I am writing some firmware code running in the System Managemnt Mode (SMM) on an Intel platform. I want to fully understand how my SMI handler get started. I read from the Intel Manual that: The only way to enter SMM is by signaling an SMI through the SMI# pin on the processor or through an SMI message received through the APIC bus. And I also read that a synchronous SMI can be triggered by writing to an I/O port . My understanding is like this: SMM is just a special operating mode of a

FindFirstVolume does not return EFI system partition

╄→гoц情女王★ 提交于 2019-12-08 04:32:07
问题 I am using FindFirstVolume/FindNextVolume to get a list of all volumes on a machine. That works well enough, but strangely the EFI system partition is skipped for some reason. Diskpart, on the other hand, returns the EFI system partition and the Disk Management UI shows it, too. Here is diskpart's output: DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 C NTFS Partition 476 GB Healthy Boot

Assembly - How to set graphics mode in UEFI (No VGA, No BIOS, Nothing deprecated)

余生颓废 提交于 2019-12-06 15:57:03
Tools I'm using: nasm, qemu-system-x86_64. Operating System I'm on: Windows 10. So I checked out the "Real Mode OS Warning" at https://wiki.osdev.org/Real_Mode_OS_Warning What the article seems to imply is that everything can be done without using BIOS interrupts whatsoever. I know how to load Long Mode, and so I've done this, but now I am stuck because BIOS interrupts were all I knew until now. I want to do something like set the graphics mode to full-memory-access-mode (might sound familiar if you've seen int 10h / AX = 4F02h / BX = 81FFh ), but since I don't want to use something that's

UEFI BootLoader

北慕城南 提交于 2019-12-06 09:58:53
问题 I am looking at developing a simple (to start with) UEFI Boot loader to load a ELF image, and was wondering if anyone had a good entry point into maybe any existing projects, or examples that I can use to get started out with. In addition I was wondering if any one had any experience in getting virtual box to run an EFI application. I have set up a VM with EFI mother board but can seam to create an EFI System Partition for it to load out of (without using an OS), all I can achieve is the UEFI