diff --git a/moon/src/init.rs b/moon/src/init.rs new file mode 100644 index 00000000..2fa10f43 --- /dev/null +++ b/moon/src/init.rs @@ -0,0 +1,7 @@ +use crate::bootboot::{BOOTBOOT, BOOTBOOT_MAGIC}; +use crate::util::get_bootboot; + +pub fn check_magic() -> () { + let boot: BOOTBOOT = get_bootboot(); + assert_eq!(boot.magic, BOOTBOOT_MAGIC[..4]); +} \ No newline at end of file diff --git a/moon/src/main.rs b/moon/src/main.rs index 750db61e..8b2cbc21 100644 --- a/moon/src/main.rs +++ b/moon/src/main.rs @@ -5,9 +5,13 @@ mod video; mod bootboot; mod panic; mod util; +mod init; + +use video::Color; #[no_mangle] pub extern "C" fn _start() -> ! { - video::clear(0xffffffff); + init::check_magic(); + video::clear(Color::White); loop {} -} +} \ No newline at end of file