Integrating UFS read-only code into my boot loader

From: Lee D <embaudarm_at_gmail.com>
Date: Tue, 25 Jan 2022 03:16:58 UTC
Hi,

I am using my own bootloader to directly boot the FreeBSD 13 kernel on
my custom Zynq (ARM) board.

Currently, I load the kernel from a small DOS partition.

I would like to try to integrate UFS into my bootloader so that I can
read the kernel, modules and configuration directly from the UFS
partition.  It only needs to read, not write.

In FreeBSD 11.0.1 there was file called: /src/sys/boot/common/ufsread.c

That file seemed to be a complete UFS reader in a small, self
contained package.  It was deleted from the tree a long time ago
though.

Is this file still good for use with a UFS filesystem created with FreeBSD 13?

I saw the whole package of files under /src/sys/ufs/, but those are
deeply integrated into the world of the FreeBSD kernel and seem
difficult to extract for use in a standalone, bare-metal bootloader
program.

Also open to other suggestions for how I might integrate UFS into my bootloader.

Thanks,

Lee