Created
July 8, 2020 22:33
-
-
Save agrif/6d60e1cc0f1ae6df792c8b0469a66926 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_std] | |
#![no_main] | |
#[panic_handler] | |
fn panic(_info: &core::panic::PanicInfo) -> ! { | |
loop {} | |
} | |
fn color(fb: &blueloader_info::Framebuffer, c: (u8, u8, u8)) -> u32 { | |
use bitintr::Pdep; | |
let enc = (c.0 as u32).pdep(fb.masks[0]) | |
| (c.1 as u32).pdep(fb.masks[1]) | |
| (c.2 as u32).pdep(fb.masks[2]); | |
enc | |
} | |
blueloader_info::entry_point!(kmain); | |
fn kmain(info: blueloader_info::BootInfo) -> ! { | |
let mem = info.framebuffer.as_slice(); | |
for i in 0..mem.len() { | |
mem[i] = color(&info.framebuffer, (0, 0, 255)); | |
} | |
loop { | |
x86_64::instructions::hlt(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment