minimum viable product

This commit is contained in:
2026-06-04 09:33:24 -04:00
parent 1217b4beaa
commit 4c2236bf5d
15 changed files with 1274 additions and 309 deletions
+51
View File
@@ -0,0 +1,51 @@
use std::path::Path;
fn main() {
let args: Vec<String> = std::env::args().collect();
let kernel_path = if args.len() > 1 {
args[1].clone()
} else {
let target = std::env::var("TARGET").unwrap_or_else(|_| "x86_64-unknown-none".to_string());
let profile = std::env::var("PROFILE").unwrap_or_else(|_| "debug".to_string());
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR")
.unwrap_or_else(|_| ".".to_string());
// Builder is at workspace/builder, kernel is at workspace/kernel
let workspace = Path::new(&manifest_dir).parent().unwrap();
format!("{}/target/{}/{}/kernel", workspace.display(), target, profile)
};
let kernel_path = Path::new(&kernel_path);
if !kernel_path.exists() {
eprintln!("Kernel not found at: {}", kernel_path.display());
eprintln!("Usage: builder <path-to-kernel-elf>");
std::process::exit(1);
}
let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| {
std::env::var("CARGO_MANIFEST_DIR")
.map(|d| format!("{}/../target", d))
.unwrap_or_else(|_| "target".to_string())
});
// Disable bootloader's verbose framebuffer logging (default: trace-level yellow text)
let mut boot_config = bootloader::BootConfig::default();
boot_config.frame_buffer_logging = false;
// Create UEFI bootable image
println!("Creating UEFI boot image from {}", kernel_path.display());
let mut uefi_img = bootloader::UefiBoot::new(&kernel_path);
uefi_img.set_boot_config(&boot_config);
let uefi_path = Path::new(&out_dir).join("wordleos-uefi.img");
uefi_img.create_disk_image(&uefi_path)
.expect("failed to write UEFI image");
println!("UEFI image written to: {}", uefi_path.display());
// Also create BIOS bootable image for compatibility
println!("Creating BIOS boot image from {}", kernel_path.display());
let mut bios_img = bootloader::BiosBoot::new(&kernel_path);
bios_img.set_boot_config(&boot_config);
let bios_path = Path::new(&out_dir).join("wordleos-bios.img");
bios_img.create_disk_image(&bios_path)
.expect("failed to write BIOS image");
println!("BIOS image written to: {}", bios_path.display());
}