Hi Genodians,

I'm working on my HnH19-project to create a component listening on a shared filesystem to open each pdf file into a separate instance of mupdf. Goal is to tie the share to a linux-vm in vbox so firefox and thunderbird can have a simple 'cp' command to get pdfs rendered outside that vm.

I add a RAM-FS, FS-QUERY and REPORT-ROM to mupdf.run. The file gets put in the ram-fs, fs-query should pick that up and report it to the report-rom.

    <start name="pdf_share">
            <binary name="ram_fs"/>
            <resource name="RAM" quantum="128M"/>
            <provides> <service name="File_system"/> </provides>
            <config verbose="yes">
                    <default-policy root="/" writeable="yes" />
            </config>
    </start>

    <start name="report_new_pdf">
            <binary name="report_rom"/>
            <resource name="RAM" quantum="1M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
            <config verbose="yes"/>
    </start>

    <start name="fs_query">
            <resource name="RAM" quantum="1M"/>
            <config verbose="yes">
                    <vfs> <fs writeable="yes"/> </vfs>
                    <query path="/" content="yes"/>
            </config>
    </start>

I change the test-scenario to copy a pdf into the share and start the pdf-viewer. The viewer picks up the pdf and renders it. So far so good.


The problem is that while the 'add'-test copies the file, it gets detected by fs_query but fs_query thinks it's gone:

[init -> test -> add] --- noux started ---
[init -> fs_query] Error: failed to watch '//foo.pdf'
[init -> fs_query] Warning: could not obtain content of nonexistent file foo.pdf

(The error comes from gems/vfs.h L556, the warning from fs_query/main.cc L80.)

Fs_quey does send a new report but does not show the file, it show an empty directory.

[init -> report_new_pdf] report 'fs_query -> listing'
[init -> report_new_pdf]   <listing>
[init -> report_new_pdf]        <dir path="/"/>
[init -> report_new_pdf]   </listing>

However, a ls -laR shows it's there:

