Porting base-hw to ARM Juno with TrustZone
Stefan Kalkowski
stefan.kalkowski at ...1...
Thu Jun 25 11:48:24 CEST 2015
Hi Matthias,
On 06/24/2015 04:41 PM, Matthias Lorenz wrote:
> Hello,
>
> I'm interested in porting genode base-hw to ARM Juno (Vexpress64)
> (http://www.arm.com/products/tools/development-boards/versatile-express/juno-arm-development-platform.php).
>
Well, that's very good news! I like to support you gladly where I can.
> Can somebody estimate how much time and work this would take?
It is hard to estimate the effort even more the time one needs to
implement it. In your stead I would estimate the effort to port the HW
kernel to a completely new architecture.
I assume you want to run Genode in AArch64 and not in AArch32
compatibility mode? Given that you want to run it on top of the new
64-bit instruction set, I assume you have to implement translation
tables, CPU/MMU driver, Interrupt controller, and exception vectors from
scratch. Dependent on whether you already have in depth knowledge of the
Armv8 architecture or not, I would estimate something between 3 months
and 6 months. But I have to admit, I'm always quite conservative in
estimations ;-)
> Are there any good starting points to start my work/research?
I'm afraid there is no "How to port the HW kernel to a new
architecture". But there are quite some interesting in-depth
descriptions about Genode, core, and the HW kernel within the Genode
Foundations, recently released:
http://genode.org/documentation/genode-foundations-15-05.pdf
Especially the sections 7.3 and 7.6 should be of interest for you.
> Are there certain things I should be aware of?
Sure. I would start with building a skeleton for base-hw's core:
* Create a new spec-file for your board, and the Armv8 architecture:
e.g.: repos/base-hw/mk/spec-hw_juno.mk and
repos/base/mk/spec-armv8.mk
* Firstly, do not include a 'SPEC' variable for 'arm' nor include any
generic arm files in the files you add to prohibit code that
compiles but does something unwanted, or add code that is not
necessary, if you later detect intersecting code between your Armv8
code and other Arm resp. Armv7 code it can be unified then
* Create a build-description for Genode's base library used by all
components in repos/base-hw/lib/mk/arm_v8/base-common.mk that looks
like the following:
include $(REP_DIR)/lib/mk/base-common.inc
vpath kernel/interface.cc $(REP_DIR)/src/base/arm_v8
* Create a build-description for core resp. kernel in
repos/base-hw/lib/mk/arm_v8/core.mk that looks like:
INC_DIR += $(REP_DIR)/src/core/include/spec/arm_v8
SRC_S += spec/arm_v8/mode_transition.s
SRC_S += spec/arm_v8/kernel/crt0.s
SRC_S += spec/arm_v8/crt0.s
SRC_CC += spec/arm_v8/cpu.cc
SRC_CC += spec/arm_v8/pic.cc
SRC_CC += spec/arm_v8/platform_support.cc
SRC_CC += spec/arm_v8/kernel/thread_base.cc
SRC_CC += spec/arm_v8/kernel/thread.cc
SRC_CC += spec/arm_v8/kernel/cpu.cc
SRC_CC += spec/arm_v8/kernel/pd.cc
SRC_CC += kernel/vm_thread.cc
SRC_CC += platform_services.cc
include $(REP_DIR)/lib/mk/core.inc
* Create above C++ and assembler files files within the repos/base-hw
directory. And try to compile core in a newly created build
directory that targets your new spec-file (hw_juno). The compiler
will bleat about some missing header files, you can create within
repos/base-hw/src/core/include/spec/arm_v8
* You can first fill the files with class and function skeletons
depending on what compiler and linker is argueing about. The class
layouts and function signatures can be found in the corresponding
files for x86_64, arm_v7 armv6, or arm. But I would really just add
code lazily, so you really get skeleton-code referenced by generic
code, and no platform specifics copied eagerly.
* You will have to add a board-specific description in
base/include/platform/juno/drivers/board_base.h that contains the
memory layout and interrupt numbers for the PIC, timer, UART etc.
* You hopefully can re-use the UART from the Versatile Express board
These are the very first steps. When you reach the point where core
compiles and gets linked correctly, you can start to fill the routines
with life.
Feel free to ask any question of understanding, or if you get stuck at
certain points.
Best Regards
Stefan
> Any help would be much appreciated.
>
>
> I have already modified the ARM Trusted Firmware
> (https://github.com/ARM-software/arm-trusted-firmware)
> and U-Boot running in EL3.
> The main goal is to run genode in EL3.
>
>
> Best regards
>
> Matthias
>
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
--
Stefan Kalkowski
Genode Labs
http://www.genode-labs.com/ ยท http://genode.org/
More information about the users
mailing list