Page MenuHomeFreeBSD

Create isoboot which will allow an ISO image to be booted from a USB stick
Needs ReviewPublic

Authored by imp on Mar 22 2018, 5:05 PM.

Details

Summary

This creates a version of i386's boot2.c that, instead of reading from a UFS partition, will read from an ISO filesystem.

Test Plan

A FreeBSD bootonly ISO image built with this can be found here:

https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz

This has been tested successfully under qemu and VMware in the following configurations:

Legacy BIOS as CD
Legacy BIOS as HDD
UEFI as CD
UEFI as HDD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 15723

Event Timeline

Both hybrid-bootonly-20180323-00.iso and hybrid-bootonly.iso fail to boot to userland on coreboot 4.14 + SeaBIOS 1.14, and about 50 seconds into booting panic at stand/libsa/zalloc_malloc.c:131
Crash details shown on screen are:
"panic: free: guard1 fail @ 0x5ceb7fe0 from unknown:0
--> Press a key on the console to reboot <--"

Loader reports 'BIOS 639kB/1570068kB available memory'

These .iso files were written to USB media using dd.

Updated on 2021-07-19 to mention firmware release information, crash report text and line number, and update memory report details.
If desired, I can share photos of what's on the screen.

This should be in sys/i386/isoboot, not co-located with sys/i386/boot2. While it mildly benefits from having boot1 sharing, it can get that via a reach-over as well.

And do we need the same sort of structure with a boot1 that reads the rest of the boot block? Doesn't sharing limit this to 7.5k as well, when the limit is closer to 32k?

stand/i386/boot2/Makefile
5

I'd make this a separate directory, like we've done for gpt boot. There appears to be no benefit from sharing the same directory.

imp edited reviewers, added: benno; removed: imp.

This has my attention, so I tried booting a hybrid Debian ISO [1]. Booting this ISO file using the same firmware build as mentioned earlier successfully loaded the kernel (and beyond).

Thomas Schmitt suggested to run xorriso [2].

Here are some of my observations after running 'xorriso -indev hybrid-bootonly.iso -report_el_torito plain -report_system_area plain'.
For hybrid-bootonly.iso, hybrid-bootonly-20180323-00.iso:
System area summary: MBR cyl-align-off

For debian-live-10.10.0-amd64-standard.iso:
System area summary: MBR isohybrid cyl-align-on GPT

[1] https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.10.0-amd64-standard.iso
[2] https://lists.freebsd.org/pipermail/freebsd-current/2018-March/068928.html


That said, on 14-CURRENT dd'ing bootonly.iso/disc1.iso to USB media the boot experience is the same as booting memstick.img.