[init -> test -> ls-after] /dest:
[init -> test -> ls-after] total 1
[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .
[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..
[init -> test -> ls-after] -rwxrwxrwx 0 root 0 8192 Jan  1 00:00 foo.pdf


Now the race condition:

When I set the fs-query option to show the content to "no", it gives the same error: failed to watch '//foo.pdf' but it now it does send the file name to the report:

[init -> report_new_pdf]                <file name="foo.pdf"/>


So it seems that somehow that fs_query watch learns there is a file while the contents are not yet committed. Accessing that triggers a file-not-found error.

Did I discover a race condition or am I doing something wrong?


With regards, Guido.

PS. I added the complete run-file and logs for completeness. (log-1 shows the contents-flag to no).
PPS. I'm testing with Qemu in a linux VM on my AMD nixos host.
including /home/guido/genode/tool/run/power_on/qemu
including /home/guido/genode/tool/run/log/qemu
including /home/guido/genode/tool/run/image/iso
including /home/guido/genode/tool/run/boot_dir/nova
including /home/guido/genode/repos/mupdf-gw/run/mupdf-gw.run
building targets:  app/pdf_view server/ram_fs app/fs_query app/sequence 
spawn make app/pdf_view server/ram_fs app/fs_query app/sequence
make[1]: Entering directory '/home/guido/genode/build/qemu_x86_64'
checking library dependencies...
  Library ldso-startup
  Library libc-stdlib
  Library libc-string
  Library libc-locale
  Library libc-inet
  Library libc-stdio
  Library libc-stdtime
  Library libc-gdtoa
  Library libc-regex
  Library libc-gen
  Library libc-setjmp
  Library libc-compat
  Library libc-mem
  Library libc-resolv
  Library libc-nameser
  Library libc-isc
  Library mupdf_host_tools
  Library ld
  Library libc-rpc
  Library libc-net
  Library base
  Program app/sequence/sequence
  Program server/ram_fs/ram_fs
  Library vfs
  Program app/fs_query/fs_query
  Library libc
  Library zlib
  Library jpeg
  Library freetype
  Library libm
  Library libpng
  Library openjpeg
  Library jbig2dec
  Library mupdf
  Program app/pdf_view/pdf_view
make[1]: Leaving directory '/home/guido/genode/build/qemu_x86_64'
genode build completed
checking configuration syntax
  CHECK init
using 'core-nova.o' as 'core.o'
install bootloader
creating ISO image...
xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project.

spawn qemu-system-x86_64 -no-kvm -display sdl -cpu core2duo -m 1536 -serial mon:stdio -cdrom var/run/mupdf-gw.iso -machine q35
warning: TCG doesn't support requested feature: CPUID.01H:EDX.vme [bit 1]
Bender: Hello World.

NOVA Microhypervisor v8-6ea1179 (x86_64): Apr 23 2019 21:58:39 [gcc 6.3.0] [MBI2]



[ 0] TSC:3211945 kHz BUS:1005565 kHz (measured)

[ 0] CORE:0:0:0 6:f:b:0 [0] Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz

Hypervisor reports 1x1 CPU 

Warning: CPU has no invariant TSC.

CPU ID (genode->kernel:package:core:thread) remapping

 remap (0->0:0:0:0) boot cpu

Hypervisor info page contains 12 memory descriptors:

core     image  [0000000000100000,0000000002636000)

binaries region [000000000029a000,0000000002636000) free for reuse

detected physical memory: 0x0000000000000000 - size: 0x000000000009fc00

use      physical memory: 0x0000000000000000 - size: 0x000000000009f000

detected physical memory: 0x0000000000100000 - size: 0x000000005fedf000

use      physical memory: 0x0000000000100000 - size: 0x000000005fedf000

detected res memory: 0x5daa7000 - size: 0x25372f0 type=-2

detected res memory: 0x9fc00 - size: 0x400 type=2

detected res memory: 0xf0000 - size: 0x10000 type=2

detected res memory: 0x5ffdf000 - size: 0x21000 type=2

detected res memory: 0xb0000000 - size: 0x10000000 type=2

detected res memory: 0xfffc0000 - size: 0x40000 type=2

detected res memory: 0xfd000000 - size: 0x2800001e00120 type=-5

detected res memory: 0x1000000 - size: 0x800000 type=-1

detected res memory: 0x1800000 - size: 0x1c00000 type=-1

detected res memory: 0x5ffe2256 - size: 0x0 type=-3

ROM modules:

 ROM: [000000005fd82000,000000005fda2780) acpi_drv

 ROM: [000000005dc62000,000000005e3f6000) bash.tar

 ROM: [000000005fd7f000,000000005fd8109d) config

 ROM: [0000000000034000,0000000000038000) core_log

 ROM: [000000005e3f6000,000000005ef79800) coreutils.tar

 ROM: [000000005f1ee000,000000005f229c60) decorator

 ROM: [000000005f858000,000000005f85836c) decorator_init.config

 ROM: [000000005ffbd000,000000005ffbe285) drivers.config

 ROM: [000000005feeb000,000000005feec5f9) en_us.chargen

 ROM: [000000005fad0000,000000005fb2de70) fb_drv

 ROM: [000000005fa4a000,000000005fa4a033) fb_drv.config

 ROM: [000000005f859000,000000005f85901d) focus

 ROM: [000000005fc9d000,000000005fd36a20) freetype.lib.so

 ROM: [000000005ffbf000,000000005ffddef0) fs_query

 ROM: [000000005fa78000,000000005facfb80) init

 ROM: [000000005fa48000,000000005fa49bec) init.xsd

 ROM: [000000005fba5000,000000005fbd6bb8) input_filter

 ROM: [000000005ff38000,000000005ff38300) input_filter.config

 ROM: [000000005fd37000,000000005fd5bd80) jbig2dec.lib.so

 ROM: [000000005fefc000,000000005ff37630) jpeg.lib.so

 ROM: [000000005f85b000,000000005f85b292) layouter.config

 ROM: [000000005fda3000,000000005fe8c348) ld.lib.so

 ROM: [000000005f85c000,000000005f9cd250) libc.lib.so

 ROM: [000000005fd5c000,000000005fd7cb78) libc_noux.lib.so

 ROM: [000000005ff8f000,000000005ffbcfb8) libm.lib.so

 ROM: [000000005f9eb000,000000005fa2a748) libpng.lib.so

 ROM: [000000005f22a000,000000005f822590) mupdf.lib.so

 ROM: [000000005fe8d000,000000005feea7d0) nitpicker

 ROM: [000000005fb2e000,000000005fba4158) noux

 ROM: [000000005f0d1000,000000005f0f6050) openjpeg.lib.so

 ROM: [000000005dc42000,000000005dc612a8) pdf_view

 ROM: [000000005f117000,000000005f16b270) platform_drv

 ROM: [0000000000032000,0000000000033000) platform_info

 ROM: [000000005fbd7000,000000005fbfe6c0) pointer

 ROM: [000000005feed000,000000005fefbd68) posix.lib.so

 ROM: [000000005fc00000,000000005fc2f448) ps2_drv

 ROM: [000000005fa4b000,000000005fa77488) ram_fs

 ROM: [000000005f0f7000,000000005f116168) report_rom

 ROM: [000000005f16c000,000000005f18b670) rom_to_file

 ROM: [000000005fa2b000,000000005fa47468) sequence

 ROM: [000000005fbff000,000000005fbff542) special.chargen

 ROM: [000000005fd7d000,000000005fd7e780) test.pdf

 ROM: [000000005ff39000,000000005ff54230) timer

 ROM: [000000005ef7a000,000000005f0d0870) usb_drv

 ROM: [000000005f823000,000000005f857388) vfs

 ROM: [000000005fc30000,000000005fc9cec0) vfs.lib.so

 ROM: [000000005f9ce000,000000005f9eabc0) vfs_import.lib.so

 ROM: [000000005ff55000,000000005ff8e110) window_layouter

 ROM: [000000005f1a5000,000000005f1ed620) wm

 ROM: [000000005f85a000,000000005f85aeee) wm.config

 ROM: [000000005f18c000,000000005f1a4470) zlib.lib.so



36M kernel memory



Genode sculpt_ce-79-g6ea1179 <local changes>

1461 MiB RAM and 63253 caps assigned to init

[init] parent provides

[init]   service "ROM"

[init]   service "IRQ"

[init]   service "IO_MEM"

[init]   service "IO_PORT"

[init]   service "PD"

[init]   service "RM"

[init]   service "CPU"

[init]   service "LOG"

[init] child "timer"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: timer

[init]   priority:   0

[init]   provides service Timer

[init] child "drivers"

[init]   RAM quota:  32520K

[init]   cap quota:  968

[init]   ELF binary: init

[init]   priority:   0

[init]   provides service Input

[init]   provides service Framebuffer

[init] child "nitpicker"

[init]   RAM quota:  3848K

[init]   cap quota:  68

[init]   ELF binary: nitpicker

[init]   priority:   0

[init]   provides service Nitpicker

[init] child "pointer"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: pointer

[init]   priority:   0

[init] child "wm"

[init]   RAM quota:  32520K

[init]   cap quota:  968

[init]   ELF binary: init

[init]   priority:   0

[init]   provides service Nitpicker

[init] child "pdf_share"

[init]   RAM quota:  130824K

[init]   cap quota:  68

[init]   ELF binary: ram_fs

[init]   priority:   0

[init]   provides service File_system

[init] child "report_new_pdf"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: report_rom

[init]   priority:   0

[init]   provides service Report

[init]   provides service ROM

[init] child "fs_query"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: fs_query

[init]   priority:   0

[init] child "test"

[init]   RAM quota:  65288K

[init]   cap quota:  668

[init]   ELF binary: sequence

[init]   priority:   0

[init] child "pdf_share" announces service "File_system"

[init] child "report_new_pdf" announces service "Report"

[init] child "report_new_pdf" announces service "ROM"

[init -> report_new_pdf] report 'fs_query -> listing'

[init -> report_new_pdf]   <listing>

[init -> report_new_pdf]   	<dir path="/"/>

[init -> report_new_pdf]   </listing>

[init] child "timer" announces service "Timer"

[init -> test -> sleep] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> drivers] Warning: input_filter assigned caps (80) exceed available caps (69)

[init -> test -> sleep] --- noux started ---

[init -> drivers -> acpi_drv] Found MADT

[init -> drivers -> acpi_drv] MADT IRQ 0 -> GSI 2 flags: 0

[init -> drivers -> acpi_drv] MADT IRQ 5 -> GSI 5 flags: 13

[init -> drivers -> acpi_drv] MADT IRQ 9 -> GSI 9 flags: 13

[init -> drivers -> acpi_drv] MADT IRQ 10 -> GSI 10 flags: 13

[init -> drivers -> acpi_drv] MADT IRQ 11 -> GSI 11 flags: 13

[init -> drivers -> acpi_drv] Found MCFG

[init -> drivers -> acpi_drv] MCFG BASE 0xb0000000 seg 0x0 bus 0x0-0xff

[init -> drivers -> acpi_drv] RSDT OEM 'BOCHS ', table id 'BXPCRSDT', revision 1, creator 'BXPC' (1)

[init -> drivers -> platform_drv] ECAM/MMCONF range 00:00.0-ff:1f.7 - addr [00000000b0000000,00000000c0000000)

[init -> drivers -> platform_drv] Root bridge: 00:00.0

[init -> drivers -> ps2_drv] Using keyboard with scan code set 1 (xlate)

[init -> drivers -> usb_drv] Could not read screen resolution in config node

[init -> drivers -> usb_drv] Configured HID screen with 0x0 (multitouch=false)

[init -> drivers -> usb_drv] No <storage> config node found - not starting the USB Storage (Block) service

[init -> drivers -> usb_drv] No <nic> config node found - not starting the USB Nic (Network) service

[init -> drivers -> usb_drv] No <raw> config node found - not starting external USB service

[init -> drivers -> usb_drv] Enabled UHCI (USB 1.0/1.1) support

[init -> drivers -> fb_drv] Found PCI VGA at 00:01.0

[init -> drivers -> usb_drv] Enabled EHCI (USB 2.0) support

[init -> drivers -> usb_drv] Enabled XHCI (USB 3.0) support

[init -> drivers -> ps2_drv] detected ExPS/2 mouse - activating scroll-wheel and 5-button support

[init -> drivers -> platform_drv] PS2 uses IRQ, vector 0x1

[init -> drivers -> platform_drv] PS2 uses IRQ, vector 0xc

[init -> drivers -> fb_drv] fb mapped to 0x4000

[init -> test -> sleep] Warning: heap could not free memory block

[init -> drivers -> fb_drv] Found: VESA BIOS version 3.0

[init -> drivers -> fb_drv] OEM: SeaBIOS VBE(C) 2011

[init -> test -> ls-before] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> drivers -> fb_drv] Found: physical frame buffer at 0xfd000000 size: 16777216

