Page MenuHomeFreeBSD

biosboot: Detect memory disks from PXE
Needs ReviewPublic

Authored by imp on May 30 2024, 1:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 16, 9:15 AM
Unknown Object (File)
Thu, Feb 27, 7:23 AM
Unknown Object (File)
Jan 5 2025, 4:06 AM
Unknown Object (File)
Dec 5 2024, 9:48 AM
Unknown Object (File)
Nov 25 2024, 9:24 PM
Unknown Object (File)
Nov 24 2024, 8:16 PM
Unknown Object (File)
Nov 23 2024, 5:21 PM
Unknown Object (File)
Nov 23 2024, 6:17 AM

Details

Summary

Walk through the disk driver entries chained off of INT13.

MEMDISK is part of the Syslinux project; it loads disk images into
memory, sets an int 13h hook and then does a BIOS boot from the image;
this can be used as part of a PXE boot environment to load installer
disks, however the disks are not accessible from inside the FreeBSD
kernel because it doesn't access disks through BIOS APIs.

This patch detects the disk images in the loader, and passes their
address and length as a driver hint. When the md driver sees the hint,
it maps the image, and presents it to the system.

Test Plan

I'm most confident about the boot loader changes (though the arbitrary limit likely needs some help)
I need review and ideally testing of the md.
Also, I'm not at all sure that we reserve the area, so maybe kernel allocations overwrite the ram disk? How do I prevent that?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57960
Build 54848: arc lint + arc unit

Event Timeline

imp requested review of this revision.May 30 2024, 1:35 AM

Thanks for picking this up!

I'm most confident about the boot loader changes (though the arbitrary limit likely needs some help)

I don't remember where that 32 came from; I think I just wanted to have a limit, so the loop would be be bounded, even if data was

Also, I'm not at all sure that we reserve the area, so maybe kernel allocations overwrite the ram disk? How do I prevent that?

memdisk adjusts the e820 memory map, so the memory it uses for the disk image will not be available memory for the kernel, but it seems like a good idea to somehow ensure that.

stand/i386/libi386/biosmemdisk.c
63

I have been testing this patch, but it remains stuck in the loader: it prints everything, but I cannot hit any key, the timer is not running.

I have been testing this patch, but it remains stuck in the loader: it prints everything, but I cannot hit any key, the timer is not running.

So we're hitting an infinite loop before interact()... That's going to be fun to debug... Is this with or without ram disks configured for iPXE?

this is with ramdisk configured via ipxe