[boot] More initrd format changes
CDB seemed to be too simple for the needs of init, and squashfs is too laden with design choices to work around Linux's APIs. This commit adds creation of an initrd image of a new format I've called `j6romfs`. Note that this commit currently does not work! The initrd-reading code still needs to be added.
This commit is contained in:
@@ -37,9 +37,7 @@ bootconfig::bootconfig(util::buffer data, uefi::boot_services *bs)
|
||||
if (version != 1)
|
||||
error::raise(uefi::status::incompatible_version, L"Bad version in jsix_boot.dat");
|
||||
|
||||
data += 1; // reserved byte
|
||||
uint16_t num_panics = *util::read<uint16_t>(data);
|
||||
m_initrd_format = *util::read<uint16_t>(data);
|
||||
uint8_t num_panics = *util::read<uint8_t>(data);
|
||||
m_flags = *util::read<uint16_t>(data);
|
||||
|
||||
read_descriptor(m_kernel, data);
|
||||
|
||||
@@ -31,12 +31,10 @@ public:
|
||||
inline const descriptor & kernel() const { return m_kernel; }
|
||||
inline const descriptor & init() const { return m_init; }
|
||||
inline const wchar_t * initrd() const { return m_initrd; }
|
||||
inline uint16_t initrd_format() const { return m_initrd_format; }
|
||||
inline const descriptors & panics() { return m_panics; }
|
||||
|
||||
private:
|
||||
uint16_t m_flags;
|
||||
uint16_t m_initrd_format;
|
||||
descriptor m_kernel;
|
||||
descriptor m_init;
|
||||
descriptors m_panics;
|
||||
|
||||
@@ -72,7 +72,7 @@ load_resources(bootproto::args *args, video::screen *screen, uefi::handle image,
|
||||
status_line status {L"Loading programs"};
|
||||
|
||||
fs::file disk = fs::get_boot_volume(image, bs);
|
||||
fs::file bc_data = disk.open(L"jsix_boot.dat");
|
||||
fs::file bc_data = disk.open(L"jsix\\boot.conf");
|
||||
bootconfig bc {bc_data.load(), bs};
|
||||
|
||||
args->kernel = loader::load_program(disk, L"kernel", bc.kernel());
|
||||
@@ -80,7 +80,7 @@ load_resources(bootproto::args *args, video::screen *screen, uefi::handle image,
|
||||
args->flags = static_cast<bootproto::boot_flags>(bc.flags());
|
||||
|
||||
loader::load_module(disk, L"initrd", bc.initrd(),
|
||||
bootproto::module_type::initrd, bc.initrd_format());
|
||||
bootproto::module_type::initrd, 0);
|
||||
|
||||
namespace bits = util::bits;
|
||||
using bootproto::desc_flags;
|
||||
|
||||
Reference in New Issue
Block a user