[init -> drivers -> fb_drv] fb mapped to 0xb000000

[init -> drivers -> fb_drv] using video mode: 1024x768@16

[init -> drivers -> fb_drv] using buffered output

[init -> test -> ls-before] --- noux started ---

[init] child "nitpicker" announces service "Nitpicker"

[init -> test -> ls-before] /dest:

[init -> test -> ls-before] total 0

[init -> test -> ls-before] drwxr-xr-x 0 root 0 0 Jan  1 00:00 .

[init -> test -> ls-before] drwxr-xr-x 0 root 0 0 Jan  1 00:00 ..

[init -> test -> ls-before] 

[init -> test -> ls-before] /source:

[init -> test -> ls-before] total 1

[init -> test -> ls-before] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .

[init -> test -> ls-before] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..

[init -> test -> ls-before] -r-xr-xr-x 0 root 0 8192 Jan  1 00:00 test.pdf

[init -> test -> ls-before] Warning: heap could not free memory block

[init -> test -> add] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> test -> add] --- noux started ---

[init -> fs_query] Error: failed to watch '//foo.pdf'

[init -> report_new_pdf] report 'fs_query -> listing'

[init -> report_new_pdf]   <listing>

[init -> report_new_pdf]   	<dir path="/">

[init -> report_new_pdf]   		<file name="foo.pdf"/>

[init -> report_new_pdf]   	</dir>

[init -> report_new_pdf]   </listing>

[init -> test -> add] Warning: heap could not free memory block

[init -> test -> ls-after] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> test -> ls-after] --- noux started ---

[init -> test -> ls-after] /dest:

[init -> test -> ls-after] total 1

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..

[init -> test -> ls-after] -rwxrwxrwx 0 root 0 8192 Jan  1 00:00 foo.pdf

[init -> test -> ls-after] 

[init -> test -> ls-after] /source:

[init -> test -> ls-after] total 1

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..

[init -> test -> ls-after] -r-xr-xr-x 0 root 0 8192 Jan  1 00:00 test.pdf

no RM attachment (READ pf_addr=0x82e22 pf_ip=0x82e22 from pager_object: pd='init -> test -> ls-after -> /bin/ls' thread='ep') 

