[boot] Create bootconfig to tell boot what to load

While bonnibel already had the concept of a manifest, which controls
what goes into the built disk image, the bootloader still had filenames
hard-coded. Now bonnibel creates a 'jsix_boot.dat' file that tells the
bootloader what it should load.

Changes include:

- Modules have two new fields: location and description. location is
  their intended directory on the EFI boot volume. description is
  self-explanatory, and is used in log messages.
- New class, boot::bootconfig, implements reading of jsix_boot.dat
- New header, bootproto/bootconfig.h, specifies flags used in the
  manifest and jsix_boot.dat
- New python module, bonnibel/manifest.py, encapsulates reading of the
  manifest and writing jsix_boot.dat
- Syntax of the manifest changed slightly, including adding flags
- Boot and Kernel target ccflags unified a bit (this was partly due to
  trying to get enum_bitfields to work in boot)
- util::counted gained operator+= and new free function util::read<T>
This commit is contained in:
Justin C. Miller
2022-01-07 22:33:25 -08:00
parent 9f3e682b89
commit a3fff889d1
20 changed files with 356 additions and 82 deletions

View File

@@ -11,34 +11,30 @@ namespace bootproto {
namespace boot {
class descriptor;
namespace fs {
class file;
}
namespace loader {
struct program_desc
{
const wchar_t *name;
const wchar_t *path;
};
/// Load a file from disk into memory.
/// \arg disk The opened UEFI filesystem to load from
/// \arg desc The program descriptor identifying the file
util::buffer
load_file(
fs::file &disk,
const program_desc &desc);
const descriptor &desc);
/// Parse and load an ELF file in memory into a loaded image.
/// \arg disk The opened UEFI filesystem to load from
/// \arg desc The program descriptor identifying the program
/// \arg desc The descriptor identifying the program
/// \arg add_module Also create a module for this loaded program
bootproto::program *
load_program(
fs::file &disk,
const program_desc &desc,
const descriptor &desc,
bool add_module = false);
/// Load a file from disk into memory, creating an init args module
@@ -47,7 +43,7 @@ load_program(
void
load_module(
fs::file &disk,
const program_desc &desc);
const descriptor &desc);
/// Verify that a loaded ELF has the j6 kernel header
/// \arg program The program to check for a header