From 97e4470da6df3b8e4a73c4b32ebc733bf0002633 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Mon, 17 Dec 2012 14:30:55 +0100 Subject: [PATCH] Build pci_drv for framebuffer test / fix warning --- os/run/framebuffer.run | 2 +- os/src/test/framebuffer/main.cc | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/os/run/framebuffer.run b/os/run/framebuffer.run index e4fce354f1..74987c71cf 100755 --- a/os/run/framebuffer.run +++ b/os/run/framebuffer.run @@ -2,7 +2,7 @@ # Build # -build { core init test/framebuffer drivers/framebuffer drivers/timer } +build { core init test/framebuffer drivers/framebuffer drivers/pci drivers/timer } create_boot_directory diff --git a/os/src/test/framebuffer/main.cc b/os/src/test/framebuffer/main.cc index 4f44aed7d2..af7686d640 100644 --- a/os/src/test/framebuffer/main.cc +++ b/os/src/test/framebuffer/main.cc @@ -35,14 +35,11 @@ int main() Framebuffer::Mode const fb_mode = fb.mode(); /* write pixeldata to framebuffer */ - void * fb_base = env()->rm_session()->attach(fb_ds_cap); - unsigned j; - unsigned const fb_size = (unsigned)(mode.width()*mode.height())/2; - for(unsigned i = 0; i < fb_size; i++) - { - *(((unsigned volatile *)fb_base) + i) = j; - j++; - } + void *fb_base = env()->rm_session()->attach(fb_ds_cap); + unsigned const fb_size = (unsigned)(mode.width()*mode.height())/2; + for (unsigned i = 0; i < fb_size; i++) + *(((unsigned volatile *)fb_base) + i) = i; + fb.refresh(0, 0, fb_mode.width(), fb_mode.height()); printf("--- end ---\n"); while(1);