page fault, pd='init -> test -> ls-after -> /bin/ls' thread='ep' cpu=0 ip=0x82e22 address=0x82e22 stack pointer=0xa02fef18 qualifiers=0x14 IrUwp reason=1

[init -> test -> ls-after] Warning: heap could not free memory block

[init -> test -> pdf_view] file_name: foo.pdf

[init -> test -> pdf_view] + /home/guido/genode/contrib/mupdf-5b492514a8e9ba4db6bbf54dee54b94f068f0dae/src/lib/mupdf/pdf/pdf_xref.c:60: pdf_read_start_xref(): cannot find startxref

[init -> test -> pdf_view] | /home/guido/genode/contrib/mupdf-5b492514a8e9ba4db6bbf54dee54b94f068f0dae/src/lib/mupdf/pdf/pdf_xref.c:477: pdf_load_xref(): cannot read startxref

[init -> test -> pdf_view] \ /home/guido/genode/contrib/mupdf-5b492514a8e9ba4db6bbf54dee54b94f068f0dae/src/lib/mupdf/pdf/pdf_xref.c:537: pdf_open_xref_with_stream(): trying to repair

[init -> test -> pdf_view] MuPDF 0.9

[init -> test -> pdf_view] Copyright 2006-2011 Artifex Sofware, Inc.

[init -> test -> pdf_view] 

Expect: 'interact' received 'strg+c' and was cancelled
including /home/guido/genode/tool/run/power_on/qemu
including /home/guido/genode/tool/run/log/qemu
including /home/guido/genode/tool/run/image/iso
including /home/guido/genode/tool/run/boot_dir/nova
including /home/guido/genode/repos/mupdf-gw/run/mupdf-gw.run
building targets:  app/pdf_view server/ram_fs app/fs_query app/sequence 
spawn make app/pdf_view server/ram_fs app/fs_query app/sequence
make[1]: Entering directory '/home/guido/genode/build/qemu_x86_64'
checking library dependencies...
  Library ldso-startup
  Library libc-locale
  Library libc-stdlib
  Library libc-string
  Library libc-stdio
  Library libc-gdtoa
  Library libc-regex
  Library libc-inet
  Library libc-stdtime
  Library libc-gen
  Library libc-setjmp
  Library libc-compat
  Library libc-mem
  Library libc-isc
  Library libc-resolv
  Library libc-nameser
  Library mupdf_host_tools
  Library ld
  Library libc-net
  Library libc-rpc
  Library base
  Program app/sequence/sequence
  Program server/ram_fs/ram_fs
  Library vfs
  Program app/fs_query/fs_query
  Library libc
  Library zlib
  Library jpeg
  Library freetype
  Library libm
  Library libpng
  Library openjpeg
  Library jbig2dec
  Library mupdf
  Program app/pdf_view/pdf_view
make[1]: Leaving directory '/home/guido/genode/build/qemu_x86_64'
genode build completed
checking configuration syntax
  CHECK init
using 'core-nova.o' as 'core.o'
install bootloader
creating ISO image...
xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project.

spawn qemu-system-x86_64 -no-kvm -display sdl -cpu core2duo -m 1536 -serial mon:stdio -cdrom var/run/mupdf-gw.iso -machine q35
warning: TCG doesn't support requested feature: CPUID.01H:EDX.vme [bit 1]
Bender: Hello World.

NOVA Microhypervisor v8-6ea1179 (x86_64): Apr 23 2019 21:58:39 [gcc 6.3.0] [MBI2]



[ 0] TSC:3214374 kHz BUS:1006388 kHz (measured)

[ 0] CORE:0:0:0 6:f:b:0 [0] Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz

Hypervisor reports 1x1 CPU 

Warning: CPU has no invariant TSC.

CPU ID (genode->kernel:package:core:thread) remapping

 remap (0->0:0:0:0) boot cpu

Hypervisor info page contains 12 memory descriptors:

core     image  [0000000000100000,0000000002636000)

binaries region [000000000029a000,0000000002636000) free for reuse

detected physical memory: 0x0000000000000000 - size: 0x000000000009fc00

use      physical memory: 0x0000000000000000 - size: 0x000000000009f000

detected physical memory: 0x0000000000100000 - size: 0x000000005fedf000

use      physical memory: 0x0000000000100000 - size: 0x000000005fedf000

detected res memory: 0x5daa7000 - size: 0x25372f0 type=-2

detected res memory: 0x9fc00 - size: 0x400 type=2

detected res memory: 0xf0000 - size: 0x10000 type=2

detected res memory: 0x5ffdf000 - size: 0x21000 type=2

detected res memory: 0xb0000000 - size: 0x10000000 type=2

detected res memory: 0xfffc0000 - size: 0x40000 type=2

detected res memory: 0xfd000000 - size: 0x2800001e00120 type=-5

detected res memory: 0x1000000 - size: 0x800000 type=-1

detected res memory: 0x1800000 - size: 0x1c00000 type=-1

detected res memory: 0x5ffe2256 - size: 0x0 type=-3

