Hi all,
I tried the graphical Genode on Codezero demo and I have developed the bare-metal applications on Codezero Hypervisor. So I think that it's good idea if I could boot two container. One container contient the graphical Genode and the other contient my bare-metal app, 'Hello Word'.
So I modified the liker script in base-codezero/src/platform/genode.ld so I could have two container when the script /tools/create_builddir is executed.
I executed first time the command 'make run/demo' on my builddir. It complain very normal the makefile could not find my app. So I create a directoire "Hello_Word" in <my builddire>/kernel/codezero/conts/baremetal/
I retried the command 'made run/demo'I have the error :
Building userspace libraries...
Building containers...
Building the kernel...
Building the loader and packing...
Building qemu-insight-script...
Build complete...
Run qemu with following command: ./tools/run-qemu-insight
scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/home/lbtruong/genode.11/buildCode0/kernel/codezero/conts/baremetal/hello_world/SConstruct", line 52, in <module> while executing "exec sh -c $command" (procedure "exec_sh" line 3) invoked from within "exec_sh "cd [kernel_dir]; PATH=$prepend_path:$PATH ./build.py"" (procedure "build_boot_image" line 29) invoked from within "build_boot_image $boot_modules" (file "/home/lbtruong/genode.11/os/run/demo.run" line 107) invoked from within "source $include_name" ("foreach" body line 3) invoked from within "foreach include_name [get_cmd_arg --include ""] { puts "using run script $include_name" source $include_name }" (file "/home/lbtruong/genode.11/tool/run" line 443) make: *** [run/demo] Erreur 1 make: quittant le répertoire « /home/lbtruong/genode.11/buildCode0 »
But I have already patch my Codezero source in base-codezero/contrib directory with your patch "[codezero-devel] patch: SCons 2.0.1"
And I saw that Code Zero have success to build the final.elf image. So I tried boot the image with qemu-system-arm
VM area at [00001000,50000000) :phys_alloc: Allocator 150660 dump: Block: [000b0000,00170000) size=000c0000 avail=000c0000 max_avail=03a69000 Block: [00597000,04000000) size=03a69000 avail=03a69000 max_avail=03a69000 => mem_size=62033920 (59 MB) / mem_avail=62033920 (59 MB) :virt_alloc: Allocator 150ac0 dump: Block: [00001000,00002000) size=00001000 avail=00000000 max_avail=00000000 Block: [00002000,00100000) size=000fe000 avail=000fe000 max_avail=3fe90000 Block: [00170000,40000000) size=3fe90000 avail=3fe90000 max_avail=3fe90000 => mem_size=1073278976 (1023 MB) / mem_avail=1073274880 (1023 MB) :io_mem_alloc: Allocator 15536c dump: Block: [04000000,80000000) size=7c000000 avail=7c000000 max_avail=7c000000 => mem_size=2080374784 (1984 MB) / mem_avail=2080374784 (1984 MB) l4_thread_control returned -3, spid=1
create_thread returned -1 core started local thread "entrypoint" with ID -1 cont1: Hello world from hello_world1!
I could see that my app is successful executed but not the Genode.
Would you like give me somme advices ?
Thanks,
Le Bao
Hello Le Bao,
I tried the graphical Genode on Codezero demo and I have developed the bare-metal applications on Codezero Hypervisor. So I think that it's good idea if I could boot two container. One container contient the graphical Genode and the other contient my bare-metal app, 'Hello Word'.
So I modified the liker script in base-codezero/src/platform/genode.ld so I could have two container when the script /tools/create_builddir is executed.
Admittedly, I have never played with multiple containers on Codezero. So you are walking on uncharted ground here. One problem that I see is that the Genode run environment configures the Codezero kernel with the default configuration provided at
base-codezero/config/vpb926.cml
This configuration sets up only one container. So the simple 'make run/demo' procedure will result in the use of only a single container. For using multiple containers, you will most likely need to do the configuration and integration work the Codezero way and manually copy the result of the Genode build ('main.elf' and 'modules.elf') into the Codezero container.
I retried the command 'made run/demo'I have the error :
...
scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead.
My patch only covered the parts of Codezero needed Genode. Here SCons complains about 'conts/baremetal/hello_world/SConstruct', which is not covered in the patch. Replacing 'build_dir' by 'variant_dir' in this file should fix the problem.
And I saw that Code Zero have success to build the final.elf image. So I tried boot the image with qemu-system-arm
VM area at [00001000,50000000) :phys_alloc: Allocator 150660 dump:
...
l4_thread_control returned -3, spid=1
create_thread returned -1 core started local thread "entrypoint" with ID -1 cont1: Hello world from hello_world1!
This does not look bad at all for a start! :-) Genode's core is showing its first life sign (those messages about the allocators are printed by core). Now, something goes wrong when Genode's core tries to spawn the first thread. The problem happens within the 'create_thread' function at 'base-codezero/src/core/thread_start.cc'. We should figure out what the kernel tries to tell us with the error code -3.
A look in the kernel code in the function 'sys_thread_control' at 'src/api/thread.c' reveals that the problem is somehow related to the 'tcb_find' operation (the ESRCH error code is -3). This function operates on the IDs supplied as argument to the syscall. In the 'create_thread' function, the IDs struct is set to { 1, space_no, TASK_ID_INVALID }. Maybe these arguments are wrong in the presence of more than one container? To track down the problem, you could try to find out why exactly 'tcb_find' is failing.
Good luck! Norman