diff options
| author | Vaze <vaze@vaze.dev> | 2026-05-27 13:18:52 +0200 |
|---|---|---|
| committer | Vaze <vaze@vaze.dev> | 2026-05-27 13:18:52 +0200 |
| commit | 407d34ca790ea224c79e17a5cbe33976bf02a6fc (patch) | |
| tree | 19aa48b8e6a3c5c5d38e20f2696948a093f8e695 /bootloader/src/main.rs | |
| parent | 816f9b7cb300a7f3979b5f29b3677e84a3c28880 (diff) | |
Removed bootloader sub-project. ZenOS will focus on the kernel from now on. BOOTBOOT will be used as the only supported bootloader for now. Development of a custom bootloader might resume at a much later date.HEADmaster
Diffstat (limited to 'bootloader/src/main.rs')
| -rw-r--r-- | bootloader/src/main.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/bootloader/src/main.rs b/bootloader/src/main.rs deleted file mode 100644 index d26ba08..0000000 --- a/bootloader/src/main.rs +++ /dev/null @@ -1,44 +0,0 @@ -#![no_main] -#![no_std] - -use core::time::Duration; -use log::info; -use uefi::CString16; -use uefi::Result; -use uefi::Status; -use uefi::boot::{self, ScopedProtocol}; -use uefi::fs::{FileSystem, FileSystemResult}; -use uefi::prelude::*; -use uefi::print; -use uefi::proto::media::fs::SimpleFileSystem; - -extern crate alloc; -use alloc::vec::Vec; - -#[entry] -fn main() -> Status { - uefi::helpers::init().unwrap(); - info!("Hello from bootloader!"); - load_kernel().unwrap(); - info!("Entry fuction regained control!"); - boot::stall(Duration::from_secs(10)); - info!("exiting!"); - Status::SUCCESS -} - -fn load_kernel() -> Result { - info!("Entered load_kernel function"); - let kernel = read_file(r"\EFI\BOOT\kernel.elf").unwrap(); - info!("Read kernel into memory!"); - print!("{:x?}", kernel[..10].to_vec()); - info!("I printed my dump"); - return Ok(()); -} - -fn read_file(path: &str) -> FileSystemResult<Vec<u8>> { - let path: CString16 = CString16::try_from(path).unwrap(); - let fs: ScopedProtocol<SimpleFileSystem> = - boot::get_image_file_system(boot::image_handle()).unwrap(); - let mut fs = FileSystem::new(fs); - fs.read(path.as_ref()) -} |