ROM modules:

 ROM: [000000005fd82000,000000005fda2780) acpi_drv

 ROM: [000000005dc62000,000000005e3f6000) bash.tar

 ROM: [000000005fd7f000,000000005fd8109e) config

 ROM: [0000000000034000,0000000000038000) core_log

 ROM: [000000005e3f6000,000000005ef79800) coreutils.tar

 ROM: [000000005f1ee000,000000005f229c60) decorator

 ROM: [000000005f858000,000000005f85836c) decorator_init.config

 ROM: [000000005ffbd000,000000005ffbe285) drivers.config

 ROM: [000000005feeb000,000000005feec5f9) en_us.chargen

 ROM: [000000005fad0000,000000005fb2de70) fb_drv

 ROM: [000000005fa4a000,000000005fa4a033) fb_drv.config

 ROM: [000000005f859000,000000005f85901d) focus

 ROM: [000000005fc9d000,000000005fd36a20) freetype.lib.so

 ROM: [000000005ffbf000,000000005ffddef0) fs_query

 ROM: [000000005fa78000,000000005facfb80) init

 ROM: [000000005fa48000,000000005fa49bec) init.xsd

 ROM: [000000005fba5000,000000005fbd6bb8) input_filter

 ROM: [000000005ff38000,000000005ff38300) input_filter.config

 ROM: [000000005fd37000,000000005fd5bd80) jbig2dec.lib.so

 ROM: [000000005fefc000,000000005ff37630) jpeg.lib.so

 ROM: [000000005f85b000,000000005f85b292) layouter.config

 ROM: [000000005fda3000,000000005fe8c348) ld.lib.so

 ROM: [000000005f85c000,000000005f9cd250) libc.lib.so

 ROM: [000000005fd5c000,000000005fd7cb78) libc_noux.lib.so

 ROM: [000000005ff8f000,000000005ffbcfb8) libm.lib.so

 ROM: [000000005f9eb000,000000005fa2a748) libpng.lib.so

 ROM: [000000005f22a000,000000005f822590) mupdf.lib.so

 ROM: [000000005fe8d000,000000005feea7d0) nitpicker

 ROM: [000000005fb2e000,000000005fba4158) noux

 ROM: [000000005f0d1000,000000005f0f6050) openjpeg.lib.so

 ROM: [000000005dc42000,000000005dc612a8) pdf_view

 ROM: [000000005f117000,000000005f16b270) platform_drv

 ROM: [0000000000032000,0000000000033000) platform_info

 ROM: [000000005fbd7000,000000005fbfe6c0) pointer

 ROM: [000000005feed000,000000005fefbd68) posix.lib.so

 ROM: [000000005fc00000,000000005fc2f448) ps2_drv

 ROM: [000000005fa4b000,000000005fa77488) ram_fs

 ROM: [000000005f0f7000,000000005f116168) report_rom

 ROM: [000000005f16c000,000000005f18b670) rom_to_file

 ROM: [000000005fa2b000,000000005fa47468) sequence

 ROM: [000000005fbff000,000000005fbff542) special.chargen

 ROM: [000000005fd7d000,000000005fd7e780) test.pdf

 ROM: [000000005ff39000,000000005ff54230) timer

 ROM: [000000005ef7a000,000000005f0d0870) usb_drv

 ROM: [000000005f823000,000000005f857388) vfs

 ROM: [000000005fc30000,000000005fc9cec0) vfs.lib.so

 ROM: [000000005f9ce000,000000005f9eabc0) vfs_import.lib.so

 ROM: [000000005ff55000,000000005ff8e110) window_layouter

 ROM: [000000005f1a5000,000000005f1ed620) wm

 ROM: [000000005f85a000,000000005f85aeee) wm.config

 ROM: [000000005f18c000,000000005f1a4470) zlib.lib.so



36M kernel memory



Genode sculpt_ce-79-g6ea1179 <local changes>

1461 MiB RAM and 63253 caps assigned to init

[init] parent provides

[init]   service "ROM"

[init]   service "IRQ"

[init]   service "IO_MEM"

[init]   service "IO_PORT"

[init]   service "PD"

[init]   service "RM"

[init]   service "CPU"

[init]   service "LOG"

[init] child "timer"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: timer

[init]   priority:   0

[init]   provides service Timer

[init] child "drivers"

[init]   RAM quota:  32520K

[init]   cap quota:  968

[init]   ELF binary: init

[init]   priority:   0

[init]   provides service Input

[init]   provides service Framebuffer

[init] child "nitpicker"

[init]   RAM quota:  3848K

[init]   cap quota:  68

[init]   ELF binary: nitpicker

[init]   priority:   0

[init]   provides service Nitpicker

[init] child "pointer"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: pointer

[init]   priority:   0

[init] child "wm"

[init]   RAM quota:  32520K

[init]   cap quota:  968

[init]   ELF binary: init

[init]   priority:   0

[init]   provides service Nitpicker

[init] child "pdf_share"

[init]   RAM quota:  130824K

[init]   cap quota:  68

[init]   ELF binary: ram_fs

[init]   priority:   0

[init]   provides service File_system

[init] child "report_new_pdf"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: report_rom

[init]   priority:   0

[init]   provides service Report

[init]   provides service ROM

[init] child "fs_query"

[init]   RAM quota:  776K

[init]   cap quota:  68

[init]   ELF binary: fs_query

[init]   priority:   0

[init] child "test"

[init]   RAM quota:  65288K

[init]   cap quota:  668

[init]   ELF binary: sequence

[init]   priority:   0

[init] child "pdf_share" announces service "File_system"

[init] child "report_new_pdf" announces service "Report"

[init] child "report_new_pdf" announces service "ROM"

[init] child "timer" announces service "Timer"

[init -> report_new_pdf] report 'fs_query -> listing'

[init -> report_new_pdf]   <listing>

[init -> report_new_pdf]   	<dir path="/"/>

[init -> report_new_pdf]   </listing>

[init -> test -> sleep] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> drivers] Warning: input_filter assigned caps (80) exceed available caps (69)

[init -> test -> sleep] --- noux started ---

[init -> drivers -> acpi_drv] Found MADT

[init -> drivers -> acpi_drv] MADT IRQ 0 -> GSI 2 flags: 0

[init -> drivers -> acpi_drv] MADT IRQ 5 -> GSI 5 flags: 13

[init -> drivers -> acpi_drv] MADT IRQ 9 -> GSI 9 flags: 13

