Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UEFI boot and sanhook
2018-09-19, 09:17 (This post was last modified: 2018-09-19 09:57 by parthy.)
Post: #3
RE: UEFI boot and sanhook
Oh yes, sorry. What I would like to do is use iPXE to hook an iSCSI disk, and then access it from within an EFI application. On legacy systems, this used to work. The kernel that was loaded by iPXE could just execute BIOS calls to read from the disk, and iPXE would get the data from the network. I am wondering if the same mechanism is feasible on UEFI.

Here is my iPXE config:

Code:
#!ipxe

set username <secret>
set password <secret>

set keep-san 1
set initiator-iqn <custom-prefix>:${net0/mac:hexhyp}

set iscsi-server ${next-server}

set san-filename \EFI\boot\bootx64.efi

set root-path iscsi:${iscsi-server}::3260:1:iqn.xxxx-yy.de.foo.iscsi:<target_name>

sanhook --drive 0x80 ${root-path} || goto fail

chain shellx64.efi

:fail
shell

When booting this in qemu with OVMF/TianoCore, I get the following:

Code:
EFI Shell version 2.70 [1.0]
Current running mode 1.1.2
EFIBLK 0x80 flush
EFIBLK 0x80 flush
EFIBLK 0x80 flush
EFIBLK 0x80 flush
EFIBLK 0x80 flush
EFIBLK 0x80 read LBA 0x00000000 to 0x7e113798+0x00000200
map: Cannot find required map name.

Press ESC in 1 seconds to skip startup.nsh, any other key to continue.
Shell>

When I boot it on real hardware, I see the partitions appear, but running ls in any of them again hangs.

The hint about the network being interrupted might be the key, though. In the shell, I indeed see the network interface unconfigured. Is there anything I need to to in order for the application to access the hooked disk?
Quick update: If I use snponly.efi, it works in the shell.

The way I see it, the shutdown_boot() call when loading Multiboot binaries severs the network connection. How does this work on legacy systems? The iSCSI connection survives there somehow, until the OS takes over.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
UEFI boot and sanhook - parthy - 2018-09-18, 15:27
RE: UEFI boot and sanhook - NiKiZe - 2018-09-18, 18:24
RE: UEFI boot and sanhook - NiKiZe - 2018-09-19, 12:40
RE: UEFI boot and sanhook - parthy - 2018-09-19, 13:06
RE: UEFI boot and sanhook - NiKiZe - 2018-09-19, 13:16
RE: UEFI boot and sanhook - parthy - 2018-09-20, 09:24
RE: UEFI boot and sanhook - NiKiZe - 2018-09-20, 20:32



User(s) browsing this thread: 1 Guest(s)