summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: da783289e34fb6313f4f0374c78c8bf8a0abb295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#![no_main]
#![no_std]
#![feature(abi_efiapi)]

mod gfx;
use crate::gfx::*;

use uefi::prelude::*;
use core::fmt::Write;

#[entry]
fn main(_handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
	uefi_services::init(&mut system_table).unwrap();

	system_table.stdout().clear().unwrap();
	writeln!(system_table.stdout(), "Clearing the screen!").unwrap();

	let mut gop = GOP::new(&system_table).unwrap();
	gop.set_highest_resolution().unwrap();
	writeln!(system_table.stdout(), "Set max resolution!").unwrap();

	let gop = GOP::new(&system_table).unwrap();
	let (dx, dy) = gop.get_resolution();
	writeln!(system_table.stdout(), "Resolution: {}x{}", dx, dy).unwrap();

	let mut gop = GOP::new(&system_table).unwrap();
	gop.fill_box(0, 0, 16, 16, 128, 0, 0).unwrap();

	#[cfg(not(debug_assertions))]
	loop {}
	#[allow(unreachable_code)]
	Status::SUCCESS
}