[init -> drivers -> acpi_drv] MADT IRQ 10 -> GSI 10 flags: 13

[init -> drivers -> acpi_drv] MADT IRQ 11 -> GSI 11 flags: 13

[init -> drivers -> acpi_drv] Found MCFG

[init -> drivers -> acpi_drv] MCFG BASE 0xb0000000 seg 0x0 bus 0x0-0xff

[init -> drivers -> acpi_drv] RSDT OEM 'BOCHS ', table id 'BXPCRSDT', revision 1, creator 'BXPC' (1)

[init -> drivers -> platform_drv] ECAM/MMCONF range 00:00.0-ff:1f.7 - addr [00000000b0000000,00000000c0000000)

[init -> drivers -> platform_drv] Root bridge: 00:00.0

[init -> drivers -> ps2_drv] Using keyboard with scan code set 1 (xlate)

[init -> drivers -> fb_drv] Found PCI VGA at 00:01.0

[init -> drivers -> usb_drv] Could not read screen resolution in config node

[init -> drivers -> usb_drv] Configured HID screen with 0x0 (multitouch=false)

[init -> drivers -> usb_drv] No <storage> config node found - not starting the USB Storage (Block) service

[init -> drivers -> usb_drv] No <nic> config node found - not starting the USB Nic (Network) service

[init -> drivers -> usb_drv] No <raw> config node found - not starting external USB service

[init -> drivers -> usb_drv] Enabled UHCI (USB 1.0/1.1) support

[init -> drivers -> usb_drv] Enabled EHCI (USB 2.0) support

[init -> drivers -> usb_drv] Enabled XHCI (USB 3.0) support

[init -> drivers -> fb_drv] fb mapped to 0x4000

[init -> drivers -> ps2_drv] detected ExPS/2 mouse - activating scroll-wheel and 5-button support

[init -> drivers -> platform_drv] PS2 uses IRQ, vector 0x1

[init -> drivers -> platform_drv] PS2 uses IRQ, vector 0xc

[init -> test -> sleep] Warning: heap could not free memory block

[init -> drivers -> fb_drv] Found: VESA BIOS version 3.0

[init -> drivers -> fb_drv] OEM: SeaBIOS VBE(C) 2011

[init -> test -> ls-before] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> drivers -> fb_drv] Found: physical frame buffer at 0xfd000000 size: 16777216

[init -> drivers -> fb_drv] fb mapped to 0xb000000

[init -> drivers -> fb_drv] using video mode: 1024x768@16

[init -> drivers -> fb_drv] using buffered output

[init] child "nitpicker" announces service "Nitpicker"

[init -> test -> ls-before] --- noux started ---

[init -> test -> ls-before] /dest:

[init -> test -> ls-before] total 0

[init -> test -> ls-before] drwxr-xr-x 0 root 0 0 Jan  1 00:00 .

[init -> test -> ls-before] drwxr-xr-x 0 root 0 0 Jan  1 00:00 ..

[init -> test -> ls-before] 

[init -> test -> ls-before] /source:

[init -> test -> ls-before] total 1

[init -> test -> ls-before] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .

[init -> test -> ls-before] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..

[init -> test -> ls-before] -r-xr-xr-x 0 root 0 8192 Jan  1 00:00 test.pdf

[init -> test -> ls-before] Warning: heap could not free memory block

[init -> test -> add] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> test -> add] --- noux started ---

[init -> fs_query] Error: failed to watch '//foo.pdf'

[init -> fs_query] Warning: could not obtain content of nonexistent file foo.pdf

[init -> report_new_pdf] report 'fs_query -> listing'

[init -> report_new_pdf]   <listing>

[init -> report_new_pdf]   	<dir path="/"/>

[init -> report_new_pdf]   </listing>

[init -> test -> add] Warning: heap could not free memory block

[init -> test -> ls-after] tar archive 'coreutils.tar' local at 0x158000, size is 12075008

[init -> test -> ls-after] --- noux started ---

[init -> test -> ls-after] /dest:

[init -> test -> ls-after] total 1

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..

[init -> test -> ls-after] -rwxrwxrwx 0 root 0 8192 Jan  1 00:00 foo.pdf

[init -> test -> ls-after] 

[init -> test -> ls-after] /source:

[init -> test -> ls-after] total 1

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 .

[init -> test -> ls-after] drwxr-xr-x 0 root 0    0 Jan  1 00:00 ..

[init -> test -> ls-after] -r-xr-xr-x 0 root 0 8192 Jan  1 00:00 test.pdf

[init -> test -> ls-after] Warning: heap could not free memory block

[init -> test -> pdf_view] + /home/guido/genode/contrib/mupdf-5b492514a8e9ba4db6bbf54dee54b94f068f0dae/src/lib/mupdf/pdf/pdf_xref.c:60: pdf_read_start_xref(): cannot find startxref

[init -> test -> pdf_view] | /home/guido/genode/contrib/mupdf-5b492514a8e9ba4db6bbf54dee54b94f068f0dae/src/lib/mupdf/pdf/pdf_xref.c:477: pdf_load_xref(): cannot read startxref

[init -> test -> pdf_view] \ /home/guido/genode/contrib/mupdf-5b492514a8e9ba4db6bbf54dee54b94f068f0dae/src/lib/mupdf/pdf/pdf_xref.c:537: pdf_open_xref_with_stream(): trying to repair

[init -> test -> pdf_view] MuPDF 0.9

[init -> test -> pdf_view] Copyright 2006-2011 Artifex Sofware, Inc.

[init -> test -> pdf_view] 

Expect: 'interact' received 'strg+c' and was cancelled
set build_components { app/pdf_view server/ram_fs app/fs_query app/sequence }

source ${genode_dir}/repos/base/run/platform_drv.inc

