Skip to content

Commit

Permalink
Basic UI Test
Browse files Browse the repository at this point in the history
  • Loading branch information
snowflake committed Aug 6, 2018
1 parent 672efed commit 4ca8a02
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
4 changes: 2 additions & 2 deletions boot2snow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LD = $(PREFIX)/bin/$(arch)-efi-pe-ld
CARGO = xargo
CARGOFLAGS = --target $(target_arch) --release -- -C soft-float

BINUTILS = 2.30
BINUTILS = 2.31

boot2snow = $(BUILD_DIR)/bootx64.efi
boot2snow_obj = $(BUILD_DIR)/target/$(target_arch)/release/libBoot2Snow.a
Expand Down Expand Up @@ -52,7 +52,7 @@ $(boot2snow_obj):

$(PREFIX)/binutils-$(BINUTILS).tar.gz:
@mkdir -p $(shell dirname $@)
@curl -o $@ https://ftp.gnu.org/gnu/binutils/binutils-$(BINUTILS).tar.gz
@curl -o $@ https://mirror.jre655.com/GNU/binutils/binutils-$(BINUTILS).tar.gz

$(LD): $(PREFIX)/binutils-$(BINUTILS).tar.gz
@tar -zxvf $< -C $(PREFIX)
Expand Down
2 changes: 1 addition & 1 deletion boot2snow/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2018-03-31
nightly-2018-04-06s
2 changes: 1 addition & 1 deletion kernel/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2018-03-31
nightly-2018-04-06
3 changes: 2 additions & 1 deletion kernel/src/kmain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use color::*;
use arch;
use memory;
use shell;
use testui;

#[no_mangle]
pub extern "C" fn kmain(magic: usize, boot_info: *const Info) -> ! {
Expand Down Expand Up @@ -54,7 +55,7 @@ pub extern "C" fn kmain(magic: usize, boot_info: *const Info) -> ! {
progress_bar(&mut display, x, y, resolution_w, 50);
}

shell::execute();
shell::execute(&mut display);

panic!("Test panic");
}
Expand Down
1 change: 1 addition & 0 deletions kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mod console;
mod memory;
mod shell;
mod consts;
mod testui;

#[cfg(target_arch = "x86_64")]
#[path="../arch/x86_64/mod.rs"]
Expand Down
7 changes: 6 additions & 1 deletion kernel/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
// =======================================================================

use arch::keyboard;
use display::Display;
use testui;

pub fn execute() {
pub fn execute(display: &mut Display) {
println!("Starting Snowflake Minimal Shell... (Debug)");
print!("///// Welcome to Snowflake Minimal Shell /////");

Expand All @@ -26,6 +28,9 @@ pub fn execute() {
println!("Exiting Shell... (Debug)");
break
},
"start" => {
testui::uidraw(display);
}
_ => {
print!("Unknown command :(");
}
Expand Down
12 changes: 12 additions & 0 deletions kernel/src/testui.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use color::Color;
use arch::keyboard;
use display::Display;

pub fn uidraw(display: &mut Display) {
let (width, height) = { (display.width(), display.height()) };
println! ("SnowFlake boot ok. ");
loop {
display.rect(0, 0, width, height, Color::rgb(50, 45, 55));

}
}

0 comments on commit 4ca8a02

Please sign in to comment.