basic functionality

This commit is contained in:
2023-03-16 22:08:38 +01:00
commit fc3f5f27b4
12 changed files with 591 additions and 0 deletions

22
src/lib.rs Normal file
View File

@ -0,0 +1,22 @@
#![no_std]
use linux::start_linux;
use pe::get_loader_sections;
use uefi::table::{Boot, SystemTable};
use uefi::{Handle, Status};
mod initrd;
mod linux;
mod pe;
mod secureboot;
mod unicode;
pub fn bootloader(image_handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
uefi_services::init(&mut system_table).unwrap();
let boot_services = system_table.boot_services();
let sections = get_loader_sections(boot_services).unwrap();
start_linux(image_handle, boot_services, sections).unwrap();
boot_services.stall(1_000_000_000);
Status::SUCCESS
}