diff --git a/os/run/framebuffer.run b/os/run/framebuffer.run new file mode 100755 index 0000000000..08c9f6d0f9 --- /dev/null +++ b/os/run/framebuffer.run @@ -0,0 +1,96 @@ +# +# Build +# + +build { core init test/framebuffer drivers/framebuffer drivers/timer } + +create_boot_directory + +# +# Generate config +# + +append config { + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec omap4] config { + + + + + + + + } + +append config { + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules +set boot_modules { + core init timer + test-framebuffer +} + +# platform-specific modules +lappend_if [have_spec sdl] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv +lappend_if [have_spec omap4] boot_modules omap44xx_fb_drv + +build_boot_image $boot_modules + +run_genode_until forever + diff --git a/os/src/test/framebuffer/main.cc b/os/src/test/framebuffer/main.cc new file mode 100644 index 0000000000..4f44aed7d2 --- /dev/null +++ b/os/src/test/framebuffer/main.cc @@ -0,0 +1,51 @@ +/* + * \brief Basic test for framebuffer session + * \author Martin Stein + * \date 2012-01-09 + */ + +/* + * Copyright (C) 2012 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* Genode includes */ +#include +#include +#include +#include + +using namespace Genode; + +int main() +{ + printf("--- Test framebuffer ---\n"); + + /* create framebuffer */ + static Framebuffer::Connection fb; + Framebuffer::Mode const mode = fb.mode(); + PINF("framebuffer is %dx%d@%d\n", mode.width(), mode.height(), mode.format()); + Dataspace_capability fb_ds_cap = fb.dataspace(); + if (!fb_ds_cap.valid()) { + PERR("Could not request dataspace for frame buffer"); + return -2; + } + 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++; + } + fb.refresh(0, 0, fb_mode.width(), fb_mode.height()); + printf("--- end ---\n"); + while(1); + return 0; +} + diff --git a/os/src/test/framebuffer/target.mk b/os/src/test/framebuffer/target.mk new file mode 100644 index 0000000000..f10c6ed914 --- /dev/null +++ b/os/src/test/framebuffer/target.mk @@ -0,0 +1,14 @@ +# +# \brief Basic test for framebuffer session +# \author Martin Stein +# \date 2012-04-25 +# + +# set program name +TARGET = test-framebuffer + +# add c++ sources +SRC_CC += main.cc + +# add libraries +LIBS += cxx env