Hi, I've been trying to use libpng inside the secure world of i.MX53 QSB TrustZone aware TZ_VMM example.
I want to receive an image from the normal world (running Linux) and do some process the image in some way inside the secure world.
I understand the flow of genode and tz_vmm in particular and there are some examples on how to communicate data between the normal and secure world, so that's not my problem right now. My problem is that I cannot run tz_vmm after adding libpng as a lib.
In order to use libpng inside tz_vmm I did the following: 1) in $(BUILDDIR)/etc/build.conf uncommented this line REPOSITORIES += $(GENODE_DIR)/repos/libports
2) inside $(GENODE_DIR)/repos/libports I did: make prepare PKG="libc zlib libpng"
3) inside $(BUILDDIR)/repos/os/src/server/tz_vmm/spec/imx53 I added the following to target.inc LIBS += libc LIBS += zlib LIBS += libpng
4) then I added #include <png.h> inside main.cc
5) finally inside $(BUILDDIR) I did make run/tz_vmm
All these steps compiled fine, but when I run this on my board the following message comes up:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 7888432 Bytes = 7.5 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 242 MB to init int main(): --- init created, waiting for exit condition --- [init] Could not open ROM session for module "ld.lib.so" [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] Dynamically linked file found, but no dynamic linker binary present [init] unknown exception? [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0
What have I done wrong? It seems I need to add a binary somewhere, but I don't know where. Do I need to compile anything else in order to libpng to be usable inside genode?
Thanks in advance!
Best regards, Tiago
Hello Tiago,
On 06/01/2016 01:07 PM, Tiago Brito wrote:
Hi, I've been trying to use libpng inside the secure world of i.MX53 QSB TrustZone aware TZ_VMM example.
I want to receive an image from the normal world (running Linux) and do some process the image in some way inside the secure world.
I understand the flow of genode and tz_vmm in particular and there are some examples on how to communicate data between the normal and secure world, so that's not my problem right now. My problem is that I cannot run tz_vmm after adding libpng as a lib.
In order to use libpng inside tz_vmm I did the following: 1) in $(BUILDDIR)/etc/build.conf uncommented this line REPOSITORIES += $(GENODE_DIR)/repos/libports
2) inside $(GENODE_DIR)/repos/libports I did: make prepare PKG="libc zlib libpng" 3) inside $(BUILDDIR)/repos/os/src/server/tz_vmm/spec/imx53 I added the
following to target.inc LIBS += libc LIBS += zlib LIBS += libpng
4) then I added #include <png.h> inside main.cc 5) finally inside $(BUILDDIR) I did make run/tz_vmm
All these steps compiled fine, but when I run this on my board the following message comes up:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 7888432 Bytes = 7.5 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 242 MB to init int main(): --- init created, waiting for exit condition --- [init] Could not open ROM session for module "ld.lib.so" [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] Dynamically linked file found, but no dynamic linker binary present [init] unknown exception? [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0
What have I done wrong? It seems I need to add a binary somewhere, but I don't know where. Do I need to compile anything else in order to libpng to be usable inside genode?
Thanks in advance!
You missed to add the dynamic linker itself to the files to be loaded. It is called ld.lib.so and can be found in your build-directory under bin/. PLease also add all other *.lib.so files to your bootloader configuration resp. the run-script.
Regards Stefan
Best regards, Tiago
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
2016-06-01 12:31 GMT+01:00 Stefan Kalkowski < stefan.kalkowski@...1...>:
Hello Tiago,
On 06/01/2016 01:07 PM, Tiago Brito wrote:
Hi, I've been trying to use libpng inside the secure world of i.MX53 QSB TrustZone aware TZ_VMM example.
I want to receive an image from the normal world (running Linux) and do some process the image in some way inside the secure world.
I understand the flow of genode and tz_vmm in particular and there are
some
examples on how to communicate data between the normal and secure world,
so
that's not my problem right now. My problem is that I cannot run tz_vmm after adding libpng as a lib.
In order to use libpng inside tz_vmm I did the following: 1) in $(BUILDDIR)/etc/build.conf uncommented this line REPOSITORIES += $(GENODE_DIR)/repos/libports
2) inside $(GENODE_DIR)/repos/libports I did: make prepare PKG="libc zlib libpng" 3) inside $(BUILDDIR)/repos/os/src/server/tz_vmm/spec/imx53 I added
the
following to target.inc LIBS += libc LIBS += zlib LIBS += libpng
4) then I added #include <png.h> inside main.cc 5) finally inside $(BUILDDIR) I did make run/tz_vmm
All these steps compiled fine, but when I run this on my board the following message comes up:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 7888432 Bytes = 7.5 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 242 MB to init int main(): --- init created, waiting for exit condition --- [init] Could not open ROM session for module "ld.lib.so" [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] Dynamically linked file found, but no dynamic linker binary
present
[init] unknown exception? [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0
What have I done wrong? It seems I need to add a binary somewhere, but I don't know where. Do I need to compile anything else in order to libpng
to
be usable inside genode?
Thanks in advance!
You missed to add the dynamic linker itself to the files to be loaded. It is called ld.lib.so and can be found in your build-directory under bin/. PLease also add all other *.lib.so files to your bootloader configuration resp. the run-script.
Thanks Stefan, I did what you say and it compiled without any problem, but I still cannot run the example. I changed the tz_vmm run script like so: set boot_modules { core init ld.lib.so libc.lib.so zlib.lib.so libpng.lib.so tz_vmm linux }
It now fails even before launching Genode. This is the output:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 8523403 Bytes = 8.1 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... Error: inflate() returned -3 gzip compressed: uncompress error -1 Must RESET board to recover resetting ...
Does this mean the image is corrupted in any way and thus it cannot be uncompressed?
Thanks, Tiago
Regards Stefan
I actually solved this, it looks like the image is to big after adding the binaries. So the solution was setting the bootload to load the image to a higher address: before - ext2load mmc 0:1 0x70200000 uImage; bootm 0x70200000 after - ext2load mmc 0:1 0x70400000 uImage; bootm 0x70400000
But although this is solved it looks like the example still cannot run. This is the output:
## Booting kernel from Legacy Image at 70400000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 8523403 Bytes = 8.1 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 241 MB to init int main(): --- init created, waiting for exit condition --- [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0 [init -> tz_vmm] Could not open ROM session for module "config" [init -> tz_vmm] Could not obtain config file [init -> tz_vmm] Could not open ROM session for module "libm.lib.so" [init -> tz_vmm] abort called - thread: 'main' [init] virtual void Genode::Child_policy::exit(int): child "tz_vmm" exited with exit value 1
It looks like the output mentions libm, do I need math lib in order to run libpng? I don't see libm inside $(GENODE_DIR)/repos/libports/ports
Thanks, Tiago
2016-06-01 12:50 GMT+01:00 Tiago Brito <tb.genode@...9...>:
2016-06-01 12:31 GMT+01:00 Stefan Kalkowski < stefan.kalkowski@...1...>:
Hello Tiago,
On 06/01/2016 01:07 PM, Tiago Brito wrote:
Hi, I've been trying to use libpng inside the secure world of i.MX53 QSB TrustZone aware TZ_VMM example.
I want to receive an image from the normal world (running Linux) and do some process the image in some way inside the secure world.
I understand the flow of genode and tz_vmm in particular and there are
some
examples on how to communicate data between the normal and secure
world, so
that's not my problem right now. My problem is that I cannot run tz_vmm after adding libpng as a lib.
In order to use libpng inside tz_vmm I did the following: 1) in $(BUILDDIR)/etc/build.conf uncommented this line REPOSITORIES += $(GENODE_DIR)/repos/libports
2) inside $(GENODE_DIR)/repos/libports I did: make prepare PKG="libc zlib libpng" 3) inside $(BUILDDIR)/repos/os/src/server/tz_vmm/spec/imx53 I added
the
following to target.inc LIBS += libc LIBS += zlib LIBS += libpng
4) then I added #include <png.h> inside main.cc 5) finally inside $(BUILDDIR) I did make run/tz_vmm
All these steps compiled fine, but when I run this on my board the following message comes up:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 7888432 Bytes = 7.5 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 242 MB to init int main(): --- init created, waiting for exit condition --- [init] Could not open ROM session for module "ld.lib.so" [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] Dynamically linked file found, but no dynamic linker binary
present
[init] unknown exception? [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0
What have I done wrong? It seems I need to add a binary somewhere, but I don't know where. Do I need to compile anything else in order to libpng
to
be usable inside genode?
Thanks in advance!
You missed to add the dynamic linker itself to the files to be loaded. It is called ld.lib.so and can be found in your build-directory under bin/. PLease also add all other *.lib.so files to your bootloader configuration resp. the run-script.
Thanks Stefan, I did what you say and it compiled without any problem, but I still cannot run the example. I changed the tz_vmm run script like so: set boot_modules { core init ld.lib.so libc.lib.so zlib.lib.so libpng.lib.so tz_vmm linux }
It now fails even before launching Genode. This is the output:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 8523403 Bytes = 8.1 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... Error: inflate() returned -3 gzip compressed: uncompress error -1 Must RESET board to recover resetting ...
Does this mean the image is corrupted in any way and thus it cannot be uncompressed?
Thanks, Tiago
Regards Stefan
Ok, so the problem was that I missed to link libm as well. I didn't noticed libm was needed. Now it works and linux boots successfully.
But I still have some messages during the boot process which weren't there before and is probably some to do with my configuration. This is the output:
## Booting kernel from Legacy Image at 70400000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 8596638 Bytes = 8.2 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 241 MB to init int main(): --- init created, waiting for exit condition --- [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0 [init -> tz_vmm] Could not open ROM session for module "config" [init -> tz_vmm] Could not obtain config file [init -> tz_vmm] no VFS configured [init -> tz_vmm] Start virtual machine ...
How do I configure VFS?
Thanks in advance! Tiago
2016-06-01 14:11 GMT+01:00 Tiago Brito <tb.genode@...9...>:
I actually solved this, it looks like the image is to big after adding the binaries. So the solution was setting the bootload to load the image to a higher address: before - ext2load mmc 0:1 0x70200000 uImage; bootm 0x70200000 after - ext2load mmc 0:1 0x70400000 uImage; bootm 0x70400000
But although this is solved it looks like the example still cannot run. This is the output:
## Booting kernel from Legacy Image at 70400000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 8523403 Bytes = 8.1 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 241 MB to init int main(): --- init created, waiting for exit condition --- [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0 [init -> tz_vmm] Could not open ROM session for module "config" [init -> tz_vmm] Could not obtain config file [init -> tz_vmm] Could not open ROM session for module "libm.lib.so" [init -> tz_vmm] abort called - thread: 'main' [init] virtual void Genode::Child_policy::exit(int): child "tz_vmm" exited with exit value 1
It looks like the output mentions libm, do I need math lib in order to run libpng? I don't see libm inside $(GENODE_DIR)/repos/libports/ports
Thanks, Tiago
2016-06-01 12:50 GMT+01:00 Tiago Brito <tb.genode@...9...>:
2016-06-01 12:31 GMT+01:00 Stefan Kalkowski < stefan.kalkowski@...1...>:
Hello Tiago,
On 06/01/2016 01:07 PM, Tiago Brito wrote:
Hi, I've been trying to use libpng inside the secure world of i.MX53
QSB
TrustZone aware TZ_VMM example.
I want to receive an image from the normal world (running Linux) and do some process the image in some way inside the secure world.
I understand the flow of genode and tz_vmm in particular and there are
some
examples on how to communicate data between the normal and secure
world, so
that's not my problem right now. My problem is that I cannot run tz_vmm after adding libpng as a lib.
In order to use libpng inside tz_vmm I did the following: 1) in $(BUILDDIR)/etc/build.conf uncommented this line REPOSITORIES += $(GENODE_DIR)/repos/libports
2) inside $(GENODE_DIR)/repos/libports I did: make prepare PKG="libc zlib libpng" 3) inside $(BUILDDIR)/repos/os/src/server/tz_vmm/spec/imx53 I
added the
following to target.inc LIBS += libc LIBS += zlib LIBS += libpng
4) then I added #include <png.h> inside main.cc 5) finally inside $(BUILDDIR) I did make run/tz_vmm
All these steps compiled fine, but when I run this on my board the following message comes up:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 7888432 Bytes = 7.5 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK
Starting kernel ...
kernel initialized Genode 16.02 int main(): --- create local services --- int main(): --- start init --- int main(): transferred 242 MB to init int main(): --- init created, waiting for exit condition --- [init] Could not open ROM session for module "ld.lib.so" [init] parent provides [init] service "ROM" [init] service "RAM" [init] service "IRQ" [init] service "IO_MEM" [init] service "IO_PORT" [init] service "CAP" [init] service "PD" [init] service "RM" [init] service "CPU" [init] service "LOG" [init] service "SIGNAL" [init] service "VM" [init] Dynamically linked file found, but no dynamic linker binary
present
[init] unknown exception? [init] child "tz_vmm" [init] RAM quota: 10203136 [init] ELF binary: tz_vmm [init] priority: 0
What have I done wrong? It seems I need to add a binary somewhere, but
I
don't know where. Do I need to compile anything else in order to
libpng to
be usable inside genode?
Thanks in advance!
You missed to add the dynamic linker itself to the files to be loaded. It is called ld.lib.so and can be found in your build-directory under bin/. PLease also add all other *.lib.so files to your bootloader configuration resp. the run-script.
Thanks Stefan, I did what you say and it compiled without any problem, but I still cannot run the example. I changed the tz_vmm run script like so: set boot_modules { core init ld.lib.so libc.lib.so zlib.lib.so libpng.lib.so tz_vmm linux }
It now fails even before launching Genode. This is the output:
## Booting kernel from Legacy Image at 70200000 ... Image Name: Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 8523403 Bytes = 8.1 MiB Load Address: 70010000 Entry Point: 70010000 Verifying Checksum ... OK Uncompressing Kernel Image ... Error: inflate() returned -3 gzip compressed: uncompress error -1 Must RESET board to recover resetting ...
Does this mean the image is corrupted in any way and thus it cannot be uncompressed?
Thanks, Tiago
Regards Stefan
Hi Tiago,
On 01.06.2016 15:20, Tiago Brito wrote:
[init -> tz_vmm] Could not open ROM session for module "config" [init -> tz_vmm] Could not obtain config file [init -> tz_vmm] no VFS configured [init -> tz_vmm] Start virtual machine ...
How do I configure VFS?
Please have a look here:
http://genode.org/documentation/release-notes/14.05#Per-process_virtual_file...
For a working example of using libpng, you may also refer to the configuration of the 'backdrop' component in the nano3d.run script:
https://github.com/genodelabs/genode/blob/master/repos/gems/run/nano3d.run
Cheers Norman
Hello Tiago,
On Wed, Jun 01, 2016 at 12:50:33PM +0100, Tiago Brito wrote:
Thanks Stefan, I did what you say and it compiled without any problem, but I still cannot run the example. I changed the tz_vmm run script like so: set boot_modules { core init ld.lib.so libc.lib.so zlib.lib.so libpng.lib.so tz_vmm linux }
Any practical issues aside I doubt that linking all your aspired functionality to tz_vmm is the proper approach. Genode is a component framework and access rights of components follow the principle of least authority. The task of tz_vmm is controlling the execution of the Linux VM and providing required device emulation. Trusted functions beyond this task (e.g., processing of PNG images) should be placed in distinct components. Then, the tz_vmm can use these components via dedicated inter-component interfaces by RPC, shared memory, and signals.
A positive side effect of this approach is that you may develop, debug, and test your PNG processor independently from tz_vmm (or even i.MX53) given a small mockup environemnt is prepared.
Greets
Thanks for the advice Christian!
2016-06-02 13:16 GMT+01:00 Christian Helmuth < christian.helmuth@...1...>:
Hello Tiago,
On Wed, Jun 01, 2016 at 12:50:33PM +0100, Tiago Brito wrote:
Thanks Stefan, I did what you say and it compiled without any problem,
but
I still cannot run the example. I changed the tz_vmm run script like so: set boot_modules { core init ld.lib.so libc.lib.so zlib.lib.so libpng.lib.so tz_vmm linux }
Any practical issues aside I doubt that linking all your aspired functionality to tz_vmm is the proper approach. Genode is a component framework and access rights of components follow the principle of least authority. The task of tz_vmm is controlling the execution of the Linux VM and providing required device emulation. Trusted functions beyond this task (e.g., processing of PNG images) should be placed in distinct components. Then, the tz_vmm can use these components via dedicated inter-component interfaces by RPC, shared memory, and signals.
A positive side effect of this approach is that you may develop, debug, and test your PNG processor independently from tz_vmm (or even i.MX53) given a small mockup environemnt is prepared.
Greets
Christian Helmuth Genode Labs
http://www.genode-labs.com/ · http://genode.org/ https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main