1 -- vim: ft=lua ts=2 et sw=2 2 3 -- Start Mag to multiplex the framebuffer showing only a single program. 4 -- This example shows an animation showing off a spectrum of colours. 5 -- The target platform is the MIPS Creator CI20. 6 7 local L4 = require("L4"); 8 9 local l = L4.default_loader; 10 11 -- Define general access to peripherals. 12 13 local io_buses = { 14 common = l:new_channel(); 15 }; 16 17 l:start({ 18 caps = { 19 common = io_buses.common:svr(), 20 icu = L4.Env.icu, 21 sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), 22 }, 23 }, 24 "rom/io rom/hw_devices.io rom/mips-ci20-common.io"); 25 26 -- Expose a framebuffer device. 27 28 local fbdrv_fb = l:new_channel(); 29 30 l:start({ 31 caps = { 32 vbus = io_buses.common, 33 fb = fbdrv_fb:svr(), 34 }, 35 }, 36 "rom/fb-drv"); 37 38 -- Multiplex the framebuffer. 39 40 local mag_caps = { 41 mag = l:new_channel(), 42 svc = l:new_channel(), 43 }; 44 45 l:start({ 46 caps = { 47 vbus = io_buses.common, -- needed by input driver 48 fb = fbdrv_fb, 49 mag = mag_caps.mag:svr(), 50 svc = mag_caps.svc:svr(), 51 }, 52 }, 53 "rom/mag"); 54 55 -- Show the spectrum example. 56 57 l:start({ 58 caps = { 59 fb = mag_caps.svc:create(L4.Proto.Goos, "g=240x240+0+0", "barheight=10"), 60 }, 61 }, 62 "rom/ex_fb_spectrum_cc");