build $build_components

create_boot_directory

import_from_depot \
        [depot_user]/pkg/[drivers_interactive_pkg] \
        [depot_user]/pkg/motif_wm \
        [depot_user]/src/[base_src] \
        [depot_user]/src/init \
        [depot_user]/src/nitpicker \
        [depot_user]/src/coreutils \
        [depot_user]/src/bash \
        [depot_user]/src/init \
        [depot_user]/src/libc \
        [depot_user]/src/noux \
        [depot_user]/src/posix \
        [depot_user]/src/report_rom \
        [depot_user]/src/rom_to_file \
        [depot_user]/src/vfs \
        [depot_user]/src/vfs_import

set config {
<config verbose="yes">
        <parent-provides>
                <service name="ROM"/>
                <service name="IRQ"/>
                <service name="IO_MEM"/>
                <service name="IO_PORT"/>
                <service name="PD"/>
                <service name="RM"/>
                <service name="CPU"/>
                <service name="LOG"/>
        </parent-provides>
        <default-route>
                <service name="Nitpicker"> <child name="wm"/> </service>
                <any-service> <parent/> <any-child/> </any-service>
        </default-route>
        <default caps="100"/>

        <start name="timer">
                <resource name="RAM" quantum="1M"/>
                <provides><service name="Timer"/></provides>
        </start>

        <start name="drivers" caps="1000">
                <resource name="RAM" quantum="32M" constrain_phys="yes"/>
                <binary name="init"/>
                <route>
                        <service name="ROM" label="config"> <parent 
label="drivers.config"/> </service>
                        <service name="Timer"> <child name="timer"/> </service>
                        <any-service> <parent/> </any-service>
                </route>
                <provides>
                        <service name="Input"/> <service name="Framebuffer"/>
                </provides>
        </start>

        <start name="nitpicker">
                <resource name="RAM" quantum="4M"/>
                <provides><service name="Nitpicker"/></provides>
                <config focus="rom">
                        <domain name="pointer" layer="1" content="client" 
label="no" origin="pointer" />
                        <domain name="default" layer="2" content="client" 
label="no" hover="always"/>
                        <policy label_prefix="pointer" domain="pointer"/>
                        <default-policy domain="default"/>
                </config>
        </start>

        <start name="pointer">
                <resource name="RAM" quantum="1M"/>
                <route>
                        <service name="Nitpicker"> <child name="nitpicker"/> 
</service>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
        </start>

        <start name="wm" caps="1000">
                <resource name="RAM" quantum="32M"/>
                <binary name="init"/>
                <provides> <service name="Nitpicker"/> </provides>
                <route>
                        <service name="ROM" label="config"> <parent 
label="wm.config"/> </service>
                        <service name="Nitpicker"> <child name="nitpicker"/> 
</service>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
        </start>


        <!-- pdf_share is the filesystem that Linux writes pdf files to. -->
        <start name="pdf_share">
                <binary name="ram_fs"/>
                <resource name="RAM" quantum="128M"/>
                <provides> <service name="File_system"/> </provides>
<!--
                <route>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
-->
                <config verbose="yes">
                        <default-policy root="/" writeable="yes" />
                </config>
        </start>

        <!-- report_new_pdf reports to the pdf-viewer when there is a new pdf 
-->
        <start name="report_new_pdf">
                <binary name="report_rom"/>
                <resource name="RAM" quantum="1M"/>
                <provides> <service name="Report"/> <service name="ROM"/> 
</provides>
                <config verbose="yes"/>
        </start>

        <!-- fs_query monitors the pdf_share for new files and writes a report 
into report_new_pdf -->
        <start name="fs_query">
                <resource name="RAM" quantum="1M"/>
                <config verbose="yes">
                        <!-- <vfs> <dir name="fs"> <fs writeable="yes"/> </dir> 
</vfs> -->
                        <vfs> <fs writeable="yes"/> </vfs>
                        <query path="/" content="no"/>
                </config>
<!--
                <route>
                        <service name="File_system"> <child name="pdf_share" /> 
</service>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
-->
        </start>


        <!-- TODO? rom_to_file picks up the new pdf from the report_new_pdf 
rom, makes it a file -->


        <start name="test" caps="700">
                <binary name="sequence"/>
                <resource name="RAM" quantum="64M"/>
                <config>
                        <start name="sleep" caps="500">
                                <binary name="noux"/>
                                <config stdin="/dev/null" stdout="/dev/log" 
stderr="/dev/log">
                                        <fstab>
                                                <tar name="coreutils.tar" />
                                                <dir name="dev"> <log/> <null/> 
</dir>
                                        </fstab>
                                        <start name="/bin/sleep"> <arg 
value="2"/> </start>
                                </config>
                        </start>

                        <start name="ls-before" caps="500">
                                <binary name="noux"/>
                                <config stdin="/dev/null" stdout="/dev/log" 
stderr="/dev/log">
                                        <fstab>
                                                <tar name="coreutils.tar" />
                                                <dir name="dest"> <fs 
writeable="yes"/> </dir>
                                                <dir name="dev"> <log/> <null/> 
</dir>
                                                <dir name="source"> <rom 
name="test.pdf" /> </dir>
                                        </fstab>
                                        <start name="/bin/ls">
                                               <arg value="-laR" />
                                               <arg value="/source" />
                                               <arg value="/dest" />
                                        </start>
0                               </config>
<!--
                                <route>
                                        <!- - <service name="File_system"> 
<child name="pdf-view-fs" /> </service>- ->
                                        <service name="File_system"> <parent /> 
</service>
                                        <any-service> <parent/> <any-child/> 
</any-service>
                                </route>
-->
                        </start>

                        <start name="add" caps="500">
                                <binary name="noux"/>
                                <config stdin="/dev/null" stdout="/dev/log" 
stderr="/dev/log">
                                        <fstab>
                                                <tar name="coreutils.tar" />
                                                <dir name="dest"> <fs 
writeable="yes"/> </dir>
                                                <dir name="dev"> <log/> <null/> 
</dir>
                                                <dir name="source"> <rom 
name="test.pdf" /> </dir>
                                        </fstab>

                                        <start name="/bin/cp">
                                                <arg value="/source/test.pdf" />
                                                <!-- <arg value="/dev/null" /> 
-->
                                                <arg value="/dest/foo.pdf" />
                                        </start>
                                </config>
<!--
                                <route>
                                        <!- - <service name="File_system"> 
<child name="pdf-view-fs" /> </service>- ->
                                        <service name="File_system"> <parent /> 
</service>
                                        <any-service> <parent/> <any-child/> 
</any-service>
                                </route>
-->
                        </start>

                        <start name="ls-after" caps="500">
                                <binary name="noux"/>
                                <config stdin="/dev/null" stdout="/dev/log" 
stderr="/dev/log">
                                        <fstab>
                                                <tar name="coreutils.tar" />
                                                <dir name="dest"> <fs 
writeable="yes"/> </dir>
                                                <dir name="dev"> <log/> <null/> 
</dir>
                                                <dir name="source"> <rom 
name="test.pdf" /> </dir>
                                        </fstab>
                                        <start name="/bin/ls">
                                               <arg value="-laR" />
                                               <arg value="/source" />
                                               <arg value="/dest" />
                                        </start>
                                </config>
<!--
                                <route>
                                        <!- - <service name="File_system"> 
<child name="pdf-view-fs" /> </service>- ->
                                        <service name="File_system"> <parent /> 
</service>
                                        <any-service> <parent/> <any-child/> 
</any-service>
                                </route>
-->
                        </start>

                        <start name="pdf_view" caps="256">
                               <resource name="RAM" quantum="1G"/>
                               <config>
                                        <vfs>
                                                <dir name="dev"> <log/> </dir>
                                                <fs /> <!-- points to pdf_share 
-->
                                        </vfs>
                                        <libc stdout="/dev/log" 
stderr="/dev/log"/>
                                </config>
<!--
                                <route>
                                        <service name="Nitpicker">   <child 
name="nitpicker" /> </service>
                                        <service name="File_system"> <child 
name="pdf-view-fs" /> </service>
                                        <!- - /dev/log goes to any service LOG 
- ->
                                        <any-service> <parent/> <any-child/> 
</any-service>
                                </route>
-->
                        </start>

                </config>
<!--
                <route>
                        <service name="File_system"> <child name="pdf_share" /> 
</service>
                        <!- - <service name="File_system"> <parent /> 
</service> - ->
                        <any-service> <any-child/> <parent/> </any-service>
                </route>
-->
        </start>


<!--
        <start name="rom_to_file">
                <resource name="RAM" quantum="2M"/>
                <config rom="dynamic_rom"/>
                <route>
                        <service name="ROM" label="dynamic_rom"> <child 
name="dynamic_rom"/> </service>
                        <service name="File_system" > <child name="vfs"/> 
</service>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
        </start>
-->
        <!-- TODO: Feed the rom-to-file file to a fresh instance of pdf-view. 
-->

     <!-- start a dynamic sub-init here -->
<!--
        <start name="pdf-view-fs">
                <binary name="ram_fs"/>
                <resource name="RAM" quantum="256M"/>
                <provides> <service name="File_system"/> </provides>
                <route>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
                <config>
                        <default-policy root="/" writeable="yes" />
                </config>
        </start>

        <start name="pdf_view" caps="256">
                <resource name="RAM" quantum="1G"/>
                <config>
                        <vfs>
                                <dir name="dev"> <log/> </dir>
                                <fs /> <!- - points to pdf_share - ->
                        </vfs>
                        <libc stdout="/dev/log" stderr="/dev/log"/>
                </config>
                <route>
                        <service name="Nitpicker">   <child name="nitpicker" /> 
</service>
                        <service name="File_system"> <child name="pdf-view-fs" 
/> </service>
                        <!- - /dev/log goes to any service LOG - ->
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
        </start>
-->
        <!-- end sub-init here -->

<!--
        <start name="pdf_view" caps="256">
                <resource name="RAM" quantum="1G"/>
                <config>
                        <vfs>
                                <rom name="test.pdf" />
                                <dir name="dev"> <log/> </dir>
                        </vfs>
                        <libc stdout="/dev/log" stderr="/dev/log"/>
                </config>
        </start>
-->

</config>
}

install_config $config

#
# Downloadotest PDF file
#
if {![file exist bin/test.pdf]} {
        set pdf_url 
"http://genode-labs.com/publications/genode-fpga-graphics-2009.pdf";
        catch { exec wget $pdf_url -O bin/test.pdf }
}

if {![file exist bin/test.pdf]} {
        puts stderr "Could not download test PDF from '$pdf_url'"
        exit 1
}

#
# Pin the nitpicker focus to the window manager by providing a static focus ROM
#
set fd [open [run_dir]/genode/focus w]
puts $fd "<focus label=\"wm -> focus\"/>"
close $fd

append boot_modules {
        libc.lib.so vfs.lib.so libm.lib.so
        openjpeg.lib.so freetype.lib.so libpng.lib.so zlib.lib.so 
jbig2dec.lib.so
        mupdf.lib.so jpeg.lib.so
        ram_fs
        fs_query sequence
        pdf_view
        test.pdf
}

build_boot_image $boot_modules

append qemu_args " -m 1536"

set env(SDL_VIDEO_X11_DGAMOUSE) 0

run_genode_until forever

_______________________________________________
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users

Reply via email to