iPXE discussion forum
INITRD Basics - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: INITRD Basics (/showthread.php?tid=18734)



INITRD Basics - GMN - 2019-07-18 15:52

When using "initrd" to download a file, how is that file accessible in UEFI context?

I was expecting to see a new file system device created, but I find no new devices. For example.

initrd http:/blahblah/disk_image.dsk
kernel http:/blahblah/bootx64.efi /efi/boot/

At this point, UEFI is able to find and execute bootx64.efi (an OS loader), but how do I locate the prior initrd of disk_image.dsk?

I expected to find a UEFI RAMdisk or new file system device created, but I am not seeing this.

Obviously the file disk_image.dsk is in memory somewhere, but how does my OS loader find it? If not via memory address and size, then through what protocol?

Is there a detailed description somewhere of what is actually happening when iPXE pulls images down?


RE: INITRD Basics - NiKiZe - 2019-07-19 06:12

I would probably start reading the wimboot sources, which finds all loaded files

But the linux kernel for example receives an argument telling it which filenames to load, I think this is mentioned in the FAQ


RE: INITRD Basics - GMN - 2019-09-06 20:05

This turned out to be much simpler than it seemed. The downloaded file appeared not as a RAMdisk (hence, no new fs device) but as just a file in the default volume.
My mistake was thinking that because this was a disk image file, that an INITRD would create a UEFI disk. Nope... just a file.

UEFI FileIo was able to access the file by name. Since what I was looking for was it's address in physical memory, but it was stored as a file, it was just a matter of reading the file size, allocating memory for it, and reading the file into the allocated memory. Pass the address and size through to the booting OS and it was able to mount the disk image as a RAMdisk. Problem solved.