From 8d488baf66093ccf04050c31a0d49828e4a40332 Mon Sep 17 00:00:00 2001 From: l4check Date: Mon, 15 Nov 2010 16:38:23 +0000 Subject: [PATCH] update git-svn-id: http://svn.tudos.org/repos/oc/tudos/trunk@27 d050ee49-bd90-4346-b210-929a50b99cfc --- kernel/fiasco/src/abi/l4_buf_desc.cpp | 5 +- kernel/fiasco/src/kern/config.cpp | 4 ++ kernel/fiasco/src/kern/ia32/timer-apic.cpp | 8 +-- kernel/fiasco/src/kern/thread-ipc.cpp | 4 +- kernel/fiasco/tool/backtrace | 1 + l4/conf/Makeconf.boot.example | 7 ++- l4/conf/examples/arm-rv.io | 14 +++++ l4/conf/examples/l4lx-gfx.cfg | 60 +++++++++++++++++++ l4/conf/examples/l4lx-x86.io | 27 +++++++++ l4/conf/examples/l4lx.cfg | 15 +++++ l4/conf/modules.list | 23 +++++++ l4/mk/export_defs.inc | 4 ++ l4/pkg/fb-drv/server/src/fb.h | 1 - l4/pkg/fb-drv/server/src/main.cc | 15 ++--- l4/pkg/l4re/util/include/video/goos_fb | 3 + .../src/src/video/l4fb/SDL_l4fbvideowork.c | 4 +- l4/pkg/mag/include/server/input_driver | 22 +------ l4/pkg/mag/include/server/plugin | 36 +++++++++-- l4/pkg/mag/include/server/user_state | 6 +- l4/pkg/mag/include/server/view_stack | 9 ++- .../plugins/input_libinput/input_libinput.cc | 13 ++-- l4/pkg/mag/plugins/input_lxdd/input_lxdd.cc | 8 +-- l4/pkg/mag/server/src/main.cc | 22 +++++-- l4/pkg/mag/server/src/view_stack.cc | 9 +-- 24 files changed, 249 insertions(+), 71 deletions(-) create mode 100644 l4/conf/examples/arm-rv.io create mode 100644 l4/conf/examples/l4lx-gfx.cfg create mode 100644 l4/conf/examples/l4lx-x86.io create mode 100644 l4/conf/examples/l4lx.cfg diff --git a/kernel/fiasco/src/abi/l4_buf_desc.cpp b/kernel/fiasco/src/abi/l4_buf_desc.cpp index 9f38ccb25..e90c8a907 100644 --- a/kernel/fiasco/src/abi/l4_buf_desc.cpp +++ b/kernel/fiasco/src/abi/l4_buf_desc.cpp @@ -12,15 +12,14 @@ public: L4_buf_desc() {} - L4_buf_desc(unsigned mem, unsigned io, unsigned obj, unsigned str, + L4_buf_desc(unsigned mem, unsigned io, unsigned obj, unsigned flags = 0) - : _raw(mem | (io << 5) | (obj << 10) | (str << 15) | flags) + : _raw(mem | (io << 5) | (obj << 10) | flags) {} unsigned mem() const { return _raw & ((1UL << 5)-1); } unsigned io() const { return (_raw >> 5) & ((1UL << 5)-1); } unsigned obj() const { return (_raw >> 10) & ((1UL << 5)-1); } - unsigned str() const { return (_raw >> 15) & ((1UL << 5)-1); } Mword flags() const { return _raw; } Mword raw() const { return _raw; } diff --git a/kernel/fiasco/src/kern/config.cpp b/kernel/fiasco/src/kern/config.cpp index f1e2d8ef6..c3f49d3c7 100644 --- a/kernel/fiasco/src/kern/config.cpp +++ b/kernel/fiasco/src/kern/config.cpp @@ -86,6 +86,10 @@ public: enum { Kip_syscalls = 1, + + One_shot_min_interval_us = 200, + One_shot_max_interval_us = 10000, + #ifdef CONFIG_ASSEMBLER_IPC_SHORTCUT Assembler_ipc_shortcut = 1, #else diff --git a/kernel/fiasco/src/kern/ia32/timer-apic.cpp b/kernel/fiasco/src/kern/ia32/timer-apic.cpp index 8dddbd6f2..c9c60646d 100644 --- a/kernel/fiasco/src/kern/ia32/timer-apic.cpp +++ b/kernel/fiasco/src/kern/ia32/timer-apic.cpp @@ -73,10 +73,10 @@ Timer::update_one_shot(Unsigned64 wakeup) else { Unsigned64 delta = wakeup - now; - if (delta < 1000) - apic = Apic::us_to_apic(1000); - else if (delta > 10000) - apic = Apic::us_to_apic(10000); + if (delta < Config::One_shot_min_interval_us) + apic = Apic::us_to_apic(Config::One_shot_min_interval_us); + else if (delta > Config::One_shot_max_interval_us) + apic = Apic::us_to_apic(Config::One_shot_max_interval_us); else apic = Apic::us_to_apic(delta); diff --git a/kernel/fiasco/src/kern/thread-ipc.cpp b/kernel/fiasco/src/kern/thread-ipc.cpp index 9f4d102cc..73bc5475c 100644 --- a/kernel/fiasco/src/kern/thread-ipc.cpp +++ b/kernel/fiasco/src/kern/thread-ipc.cpp @@ -256,7 +256,7 @@ Thread::handle_page_fault_pager(Thread_ptr const &_pager, Pf_msg_utcb_saver saved_utcb_fields(utcb); - utcb->buf_desc = L4_buf_desc(0,0,0,0,L4_buf_desc::Inherit_fpu); + utcb->buf_desc = L4_buf_desc(0, 0, 0, L4_buf_desc::Inherit_fpu); utcb->buffers[0] = L4_msg_item::map(0).raw(); utcb->buffers[1] = L4_fpage::all_spaces().raw(); @@ -873,7 +873,7 @@ Thread::exception(Kobject_iface *handler, Trap_state *ts, Mword rights) Utcb *utcb = access_utcb(); Buf_utcb_saver saved_state(utcb); - utcb->buf_desc = L4_buf_desc(0,0,0,0,L4_buf_desc::Inherit_fpu); + utcb->buf_desc = L4_buf_desc(0, 0, 0, L4_buf_desc::Inherit_fpu); utcb->buffers[0] = L4_msg_item::map(0).raw(); utcb->buffers[1] = L4_fpage::all_spaces().raw(); diff --git a/kernel/fiasco/tool/backtrace b/kernel/fiasco/tool/backtrace index c891f5193..ffa72817d 100755 --- a/kernel/fiasco/tool/backtrace +++ b/kernel/fiasco/tool/backtrace @@ -26,6 +26,7 @@ if (!defined $img) } my $nm = 'nm'; +$nm = "$ENV{'SYSTEM_TARGET'}$nm" if defined $ENV{"SYSTEM_TARGET"}; $nm = 'arm-softfloat-elf-nm' if !(system("file -L $img | grep -qw ARM") >> 8); foreach my $l (split('\n', qx{$nm $img | c++filt})) diff --git a/l4/conf/Makeconf.boot.example b/l4/conf/Makeconf.boot.example index c818488f2..fa27b51db 100644 --- a/l4/conf/Makeconf.boot.example +++ b/l4/conf/Makeconf.boot.example @@ -29,9 +29,10 @@ qemu: MODULE_SEARCH_PATH += /path/to/fiasco-build # Optional options for QEMU, but setting '-serial stdio' is recommended -#QEMU_OPTIONS = -serial stdio -nographic ... -#QEMU_OPTIONS-arm += -M realview-eb 256 -#QEMU_OPTIONS = $(QEMU_OPTIONS-$(ARCH)) +QEMU_OPTIONS = -serial stdio +#QEMU_OPTIONS = -nographic +#QEMU_OPTIONS-arm += -M realview-eb -m 256 +QEMU_OPTIONS += $(QEMU_OPTIONS-$(ARCH)) # The path to the QEMU binary - optional #QEMU_PATH-x86 = /path/to/qemu diff --git a/l4/conf/examples/arm-rv.io b/l4/conf/examples/arm-rv.io new file mode 100644 index 000000000..7e4801592 --- /dev/null +++ b/l4/conf/examples/arm-rv.io @@ -0,0 +1,14 @@ +hw-root +{ + NIC => new Device() + { + .hid = "smsc911x"; + new-res Mmio(0x4e000000 .. 0x4e000fff); + new-res Irq(60); + } +} + +l4lx => new System_bus() +{ + NIC => wrap(hw-root.NIC); +} diff --git a/l4/conf/examples/l4lx-gfx.cfg b/l4/conf/examples/l4lx-gfx.cfg new file mode 100644 index 000000000..8b6c580b6 --- /dev/null +++ b/l4/conf/examples/l4lx-gfx.cfg @@ -0,0 +1,60 @@ +-- vim:set ft=lua: + +loader = L4.default_loader; + +local lxname = "vmlinuz"; +if L4.Info.arch() == "arm" then + lxname = "vmlinuz.arm"; +end + +-- Start io + +vbus_l4linux = loader:new_channel(); +vbus_input = loader:new_channel(); +vbus_fbdrv = loader:new_channel(); + +loader:start( + { + caps = { + sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0); + icu = L4.Env.icu; + input = vbus_input:svr(); + l4linux = vbus_l4linux:svr(); + fbdrv = vbus_fbdrv:svr(); + }, + }, "rom/io rom/x86-legacy.devs rom/l4lx-x86.io"); + +-- Start fb-drv (but only if we need to) +local fb = L4.Env.vesa; +if (not fb) then + fb = loader:new_channel(); + loader:start({ caps = { fb = fb:svr(), vbus = vbus_fbdrv }}, + "rom/fb-drv -m 0x117"); +end + +local mag_mag = loader:new_channel(); +local mag_svc = loader:new_channel(); + +-- Start mag +loader:start( + { + caps = { + vbus = vbus_input; + mag = mag_mag:svr(); + svc = mag_svc:svr(); + fb = fb; + }, + }, "rom/mag"); + + +-- Start Linux +loader:start( + { caps = { + log = L4.Env.log:m("rws"), + fb = mag_svc:create(L4.Proto.Goos, "640x480"); + vbus = vbus_l4linux; + }, + l4re_dbg = L4.Dbg.Warn, + log = { "l4linux", "yellow" }, + }, + "rom/" .. lxname .. " mem=64M console=tty0 l4x_rd=rom/ramdisk-" .. L4.Info.arch() .. ".rd root=1:0 ramdisk_size=4000 init=/bin/sh"); diff --git a/l4/conf/examples/l4lx-x86.io b/l4/conf/examples/l4lx-x86.io new file mode 100644 index 000000000..f174079ec --- /dev/null +++ b/l4/conf/examples/l4lx-x86.io @@ -0,0 +1,27 @@ +input => new System_bus() +{ + ps2dev => wrap(hw-root.match("PNP0303")); +} + +fbdrv => new System_bus() +{ + PCI0 => new PCI_bus_ident() + { + host_bridge_dummy => new PCI_dummy_device(); + + pci_gfx[] => wrap(hw-root.match("PCI/CC_03")); + } + + x1 => wrap(hw-root.match("BIOS")); + x2 => wrap(hw-root.match("PNP0900")); + x3 => wrap(hw-root.match("PNP0100")); +} + +l4linux => new System_bus() +{ + # Add a new virtual PCI root bridge + PCI0 => new PCI_bus() + { + pci_l4x[] => wrap(hw-root.match("PCI/CC_02,PCI/CC_01,PCI/CC_04")); + } +} diff --git a/l4/conf/examples/l4lx.cfg b/l4/conf/examples/l4lx.cfg new file mode 100644 index 000000000..ca61e77d9 --- /dev/null +++ b/l4/conf/examples/l4lx.cfg @@ -0,0 +1,15 @@ +-- vim:set ft=lua: + +local lxname = "vmlinuz"; +if L4.Info.arch() == "arm" then + lxname = "vmlinuz.arm"; +end + +L4.default_loader:start( + { caps = { + log = L4.Env.log:m("rws"), + }, + l4re_dbg = L4.Dbg.Warn, + log = { "l4linux", "yellow" }, + }, + "rom/" .. lxname .. " mem=64M console=ttyLv0 l4x_rd=rom/ramdisk-" .. L4.Info.arch() .. ".rd root=1:0 ramdisk_size=4000 init=/bin/sh"); diff --git a/l4/conf/modules.list b/l4/conf/modules.list index 748d57aa6..62147dcd5 100644 --- a/l4/conf/modules.list +++ b/l4/conf/modules.list @@ -51,3 +51,26 @@ module libc_be_l4re.so module r/libsupc++.so module r/libuc_c.so +entry L4linux ARM +roottask moe rom/l4lx.cfg +module l4re +module ned +module l4lx.cfg +module io +module arm-rv.io +module vmlinuz.arm +module ramdisk-arm.rd + +entry L4Linux-mag-x86 +roottask moe rom/l4lx-gfx.cfg +module l4re +module ned +module l4lx-gfx.cfg +module io +module fb-drv +module mag +module x86-legacy.devs +module l4lx-x86.io +module vmlinuz +module ramdisk-x86.rd + diff --git a/l4/mk/export_defs.inc b/l4/mk/export_defs.inc index 985651a73..6e5d208f3 100644 --- a/l4/mk/export_defs.inc +++ b/l4/mk/export_defs.inc @@ -21,6 +21,8 @@ MODE = static ifneq ($(SYSTEM),) L4_SYSTEM = $(ARCH)_$(CPU) +L4_CC = $(CC) +L4_CXX = $(CXX) L4_CRT0_STATIC = $(CRT0) L4_CRTN_STATIC = $(CRTN) L4_LDFLAGS_LD = $(filter-out -l%,$(BID_LDFLAGS_FOR_LINKING_LD)) @@ -66,6 +68,8 @@ all:: @echo "" >> $(L4DEF_FILE_SH) @: @$(call do_output_all,L4_SYSTEM) + @$(call do_output_all,L4_CC) + @$(call do_output_all,L4_CXX) @$(call do_output_all,L4_CRT0_STATIC) @$(call do_output_all,L4_CRTN_STATIC) @$(call do_output_all,L4_LDFLAGS_LD) diff --git a/l4/pkg/fb-drv/server/src/fb.h b/l4/pkg/fb-drv/server/src/fb.h index 6ce3ac932..980d3554c 100644 --- a/l4/pkg/fb-drv/server/src/fb.h +++ b/l4/pkg/fb-drv/server/src/fb.h @@ -10,7 +10,6 @@ #pragma once #include -#include #include #include diff --git a/l4/pkg/fb-drv/server/src/main.cc b/l4/pkg/fb-drv/server/src/main.cc index 12cce7931..9b9cae7cd 100644 --- a/l4/pkg/fb-drv/server/src/main.cc +++ b/l4/pkg/fb-drv/server/src/main.cc @@ -8,12 +8,11 @@ * GNU General Public License 2. * Please see the COPYING-GPL-2 file for details. */ -#include -#include -#include -#include + +#include +#include #include -#include + #include #include #include @@ -74,6 +73,8 @@ Phys_fb::dispatch(l4_umword_t obj, L4::Ipc_iostream &ios) ios >> tag; switch (tag.label()) { + case L4::Meta::Protocol: + return L4::Util::handle_meta_request(ios); case L4Re::Protocol::Goos: return L4Re::Util::Video::Goos_svr::dispatch(obj, ios); case L4Re::Protocol::Dataspace: @@ -114,7 +115,7 @@ Prog_args::Prog_args(int argc, char *argv[]) default: printf("Unknown option '%c'\n", c); break; - }; + } } } @@ -152,7 +153,7 @@ int main(int argc, char *argv[]) if (!fb->obj_cap().is_valid()) { - printf("Failed to register in namespace, maybe ro?\n"); + printf("Failed to connect.\n"); return 1; } diff --git a/l4/pkg/l4re/util/include/video/goos_fb b/l4/pkg/l4re/util/include/video/goos_fb index 4d7fbd8b6..beed5a5d0 100644 --- a/l4/pkg/l4re/util/include/video/goos_fb +++ b/l4/pkg/l4re/util/include/video/goos_fb @@ -60,6 +60,9 @@ public: int view_info(L4Re::Video::View::Info *info) { return _view.info(info); } + L4Re::Video::View const *view() const { return &_view; } + L4Re::Video::View *view() { return &_view; } + L4::Cap buffer() const { return _buffer; } void *attach_buffer(); diff --git a/l4/pkg/libsdl/lib/src/src/video/l4fb/SDL_l4fbvideowork.c b/l4/pkg/libsdl/lib/src/src/video/l4fb/SDL_l4fbvideowork.c index f5210ae3b..6cc0c550e 100644 --- a/l4/pkg/libsdl/lib/src/src/video/l4fb/SDL_l4fbvideowork.c +++ b/l4/pkg/libsdl/lib/src/src/video/l4fb/SDL_l4fbvideowork.c @@ -79,8 +79,8 @@ SDL_Surface *L4FB_SetVideoMode(_THIS, SDL_Surface *current, int width, int heigh /* Set up the new mode framebuffer */ current->w = width; current->h = height; - current->pitch = current->w * (bpp / 8); - this->hidden->pitch = current->w * (bpp / 8); + current->pitch = SDL_CalculatePitch(current); + this->hidden->pitch = current->pitch; current->flags = SDL_PREALLOC | SDL_ASYNCBLIT; diff --git a/l4/pkg/mag/include/server/input_driver b/l4/pkg/mag/include/server/input_driver index 31bccaef2..4edd48144 100644 --- a/l4/pkg/mag/include/server/input_driver +++ b/l4/pkg/mag/include/server/input_driver @@ -147,32 +147,12 @@ public: class Input_driver : public Plugin { -protected: - Core_api *_core; - -private: - Input_driver *_next_active; - public: explicit Input_driver(char const *name) - : Plugin(name), _core(0), _next_active(0) + : Plugin(name) {} char const *type() const { return "input-driver"; } - Input_driver *next_active() const { return _next_active; } - virtual void poll_events() = 0; - virtual int probe() = 0; - - void start(Core_api *core) - { - _core = core; - if (probe() == 0) - { - _next_active = core->input_drivers(); - core->add_input_driver(this); - } - } - virtual ~Input_driver() {} }; diff --git a/l4/pkg/mag/include/server/plugin b/l4/pkg/mag/include/server/plugin index 448dc860e..6e502a449 100644 --- a/l4/pkg/mag/include/server/plugin +++ b/l4/pkg/mag/include/server/plugin @@ -10,33 +10,57 @@ #pragma once #include +#include namespace Mag_server { class User_state; -class Input_driver; +class Core_api; + +class Input_source +{ +private: + friend class Core_api; + Input_source *_next_active; + +protected: + Core_api *_core; + +public: + explicit Input_source(Core_api *core = 0) : _core(core) {} + virtual void poll_events() = 0; + Input_source *next() const { return _next_active; } +}; class Core_api { private: - Input_driver *_input; + Input_source *_input; Registry *_reg; User_state *_ust; L4::Cap _rcv_cap; + L4::Cap _fb; // not instanziatable Core_api(Core_api const &); void operator = (Core_api const &); public: - Core_api(Registry *r, User_state *u, L4::Cap rcvc) - : _reg(r), _ust(u), _rcv_cap(rcvc) + Core_api(Registry *r, User_state *u, L4::Cap rcvc, + L4::Cap fb) + : _reg(r), _ust(u), _rcv_cap(rcvc), _fb(fb) {} Registry *registry() const { return _reg; } User_state *user_state() const { return _ust; } - Input_driver *input_drivers() const { return _input; } - void add_input_driver(Input_driver *i) { _input = i; } + Input_source *input_sources() const { return _input; } + L4::Cap backend_fb() const { return _fb; } + void add_input_source(Input_source *i) + { + i->_next_active = _input; + _input = i; + } + L4::Cap rcv_cap() const { return _rcv_cap; } }; diff --git a/l4/pkg/mag/include/server/user_state b/l4/pkg/mag/include/server/user_state index 08410b72d..6dd3105c0 100644 --- a/l4/pkg/mag/include/server/user_state +++ b/l4/pkg/mag/include/server/user_state @@ -12,6 +12,7 @@ #include #include +#include #include namespace Mag_server { @@ -30,8 +31,9 @@ private: int _pressed_keys; public: - User_state(Canvas *screen, View *cursor, View *bg) - : _vstack(screen, bg), _mouse_pos(0,0), + User_state(Canvas *screen, L4Re::Video::View *screen_view, + View *cursor, View *bg) + : _vstack(screen, screen_view, bg), _mouse_pos(0,0), _mouse_cursor(cursor), _pointed_view(0), _next_mouse_pos(0,0), _pressed_keys(0) { diff --git a/l4/pkg/mag/include/server/view_stack b/l4/pkg/mag/include/server/view_stack index cc3ff26b0..42ce3e470 100644 --- a/l4/pkg/mag/include/server/view_stack +++ b/l4/pkg/mag/include/server/view_stack @@ -9,8 +9,11 @@ */ #pragma once +#include + #include #include + #include namespace Mag_server { @@ -35,6 +38,8 @@ private: Mode _mode; View *_focused; + L4Re::Video::View *_canvas_view; + Dummy_view _no_stay_top_v; @@ -64,9 +69,9 @@ private: } public: - explicit View_stack(Canvas *canvas, View *bg) + explicit View_stack(Canvas *canvas, L4Re::Video::View *canvas_view, View *bg) : _canvas(canvas), _no_stay_top(&_no_stay_top_v), _top(bg), - _background(bg), _focused(bg) + _background(bg), _focused(bg), _canvas_view(canvas_view) { bg->_pn = &_top; insert_before(_no_stay_top, _top); diff --git a/l4/pkg/mag/plugins/input_libinput/input_libinput.cc b/l4/pkg/mag/plugins/input_libinput/input_libinput.cc index 0d297c33d..f7b142e96 100644 --- a/l4/pkg/mag/plugins/input_libinput/input_libinput.cc +++ b/l4/pkg/mag/plugins/input_libinput/input_libinput.cc @@ -13,6 +13,8 @@ namespace { using Mag_server::Input_driver; +using Mag_server::Input_source; +using Mag_server::Core_api; using Mag_server::User_state; using Mag_server::Motion_fwd; @@ -24,16 +26,17 @@ struct Emit { u->handle_event(e); } }; -class Input_driver_libinput : public Input_driver +class Input_driver_libinput : public Input_driver, public Input_source { public: Input_driver_libinput() : Input_driver("libinput") {} - int probe() + void start(Core_api *core) { if (l4input_init(0xff, 0) == 0) - return 0; - - return 1; + { + _core = core; + core->add_input_source(this); + } } void poll_events() diff --git a/l4/pkg/mag/plugins/input_lxdd/input_lxdd.cc b/l4/pkg/mag/plugins/input_lxdd/input_lxdd.cc index 39bf8a5b6..a08b6ee65 100644 --- a/l4/pkg/mag/plugins/input_lxdd/input_lxdd.cc +++ b/l4/pkg/mag/plugins/input_lxdd/input_lxdd.cc @@ -53,7 +53,7 @@ struct Emit { u->handle_event(e); } }; -class Input_driver_lxproxy : public Input_driver +class Input_driver_lxproxy : public Input_driver, public Input_source { private: Auto_cap::Cap _ev_ds; @@ -65,7 +65,7 @@ private: public: Input_driver_lxproxy() : Input_driver("L4Linux Proxy") {} - int probe() + void start(Core_api *core) { try { @@ -81,14 +81,14 @@ public: _ev_ds.get(), 0, L4_PAGESHIFT)); _ev = L4Re::Event_buffer(_ev_ds_m.get(), _ev_ds->size()); + _core = core; + core->add_input_source(this); printf("LXDD: buffer @%p\n", _ev_ds_m.get()); - return 0; } catch (...) { printf("could not find linux proxy input\n"); } - return 1; } void poll_events() diff --git a/l4/pkg/mag/server/src/main.cc b/l4/pkg/mag/server/src/main.cc index 6dcd837be..0c53b1010 100644 --- a/l4/pkg/mag/server/src/main.cc +++ b/l4/pkg/mag/server/src/main.cc @@ -101,7 +101,7 @@ public: static void poll_input(Core_api *core) { - for (Input_driver *i = core->input_drivers(); i; i = i->next_active()) + for (Input_source *i = core->input_sources(); i; i = i->next()) i->poll_events(); } @@ -241,8 +241,17 @@ int run(int argc, char const *argv[]) View *cursor = f->create_cursor(big_mouse); Background bg(screen->size()); - static User_state user_state(screen, cursor, &bg); - static Core_api core_api(®istry, &user_state, rcv_cap); + L4Re::Video::View *screen_view = 0; + + { + L4Re::Video::Goos::Info i; + goos_fb.goos()->info(&i); + if (!i.auto_refresh()) + screen_view = goos_fb.view(); + } + + static User_state user_state(screen, screen_view, cursor, &bg); + static Core_api core_api(®istry, &user_state, rcv_cap, fb); Plugin_manager::start_plugins(&core_api); @@ -263,15 +272,18 @@ int main(int argc, char const *argv[]) { return run(argc, argv); } + catch (L4::Runtime_error const &e) + { + L4::cerr << "Error: " << e << '\n'; + } catch (L4::Base_exception const &e) { L4::cerr << "Error: " << e << '\n'; - return -1; } catch (std::exception const &e) { L4::cerr << "Error: " << e.what() << '\n'; } - return 0; + return -1; } diff --git a/l4/pkg/mag/server/src/view_stack.cc b/l4/pkg/mag/server/src/view_stack.cc index bbf9e5fee..d2837a110 100644 --- a/l4/pkg/mag/server/src/view_stack.cc +++ b/l4/pkg/mag/server/src/view_stack.cc @@ -164,9 +164,6 @@ View_stack::draw_recursive(View const *v, View const *dst, Rect const &rect) con draw_recursive(n, dst, border.b); } -void flush(); - - void View_stack::refresh_view(View const *v, View const *dst, Rect const &rect) const { @@ -183,7 +180,11 @@ void View_stack::flush() { for (Redraw_queue::iterator i = rdq.begin(); i != rdq.end(); ++i) - draw_recursive(top(), 0, *i); + { + draw_recursive(top(), 0, *i); + if (_canvas_view) + _canvas_view->refresh(i->x1(), i->y1(), i->w(), i->h()); + } rdq.clear(); } -- 2.39.2