From dc3369a8c2e34cf2a1176571b882658e0e8870db Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Tue, 15 Jan 2019 01:57:24 +0200 Subject: [PATCH] [VC WIP] fiddling with uart again --- src/main.rs | 10 +++++----- src/platform/vc.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 25467a6..2336f86 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,11 +50,11 @@ fn panic(_info: &PanicInfo) -> ! { // Kernel entry point // arch crate is responsible for calling this pub fn kmain() -> ! { -// let mut uart = MiniUart::new(); -// uart.init(); -// write!(uart, "Hey there, mini uart talking!\n"); + let mut uart = MiniUart::new(); + uart.init(); + writeln!(uart, "Hey there, mini uart talking!"); - if let Some(mut display) = VC::init_fb(Size2d { x: 800, y: 600 } /*, &mut uart*/) { + if let Some(mut display) = VC::init_fb(Size2d { x: 800, y: 600 }, &mut uart) { display.rect(10, 10, 250, 250, Color::rgb(32, 96, 64).0); display.draw_text(50, 50, "Hello there!", Color::rgb(128, 192, 255).0); // display.draw_text(50, 150, core::fmt("Display width {}", display.width), Color::rgb(255,0,0).0); @@ -64,6 +64,6 @@ pub fn kmain() -> ! { display.draw_text(170, 70, "BLUE", Color::rgb(0, 0, 255).0); } -// write!(uart, "Bye, going to sleep now\n"); + writeln!(uart, "Bye, going to sleep now"); endless_sleep() } diff --git a/src/platform/vc.rs b/src/platform/vc.rs index fb7b3ff..9ff7319 100644 --- a/src/platform/vc.rs +++ b/src/platform/vc.rs @@ -8,16 +8,16 @@ pub struct VC; impl VC { // Use mailbox framebuffer interface to initialize - pub fn init_fb(size: Size2d /*, uart: &mut MiniUart*/) -> Option { + pub fn init_fb(size: Size2d, uart: &mut MiniUart) -> Option { let mut fb_info = GpuFb::new(size, 32); - // uart.puts("initing fb_info\n"); + uart.puts("initing fb_info\n"); fb_info.call().map_err(|_| { - /*uart.puts("fb_info error\n");*/ + uart.puts("fb_info error\n"); () }); - // write!(uart, "inited fb_info: {}\n", fb_info); +// write!(uart, "inited fb_info: {}\n", fb_info); let mut mbox = Mailbox::new(); @@ -62,7 +62,7 @@ impl VC { /* Need to set up max_x/max_y before using Display::write */ let max_x = fb_info.vwidth / CHARSIZE_X; let max_y = fb_info.vheight / CHARSIZE_Y; - // uart.puts("inited fb_info #2\n"); + uart.puts("inited fb_info #2\n"); Some(Display::new( bus2phys(fb_info.pointer),