[VC WIP] disable uart everywhere - WORKS

without uart the thing seems to work fine, so what is wrong?
This commit is contained in:
Berkus Decker 2019-01-15 01:52:23 +02:00
parent 94f61b6a8a
commit a424300aa2
2 changed files with 11 additions and 11 deletions

View File

@ -50,11 +50,11 @@ fn panic(_info: &PanicInfo) -> ! {
// Kernel entry point // Kernel entry point
// arch crate is responsible for calling this // arch crate is responsible for calling this
pub fn kmain() -> ! { pub fn kmain() -> ! {
let mut uart = MiniUart::new(); // let mut uart = MiniUart::new();
uart.init(); // uart.init();
write!(uart, "Hey there, mini uart talking!\n"); // write!(uart, "Hey there, mini uart talking!\n");
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(100, 100, 200, 200, Color::rgb(255, 255, 255).0); display.rect(100, 100, 200, 200, Color::rgb(255, 255, 255).0);
display.draw_text(50, 50, "Hello there!", Color::rgb(128, 192, 255).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); // 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); display.draw_text(170, 70, "BLUE", Color::rgb(0, 0, 255).0);
} }
write!(uart, "Bye, going to sleep now\n"); // write!(uart, "Bye, going to sleep now\n");
endless_sleep() endless_sleep()
} }

View File

@ -8,13 +8,13 @@ pub struct VC;
impl VC { impl VC {
// Use mailbox framebuffer interface to initialize // Use mailbox framebuffer interface to initialize
pub fn init_fb(size: Size2d, uart: &mut MiniUart) -> Option<Display> { pub fn init_fb(size: Size2d/*, uart: &mut MiniUart*/) -> Option<Display> {
let mut fb_info: GpuFb = GpuFb::new(size, 24); let mut fb_info: GpuFb = GpuFb::new(size, 24);
uart.puts("initing fb_info\n"); // uart.puts("initing fb_info\n");
fb_info.call().map_err(|_| {uart.puts("fb_info error\n");()}); fb_info.call().map_err(|_| {/*uart.puts("fb_info error\n");*/()});
write!(uart, "inited fb_info: {}\n", fb_info); // write!(uart, "inited fb_info: {}\n", fb_info);
// let mut pixel_order = Mailbox::new(); // let mut pixel_order = Mailbox::new();
// //
@ -30,7 +30,7 @@ impl VC {
/* Need to set up max_x/max_y before using Display::write */ /* Need to set up max_x/max_y before using Display::write */
let max_x = fb_info.vwidth / CHARSIZE_X; let max_x = fb_info.vwidth / CHARSIZE_X;
let max_y = fb_info.vheight / CHARSIZE_Y; 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( Some(Display::new(
bus2phys(fb_info.pointer), bus2phys(fb_info.pointer),
@ -57,7 +57,7 @@ impl VC {
mbox.0[6] = 0; // Space for vertical resolution mbox.0[6] = 0; // Space for vertical resolution
mbox.0[7] = Tag::End as u32; // End tag mbox.0[7] = Tag::End as u32; // End tag
Mailbox::call(Channel::PropertyTagsArmToVc as u8, &mbox.0 as *const u32 as *const u8)?; mbox.call(Channel::PropertyTagsArmToVc)?;
if mbox.0[1] != MAILBOX_RESP_CODE_SUCCESS { if mbox.0[1] != MAILBOX_RESP_CODE_SUCCESS {
return None; return None;